JabRef version
5.12 (latest release)
Operating system
Windows
Details on version and operating system
Windows 11 (current)
Checked with the latest development build (copy version output from About dialog)
Steps to reproduce the behaviour
One-sentence summary of the issue:
JabRef Export to MS Office 2007 (*.xml) of BibTeX records of type @Electronic and @Online mistakenly duplicates the content of the Title field to the MS Office Publicationtitle field in the exported XML file: it should not do that (this issue does not exist for other types, e.g., @Book)
Steps to reproduce the behavior:
- In JabRef, allocate a new library and copy-paste this minimal BibTeX record:
@Electronic{Author,
author = {Some Author},
title = {The Title},
url = {https://somewhere.net/example/address},
urldate = {2024-01-19},
}
-
File -> Export this record as type MS Office 2007 (*.xml) into a file test.xml
-
The exported file "test.xml" mistakenly contains both, a "Title" and a "Publicationtitle" field (highlighted in bolditalic in the following file dump):
<b:Sources xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" SelectedStyle="">
<b:Source>
<b:BIBTEX_Entry>electronic</b:BIBTEX_Entry>
<b:SourceType>ElectronicSource</b:SourceType>
<b:Title>The Title</b:Title>
<b:Tag>Author</b:Tag>
<b:URL>https://somewhere.net/example/address</b:URL>
<b:YearAccessed>2024</b:YearAccessed>
<b:MonthAccessed>January</b:MonthAccessed>
<b:DayAccessed>19</b:DayAccessed>
<b:Author>
<b:Author>
<b:NameList>
<b:Person>
<b:Last>Author</b:Last>
<b:First>Some</b:First>
</b:Person>
</b:NameList>
</b:Author>
</b:Author>
<b:PublicationTitle>The Title</b:PublicationTitle>
</b:Source>
</b:Sources>
To illustrate the follow-up consequences of the bug in MS Word:
-
Open a blank MS Word document
-
Load the file "test.xml" via:
-
References -> Manage Sources -> Browse… and then - select and
Copy -> the loaded record from the Sources available in test pane into the Current List pane and Close the "Source Manager" dialog window
(the duplicate title is already displayed in the Preview pane of the dialog window)
-
Insert a bibliography into the empty document, via:
References -> Bibliography- Select the first style,
Bibliography, offered in the pop-up menu
-
The inserted bibliography consists of the following record:
Author, S. (n.d.). The Title. The Title. Retrieved January 19, 2024, from https://somewhere.net/example/address
Note the duplicate title.
As mentioned at the beginning, the same issue exists for records of type @Online, but not for e.g., type @Book.
Appendix
Related Source Code:
File src/main/java/org/jabref/logic/msbib/MSBibConverter.java:
108 // TODO: currently only Misc can happen
109 if ("ElectronicSource".equals(msBibType) || "Art".equals(msBibType) || "Misc".equals(msBibType)) {
110 result.publicationTitle = entry.getFieldLatexFree(StandardField.TITLE).orElse(null);
111 }
(addendum 2024-01-20):
In the meantime I verified that removing the first clause "ElectronicSource".equals(msBibType) indeed suffices to correct the behavior (kudos to the maintainers of https://devdocs.jabref.org/ ).
I have not investigated the mapping of BibTeX @misc to MS Office Misc mentioned in https://docs.jabref.org/advanced/knowledge/msofficebibfieldmapping (visited 2024-01-20)).
So, the patched lines just read
(File src/main/java/org/jabref/logic/msbib/MSBibConverter.java, lines 108ff.):
// TODO: currently only Misc can happen
// 2024-01-20 balanco@github: removed condition/case "ElectronicSource".equals(msBibType)
// that generated MS Office bibliographic records with
// _duplicate_ "Title" and "Publicationtitle" fields.
if ("Art".equals(msBibType) || "Misc".equals(msBibType)) {
result.publicationTitle = entry.getFieldLatexFree(StandardField.TITLE).orElse(null);
}
<EOT>
JabRef version
5.12 (latest release)
Operating system
Windows
Details on version and operating system
Windows 11 (current)
Checked with the latest development build (copy version output from About dialog)
Steps to reproduce the behaviour
One-sentence summary of the issue:
JabRef
ExporttoMS Office 2007 (*.xml)of BibTeX records of type@Electronicand@Onlinemistakenly duplicates the content of theTitlefield to the MS OfficePublicationtitlefield in the exported XML file: it should not do that (this issue does not exist for other types, e.g.,@Book)Steps to reproduce the behavior:
File->Exportthis record as typeMS Office 2007 (*.xml)into a filetest.xmlThe exported file "test.xml" mistakenly contains both, a "Title" and a "Publicationtitle" field (highlighted in bolditalic in the following file dump):
To illustrate the follow-up consequences of the bug in MS Word:
Open a blank MS Word document
Load the file "test.xml" via:
-
- select and
(the duplicate title is already displayed in theReferences->Manage Sources->Browse…and thenCopy ->the loaded record from theSources available in testpane into theCurrent Listpane andClosethe "Source Manager" dialog windowPreviewpane of the dialog window)Insert a bibliography into the empty document, via:
References->BibliographyBibliography, offered in the pop-up menuThe inserted bibliography consists of the following record:
Author, S. (n.d.). The Title. The Title. Retrieved January 19, 2024, from https://somewhere.net/example/address
Note the duplicate title.
As mentioned at the beginning, the same issue exists for records of type
@Online, but not for e.g., type@Book.Appendix
Related Source Code:
File
src/main/java/org/jabref/logic/msbib/MSBibConverter.java:108 // TODO: currently only Misc can happen 109 if ("ElectronicSource".equals(msBibType) || "Art".equals(msBibType) || "Misc".equals(msBibType)) { 110 result.publicationTitle = entry.getFieldLatexFree(StandardField.TITLE).orElse(null); 111 }(addendum 2024-01-20):
In the meantime I verified that removing the first clause
"ElectronicSource".equals(msBibType)indeed suffices to correct the behavior (kudos to the maintainers of https://devdocs.jabref.org/ ).I have not investigated the mapping of BibTeX
@miscto MS OfficeMiscmentioned in https://docs.jabref.org/advanced/knowledge/msofficebibfieldmapping (visited 2024-01-20)).So, the patched lines just read
(File
src/main/java/org/jabref/logic/msbib/MSBibConverter.java, lines 108ff.):// TODO: currently only Misc can happen // 2024-01-20 balanco@github: removed condition/case "ElectronicSource".equals(msBibType) // that generated MS Office bibliographic records with // _duplicate_ "Title" and "Publicationtitle" fields. if ("Art".equals(msBibType) || "Misc".equals(msBibType)) { result.publicationTitle = entry.getFieldLatexFree(StandardField.TITLE).orElse(null); }<EOT>