JabRef / layouts.jabref.org

Collection of .layout files
17 stars 8 forks source link

Absolutely baffled by trying to add pmid field to listrefs.layout. Any help appreciated! #4

Closed curtcorum closed 2 weeks ago

curtcorum commented 3 weeks ago

Starting with the listrefs.layout file:

<tr id="\format{\bibtexkey}" class="entry">
    <td>\begin{author}\format[Authors(LastFirst,NoPunc,InitialsNoSpace),HTMLChars]{\author}\end{author} (\year), <i>"\format[HTMLChars]{\title}"</i>\begin{journal}, \format[HTMLChars]{\journal}.\end{journal}\begin{booktitle}, In \format[HTMLChars]{\booktitle}.\end{booktitle}\begin{howpublished}, \howpublished.\end{howpublished}\begin{school}. Thesis at: \format[HTMLChars]{\school}.\end{school}\begin{address} \format[HTMLChars]{\address}\end{address}\begin{month}, \format[HTMLChars]{\month}, \year.\end{month} \begin{volume} Vol. \volume\end{volume}\begin{number}(\format[FormatPagesForHTML]{\number})\end{number}\begin{pages}, pp. \format[FormatPagesForHTML]{\pages}.\end{pages}\begin{publisher} \format[HTMLChars]{\publisher}.\end{publisher}
    <p class="infolinks">\begin{abstract}[<a href="javascript:toggleInfo('\format{\bibtexkey}','abstract')">Abstract</a>]\end{abstract}\begin{review} [<a href="javascript:toggleInfo('\format{\bibtexkey}','review')">Review</a>] \end{review} [<a href="javascript:toggleInfo('\format{\bibtexkey}','bibtex')">BibTeX</a>]\begin{doi} [<a href="\format[DOICheck]{\doi}" target="_blank">DOI</a>]\end{doi}\begin{url} [<a href="\format{\url}" target="_blank">URL</a>]\end{url}\begin{file} [<a href="\format[WrapFileLinks(\r,,pdf)]{\file}" target="_blank">PDF</a>]\end{file}</p>
    </td>
</tr>\begin{abstract}
<tr id="abs_\format{\bibtexkey}" class="abstract noshow">
    <td><b>Abstract</b>: \format[HTMLChars]{\abstract}</td>
</tr>\end{abstract}\begin{review}
<tr id="rev_\format{\bibtexkey}" class="review noshow">
    <td><b>Review</b>: \format[HTMLChars]{\review}</td>
</tr>\end{review}
<tr id="bib_\format{\bibtexkey}" class="bibtex noshow">
<td><b>BibTeX</b>:
<pre>
@\format[ToLowerCase]{\bibtextype}{\bibtexkey,\begin{author}
  author = {\format[HTMLChars]{\author}}\end{author}\begin{editor},
  editor = {\format[HTMLChars]{\editor}}\end{editor}\begin{title},
  title = {\format[HTMLChars]{\title}}\end{title}\begin{booktitle},
  booktitle = {\format[HTMLChars]{\booktitle}}\end{booktitle}\begin{journal},
  journal = {\format[HTMLChars]{\journal}}\end{journal}\begin{publisher},
  publisher = {\format[HTMLChars]{\publisher}}\end{publisher}\begin{school},
  school = {\format[HTMLChars]{\school}}\end{school}\begin{year},
  year = {\format[HTMLChars]{\year}}\end{year}\begin{volume},
  volume = {\format[HTMLChars]{\volume}}\end{volume}\begin{number},
  number = {\format[HTMLChars]{\number}}\end{number}\begin{pages},
  pages = {\format[HTMLChars]{\pages}}\end{pages}\begin{edition},
  edition = {\format[HTMLChars]{\edition}}\end{edition}\begin{note},
  note = {\format[HTMLChars]{\note}}\end{note}\begin{url},
  url = {\format[HTMLChars]{\url}}\end{url}\begin{doi},
  doi = {\format[DOIStrip]{\doi}}\end{doi}
}
</pre></td>
</tr>

For export selection I get the wonderful output:

listref

Unfortunately any attempt (with the exact same selection) to add or change a field, in this case adding \begin{pmid} pmid: \format[HTMLChars]{\pmid}\end{pmid} after publisher (scroll to end):

<tr id="\format{\bibtexkey}" class="entry">
    <td>\begin{author}\format[Authors(LastFirst,NoPunc,InitialsNoSpace),HTMLChars]{\author}\end{author} (\year), <i>"\format[HTMLChars]{\title}"</i>\begin{journal}, \format[HTMLChars]{\journal}.\end{journal}\begin{booktitle}, In \format[HTMLChars]{\booktitle}.\end{booktitle}\begin{howpublished}, \howpublished.\end{howpublished}\begin{school}. Thesis at: \format[HTMLChars]{\school}.\end{school}\begin{address} \format[HTMLChars]{\address}\end{address}\begin{month}, \format[HTMLChars]{\month}, \year.\end{month} \begin{volume} Vol. \volume\end{volume}\begin{number}(\format[FormatPagesForHTML]{\number})\end{number}\begin{pages}, pp. \format[FormatPagesForHTML]{\pages}.\end{pages}\begin{publisher} \format[HTMLChars]{\publisher}.\end{publisher}\begin{pmid} pmid: \format[HTMLChars]{\pmid}\end{pmid}
    <p class="infolinks">\begin{abstract}[<a href="javascript:toggleInfo('\format{\bibtexkey}','abstract')">Abstract</a>]\end{abstract}\begin{review} [<a href="javascript:toggleInfo('\format{\bibtexkey}','review')">Review</a>] \end{review} [<a href="javascript:toggleInfo('\format{\bibtexkey}','bibtex')">BibTeX</a>]\begin{doi} [<a href="\format[DOICheck]{\doi}" target="_blank">DOI</a>]\end{doi}\begin{url} [<a href="\format{\url}" target="_blank">URL</a>]\end{url}\begin{file} [<a href="\format[WrapFileLinks(\r,,pdf)]{\file}" target="_blank">PDF</a>]\end{file}</p>
    </td>
</tr>\begin{abstract}
<tr id="abs_\format{\bibtexkey}" class="abstract noshow">
    <td><b>Abstract</b>: \format[HTMLChars]{\abstract}</td>
</tr>\end{abstract}\begin{review}
<tr id="rev_\format{\bibtexkey}" class="review noshow">
    <td><b>Review</b>: \format[HTMLChars]{\review}</td>
</tr>\end{review}
<tr id="bib_\format{\bibtexkey}" class="bibtex noshow">
<td><b>BibTeX</b>:
<pre>
@\format[ToLowerCase]{\bibtextype}{\bibtexkey,\begin{author}
  author = {\format[HTMLChars]{\author}}\end{author}\begin{editor},
  editor = {\format[HTMLChars]{\editor}}\end{editor}\begin{title},
  title = {\format[HTMLChars]{\title}}\end{title}\begin{booktitle},
  booktitle = {\format[HTMLChars]{\booktitle}}\end{booktitle}\begin{journal},
  journal = {\format[HTMLChars]{\journal}}\end{journal}\begin{publisher},
  publisher = {\format[HTMLChars]{\publisher}}\end{publisher}\begin{school},
  school = {\format[HTMLChars]{\school}}\end{school}\begin{year},
  year = {\format[HTMLChars]{\year}}\end{year}\begin{volume},
  volume = {\format[HTMLChars]{\volume}}\end{volume}\begin{number},
  number = {\format[HTMLChars]{\number}}\end{number}\begin{pages},
  pages = {\format[HTMLChars]{\pages}}\end{pages}\begin{edition},
  edition = {\format[HTMLChars]{\edition}}\end{edition}\begin{note},
  note = {\format[HTMLChars]{\note}}\end{note}\begin{url},
  url = {\format[HTMLChars]{\url}}\end{url}\begin{doi},
  doi = {\format[DOIStrip]{\doi}}\end{doi}
}
</pre></td>
</tr>

leads to:

listrefc

With the bibtex field always open, the ordering wrong, etc.

I've looked at listrefs.layout and listrefsc.layout with meld, checking for non-printing characters, removed existing fields in the section so that the line is not longer, shortened any filenames and removed non alpha characters, and restarted jabref, removed one or the other .layouts from Custom Export Formats configuration with no luck.

Any suggestions appreciated!

curtcorum commented 3 weeks ago

JabRef 5.15--2024-07-10--1eb3493 Linux 5.15.0-119-generic amd64 Java 21.0.2 JavaFX 22.0.1+7

curtcorum commented 3 weeks ago

Here are the files.

listrefs_files.zip

Siedlerchr commented 3 weeks ago

Hi, you are just missing the listrefs.begin.layout and listrefs.end.layout files in your folder: https://docs.jabref.org/collaborative-work/export/customexports#layout-files They have to be name the same as the main layout file just with begin and end accordingly. They contain the rest of the html stuff

curtcorum commented 3 weeks ago

Thanks! @Siedlerchr