jabref icon indicating copy to clipboard operation
jabref copied to clipboard

SCHOOL and INSTITUTION are defined as aliases even in BIBTEX mode

Open pedrogit opened this issue 3 years ago • 4 comments

JabRef version

3.8.2

Operating system

Windows

Details on version and operating system

No response

Checked with the latest development build

  • [X] I made a backup of my libraries before testing the latest development version.
  • [X] I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Define the “Entry preview” “Customized preview style” as

\bibtextype \begin{school}school=\school\end{school} \begin{institution}institution=\institution\end{institution}

  1. Create a TechReport with the INSTITUTION field filled and a MasterThesis entry with the SCHOOL field filed.

  2. Hit F9 to see them as preview. The SCHOOL field should not be visible in the TechReport preview and the INSTITUTION field should not be visible in the MasterThesis preview but they are.

Appendix

...

Log File
Paste an excerpt of your log file here

pedrogit avatar Sep 09 '22 13:09 pedrogit

Workaround is just using one of the two. It will be valid for both cases because the fields resolving works bidirectional.

We need to discuss this in more detail as this affects many other things and could break existing previews and layout and has other consequences because the method is also responsible for resolving CrossRef and other fields.

Here is the method called: https://github.com/JabRef/jabref/blob/bb011c9313367a28990ae213b3920fe6cd10d1dc/src/main/java/org/jabref/logic/layout/LayoutEntry.java#L192-L199

Siedlerchr avatar Sep 09 '22 14:09 Siedlerchr

I want to make a generic bibtex “Customized preview style” that clean bibtex entries copied from the web by 1) removing some unwanted fields and 2) format author names with first names initials. So I have to use both fields in the preview definition.

I stated by trying to use the "Cleanup entries" tool. It allows to clear unwanted field but it does not allow formating authors names with initials.

I then turned to the “Customized preview style”. It works fine except for TechReport, PhdThesis and MastersThesis where both INSTITUTION and SCHOOL are always defined.

I also created an export layout with three exceptions. It works fine but I don't want to have to export to a file for every single bibtex entry I copy from the web. I would want them clened in the preview.

pedrogit avatar Sep 09 '22 14:09 pedrogit

Definitions:

Bibtex (Tame the beast page 13-14)

  • institution: For a technical report, the name of the institution that published it.
  • school: For theses, the name of the school the thesis has been prepared in.

Biblatex (Biblatex documentation page 22 and 33):

  • institution list (literal): The name of a university or some other institution, depending on the entry type. Traditional BibTeX uses the field name school for theses, which is supported as an alias. See also §§ 2.2.5 and 2.3.4.

  • school list (literal) - A custom field An alias for institution, provided for BibTeX compatibility. The institution field is used by traditional BibTeX for technical reports whereas the school field holds the institution associated with theses. The biblatex package employs the generic field name institution in both cases. See §§ 2.2.2 and 2.3.4

ThiloteE avatar Sep 12 '22 18:09 ThiloteE

We tried to triangulate the deeper issue. It's because the conversion table automatically tries to convert bibtex fields to biblatex fields and to print it out. A workaround would be to determine the layout of the custom exporter to determine which bibtex database mode is used.

Deepdive:

  • https://github.com/JabRef/jabref/blob/9604f7d078cc5c77cdd2717cc896f506d57e713c/src/main/java/org/jabref/model/entry/BibEntry.java#L499-L526
  • https://github.com/JabRef/jabref/blob/bb011c9313367a28990ae213b3920fe6cd10d1dc/src/main/java/org/jabref/logic/layout/LayoutEntry.java#L192-L199

ThiloteE avatar Sep 12 '22 19:09 ThiloteE