Skip to content

Commit

Permalink
BibTeX 'Title' to MS Office 'Publicationtitle' field (#10864)
Browse files Browse the repository at this point in the history
* #10807 BibTeX 'Title' to MS Office 'Publicationtitle' field

* added_testfile_and_changelog_for_#10864

* modified_testfile_and_changelog_for_#10864
  • Loading branch information
dhrax21 authored Feb 9, 2024
1 parent 13870d8 commit e71ad29
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Changed

- We Added a test case MSBibExportFormatFilesTest to ensure proper functioning of the MSBib export format.[#10864] (`https://github.com/JabRef/jabref/pull/10864/commits`)
- The "Automatically open folders of attached files" preference default status has been changed to enabled on Windows. [koppor#56](https://github.com/koppor/jabref/issues/56)
- The Custom export format now uses the custom DOI base URI in the preferences for the `DOICheck`, if activated [forum#4084](https://discourse.jabref.org/t/export-html-disregards-custom-doi-base-uri/4084)
- The index directories for full text search have now more readable names to increase debugging possibilities using Apache Lucense's Lurk. [#10193](https://github.com/JabRef/jabref/issues/10193)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/msbib/MSBibConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static MSBibEntry convert(BibEntry entry) {
}

// TODO: currently only Misc can happen
if ("ElectronicSource".equals(msBibType) || "Art".equals(msBibType) || "Misc".equals(msBibType)) {
if ("Art".equals(msBibType) || "Misc".equals(msBibType)) {
result.publicationTitle = entry.getFieldLatexFree(StandardField.TITLE).orElse(null);
}

Expand Down
16 changes: 16 additions & 0 deletions src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
% Encoding: UTF-8
@article{example1,
title = {Sample Article Title},
author = {Steve, Smith},
journal = {Journal of Examples},
year = {2023},
msBibType = {Art}
}

@misc{example2,
title = {Miscellaneous Entry Title},
author = {Doe, Jane},
year = {2022},
msBibType = {Misc}
}
13 changes: 13 additions & 0 deletions src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xml>
<Publication>
<SourceType>Journal Article</SourceType>
<Title>Sample Article Title</Title>
<Year>2023</Year>
</Publication>
<Publication>
<SourceType>Miscellaneous</SourceType>
<Title>Miscellaneous Entry Title</Title>
<Year>2022</Year>
</Publication>
</xml>

0 comments on commit e71ad29

Please sign in to comment.