brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
961 stars 101 forks source link

[question] bibliography sometimes not processed? #2143

Closed nschloe closed 1 year ago

nschloe commented 1 year ago

Sometimes, I'm getting empty bibliographies with LaTeXML, and I'm not quite sure why that is.

MWE:

LaTeXML output:

  <para xml:id="p1">
    <p><cite class="ltx_citemacro_cite">[<bibref bibrefs="test01" separator="," yyseparator=","/>]</cite></p>
  </para>
  <bibliography bibstyle="alpha" citestyle="AY" files="g01" xml:id="bib">
    <title>References</title>
    <!-- Empty?? -->
  </bibliography>

latex output:

screenshot_2023-07-04-152322

dginev commented 1 year ago

This one I believe I can answer quickly. LaTeXML processes the bibliography in multiple stages, much like LaTeX would, but in our own paradigm of Core vs Post processing. Which allows to convert the document with a single call to latexmlc, or latexml+latexmlpost.

The important detail here is that the actual references section is filled in during post-processing. There is a combination of processors, importantly LaTeXML::Post::Scan, LaTeXML::Post::Crossref and LaTeXML::Post::MakeBibliography which can recognize the used citations, and then fill in the inline cites and the backmatter section.

So if you'd want to see a bibliography generated in LaTeXML's XML dialect, you could run post-processing with an XML target, as in:

latexmlc g01.tex  --post --format=xml

and for the usual HTML

latexmlc g01.tex --format=html
brucemiller commented 1 year ago

Yep, that's the problem: the bibliography is filled in by latexmlpost (or latexmlc). Thanks for the report, though.