Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biblatex Export to Word 2007 xml: date field is not exported #1750

Closed
sa3016 opened this issue Aug 16, 2016 · 27 comments
Closed

Biblatex Export to Word 2007 xml: date field is not exported #1750

sa3016 opened this issue Aug 16, 2016 · 27 comments
Assignees
Labels
bib(la)tex bug Confirmed bugs or reports that are very likely to be bugs
Milestone

Comments

@sa3016
Copy link

sa3016 commented Aug 16, 2016

JabRef 3.5 windows 10 10.0 amd64 Java 1.8.0_92

Jabref can import and recognize year of biblatex file, but cannot export xml 07 word format with year.

Steps to reproduce:

  1. prepare a biblatex file
  2. import it into Jabref
  3. export it as 07 word xml

I am asked to create an issue here. (http://discourse.jabref.org/t/export-bib-to-2007-office-xml/142)

@Siedlerchr Siedlerchr changed the title year is not exported Biblatex Export to Word 2007 xml year is not exported Aug 16, 2016
@Siedlerchr Siedlerchr changed the title Biblatex Export to Word 2007 xml year is not exported Biblatex Export to Word 2007 xml: year is not exported Aug 16, 2016
@Siedlerchr
Copy link
Member

Thanks for your report! I tried with a recent 3.6 dev version and could not reproduce the behavior.
So i suggest, you should try again with the latest dev version from http://builds.jabref.org/master/

@Siedlerchr Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Aug 16, 2016
@mlep
Copy link
Contributor

mlep commented Aug 16, 2016

I could reproduce this issue with the master build using the test BibLaTeX file http://mirrors.ctan.org/macros/latex/contrib/biblatex/bibtex/bib/biblatex/biblatex-examples.bib (file suggested in https://github.com/JabRef/jabref/wiki/BibTeX ).
In the xml file, most of entries do not have a year.

@Siedlerchr
Copy link
Member

@mlep Then I maybe misunderstood sth:
If a year is set in the yearfield , then it is in the xml file. If it has a only a date field set, the date is not exported. If it has both fields set, then the year is exported correctly.

Check the example "he Importance of Being Earnest: A Trivial Comedy for Serious People
A possible workaround is to have both fields set.

@mlep
Copy link
Contributor

mlep commented Aug 16, 2016

My guess was: if there is information about the year in the BibLaTeX entry (in the field year or in the field date), this information should be found in the xml file.

Currently, because this filter exports the entries without this information, the xml file maybe, in practice, of limited use.

@Siedlerchr
Copy link
Member

Okay, so I file this as a bug. Because in biblatex we have either date or year field as required. And when only date field is there, then the export does not export any year/date things

@Siedlerchr Siedlerchr changed the title Biblatex Export to Word 2007 xml: year is not exported Biblatex Export to Word 2007 xml: date field is not exported Aug 16, 2016
@Siedlerchr Siedlerchr added bug Confirmed bugs or reports that are very likely to be bugs and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Aug 16, 2016
@oscargus
Copy link
Contributor

Yes, we should add a mapping from date to year if there is no year field available.

@Siedlerchr Siedlerchr self-assigned this Aug 16, 2016
@Siedlerchr
Copy link
Member

Siedlerchr commented Aug 16, 2016

I will fix that

@Siedlerchr
Copy link
Member

As part of the reworking in #1765 , I already fixed the exportation of the year.
@sa3016 @mlep Please try again with the newest version from here:
http://builds.jabref.org/office07/

If you notice any other things which look odd regarding the export, please report.

@mlep
Copy link
Contributor

mlep commented Aug 17, 2016

Thanks for fixing the year. It works very well!

Other odd things (since you asked...):

  • fields journaltitle (should be treated the same as journal), volume and number are not exported.
  • LaTeX encoding (like {'e}) is exported as is.

@Siedlerchr
Copy link
Member

Siedlerchr commented Aug 17, 2016

Thanks for the test. I will look into that the next days. I already noted that not all fields are exported correctly.
Things I am aware of:

@oscargus
Copy link
Contributor

oscargus commented Aug 17, 2016 via email

@Siedlerchr
Copy link
Member

@oscargus I already used it for the year.

@Mattri
Copy link

Mattri commented Aug 18, 2016

Another issue concerning MS Word 2007 XML-Export:

If you have a list of authors in BibTeX separated with lowercase "and", everything works well during export, i.e. first, middle and last names of authors are converted correctly. Yet, if "AND" in capital letters is applied as separation, the parsing does not work.

@Mattri
Copy link

Mattri commented Aug 18, 2016

Is this a missing feature or bug in MS Word 2007 XML-Export?

In BibTeX there is the field "Language". In MS-Bib there is the tag <b:LCID>. From my point of view, the BibTeX-field is not yet considered in order to determine the correct language code in MS-Bib.

@Siedlerchr
Copy link
Member

@Mattri Thanks for your report. Regarding the language field, there is already code for translating the lang field to LCID, but it may be not functioning correctly.

@Siedlerchr
Copy link
Member

@Mattri Regarding the language mapping, I looked a bit deeper and think that we can not provide a complete mapping for all kind of languages, because the LCID Language codes are not easy translatable into the internally java used. Currently we only support English.

@mlep
I just fixed some more issues and field mappings. Not only for export, but for import, too.
Patent in MS Bib is imported as patent biblatex entry and the number field is put in the patent number.
Online gets exported as InternetSite and Electronic as electronic.
See #1765 for details. And when the tests after a commit are green, you can find a new version always here:
http://builds.jabref.org/office07/

@Siedlerchr
Copy link
Member

Siedlerchr commented Aug 20, 2016

Current status:

  • Author exporting as Corporate (there is an issue already for that)
    • Day/Month not exported Only Year and Month can be exported (or are extracted from the date field)
    • PatentNumber gets exported as issue: (http://discourse.jabref.org/t/customize-word-2007-xml-export-filter/149)
    • LaTeX encoding (like {'e}) is exported as is. Authors are now converted as unicode, too.
    • fields journaltitle (should be treated the same as journal), volume and number are not exported. - Issue, Volume, Number etc now work correctly. ~~
    • fRegarding number, I am not just sure to what I should map the number, and if I understand the BibLaTex-Manual correct:
    • And/and and author separator is case insensitive The and is now checked case insensitive.

The number of a journal or the volume/number of a book in a
series. See also issue as well as §§ 2.3.7 and 2.3.9

The field "Standardnumber" in Word is used for ISBN or MRN things.
It would be nice if someone of you could provide a sample @mlep @Mattri

@oscargus
Copy link
Contributor

You may try BibUtils https://sourceforge.net/p/bibutils/home/Bibutils/ and see how/if it is mapped. (Unfortunately, the source seems hard to find...)

@mlep
Copy link
Contributor

mlep commented Aug 22, 2016

The mapping for number seems to be Issue. See:

The official method to find the mapping seems to be use Microsoft Word and look at the output...
( https://msdn.microsoft.com/en-us/library/bb258052(v=office.12).aspx )

@Siedlerchr
Copy link
Member

Ah yes, I see that this is a BibTeX only thing http://www.cs.arizona.edu/~collberg/Teaching/07.231/BibTeX/bibtex.html , because both BibLaTeX and Word have an Issue, Volume and Edition field, DOI is an extra field, too.
I think, will check if the issue field is set and then otherwise use the value of number.

This is a sample I created in Word 2013:

 <b:Source>
      <b:Tag>TEs16</b:Tag>
      <b:SourceType>ArticleInAPeriodical</b:SourceType>
      <b:Guid>{F6051BB5-C1B9-4BD1-AF8A-0DD644853745}</b:Guid>
      <b:Title>Test Title</b:Title>
      <b:Year>2016</b:Year>
      <b:Publisher>Mein Verleger</b:Publisher>
      <b:JournalName>TEst Journal</b:JournalName>
      <b:Pages>27-38</b:Pages>
      <b:Author>
         <b:Author>
            <b:NameList>
               <b:Person>
                  <b:Last>TEst</b:Last>
                  <b:First>Test</b:First>
               </b:Person>
            </b:NameList>
         </b:Author>
         <b:Editor>
            <b:NameList>
               <b:Person>
                  <b:Last>Herausgeber</b:Last>
                  <b:First>Mein</b:First>
               </b:Person>
            </b:NameList>
         </b:Editor>
      </b:Author>
      <b:PeriodicalTitle>Test Journal</b:PeriodicalTitle>
      <b:Month>07</b:Month>
      <b:Day>03</b:Day>
      <b:Edition>Wochenende</b:Edition>
      <b:Volume>III</b:Volume>
      <b:Issue>12</b:Issue>
      <b:ShortTitle>Mein kurzer Titel</b:ShortTitle>
      <b:StandardNumber>12345567-13</b:StandardNumber>
      <b:Medium>Elektronisch</b:Medium>
   </b:Source>

@stefan-kolb stefan-kolb added this to the v3.7 milestone Aug 23, 2016
@Siedlerchr
Copy link
Member

Most fixes/features done in #1765. For the rest I will create a follow up issue.

@spalc
Copy link

spalc commented Jan 12, 2018

Hello,
Is there still work being done on MS Office 2007 xml import/export?
I note that the TRANSLATOR field is not included in the exported xml file. Would this be added?

Also I read about the possibility of export filters, however I have not been able to locate a set of .layout files for MS Office WORD. Could they be made available?

Thanks,
Stephen.

@Siedlerchr
Copy link
Member

Siedlerchr commented Jan 12, 2018

@spalc Hi, I just created a fix which adds the field for export and import.
You can test this one here, or wait until #1851 is merged into the master and then use the latest snapshot
https://builds.jabref.org/office007translator/

Is there still work being done on MS Office 2007 xml import/export
Like any other feature: If you encounter a problem, bug or have an enhancement, just open an issue.
In this case, adding the field was one simple line of code.
Unfortunately, the MS Office Exporter and Importer is a bit more complicated, therefore there is not a way to use the layout files for this, especially the conversion of authors and dates into their corresponding fields it not trivial.

For your reference, you can find a complete overview of the field mapping between biblatex and msoffice xml here in the help:
https://help.jabref.org/en/MsOfficeBibFieldMapping

@spalc
Copy link

spalc commented Jan 14, 2018

Hi Christoph,
Many thanks for your action and reply. I will test the fix for TRANSLATOR.
I have just started to try out Jabref and I like the interface.

I took a look at the field mapping between biblatex and ms office xml and ran a few tests.
Regarding the treatment of the Jabref address field, I note that when an address like "New York" is used on its own as city the xml export module treats "New" as city and "York" as StateProvince. If there is no comma separating the elements of the address field it would be better if the address field, even if it contains several words, is treated as "only city". If the contents are separated by commas then the address field should be broken down into distinct xml Word fields (City, StateProvince, CountryRegion).

I will continue to explore the tool and let you know if I have other suggestions.
Stephen.

@Siedlerchr
Copy link
Member

Hi,
thanks for the feedback!
Regarding the address field and other potential improvements, it would ne nice if you could just open new specific issue to make it easier to track the features/bugs and the code fixes

@Siedlerchr
Copy link
Member

I just accidentally pushed directly to the master 🤦‍♂️. so the address fix and the translator fix are now both in the latest master. https://builds.jabref.org/master/

@spalc
Copy link

spalc commented Jan 17, 2018

Thanks Christoph.
I installed 4.2 and tested translator and address. Both work fine. Great work.
Will open a new specific issue for other fixes&features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bib(la)tex bug Confirmed bugs or reports that are very likely to be bugs
Projects
None yet
Development

No branches or pull requests

9 participants