Closed asmaier closed 6 years ago
Yeah, this is tricky. Firstly, bibtex is indeed forgiving in its design: it never actually processes any TeX/LaTeX. It only rearranges it, according to a bibliography style file (bst), in most cases dropping the data it's not interested in. LaTeXML attempts to process, convert and preserve all the data with the goal of producing an xml representation of the data which can (hopefully) be useful on its own.
Of course, this gets screwed up by not knowing enough about the type of data in each field: such as your adsurl being a form of url; and slaccitation being who-knows-what. LaTeXML's bibtex engine knows the types of the standard fields; perhaps it should process unknown ones as if they were verbatim? But that might be unexpected to some. We've done experiments reading the *.bst files, be even then the types are at best impliicit in the style file. Hmm...
And of course, this is all made worse by the fact that LaTeXML rewrites the bib into a more TeX-like form before processing, and looses track of where the original source was, so the error messages become even more incomprehensible.
Undoubtedly this can all be improved, but needs some thought... and maybe some 'votes'...
To solve the 1st item, LaTeXML should probably treat any unknown fields as completely verbatim; I've made that patch. That avoids errors in this more common scenario, but will lead to less-than-optimal output if the user expected the field to be processed as markup. In the latter case, they can still declare the fields to fix it up.
I'm not sure what your point in items 2,3,4 is; LaTeXML does give errors for these cases, as latex would (after bibtex processing). I think this is just a dup of #916, that those errors are hidden if the bibliography is processed during postprocessing.
I encountered the following errors when running
latexmlpost
on a*.bib
-file of mine. With the originalbibtex
none of these issues caused problems, so I cannot say, if these errors come frombibtex
being too sloppy orlatexmlpost
being too strict. However because they can cause followup errors in the parsing andlatexmlpost
seems to have a hardcoded limit of 100 errors above which it stops processing the bibliography, they can prevent one from successfully converting a*.bib
-file. So I document them here:%-sign outsides the field
url
cause problems. E.g.Removing the field
slaccitation
and renaming the fieldadsurl
tourl
fixed the errors.Be careful with the field
month
:You must either use the correct macro for the month field, e.g.
month = jul
(and notjuly
), or you must use curly bracketsmonth = {March}
(and notmonth = March
) (see also https://tex.stackexchange.com/questions/70455/bibtex-month-format) .Math symbols and operators must be put between
$..$
, e.g. the following will cause problems withlatexmlpost
:To fix this write
Refinement$^{CD}$
in the title field.The ambersand symbol
&
can cause parsing errors