LaTeXML icon indicating copy to clipboard operation
LaTeXML copied to clipboard

rudimentary biblatex support

Open kohlhase opened this issue 12 years ago • 13 comments

[Originally Ticket 1697]

It seems that more and more people are moving over to biblatex, so we should have some rudimentary support. I started with my private stub biblatex.sty.ltxml by copying from LaTeX.pool.ltxml and got stumped.

I think we should support at least the three main commands

  • \addbibresource which specifies a bibTeX (or other) database, the bibTeX case seems the most prevalent to support
  • \bibliography does the same, but allows multiple bibTeX files. Note that this is deprecated in favor of \addbibresource but is still commonly used.
  • \printbibliography which prints the bibliography So \bibliography/\addbibresource do the same as the old \bibliography from LaTeX, so I thought I would just copy and split the code; but this here does not quite work.
DefConstructor('\printbibliography []',
           "<ltx:bibliography files='local'>"# files='#1' xml:id='#id'>"
           . "<ltx:title>References</ltx:title>"# font='#titlefont' _force_font='1'>#title</ltx:title>"
           ."</ltx:bibliography>");
DefConstructor('\bibliography Semiverbatim','',
           afterDigest=>sub { $_[0]->begingroup; # wrapped so redefns don't take effect!
                  beginBibliography($_[1]); 
                  $_[0]->endgroup; });

DefConstructor('\addbibresource Semiverbatim','',
           afterDigest=>sub { $_[0]->begingroup; # wrapped so redefns don't take effect!
                  beginBibliography($_[1]); 
                  $_[0]->endgroup; });

I would be grateful, if I could get my hands on a functional replacement. All I really want is a functional

<bibliography files='foo bar'>
  <title>References</title>
</bibliography>

from

\addbibresource{foo}
\addbibresource{bar}
...
\printbibliography

More coverage of biblatex would be nice, but this would be sufficient for the majority (all of mine) cases.

kohlhase avatar Mar 26 '13 13:03 kohlhase

with #381 (bibliography support) maturing, it seems that for rudimentary biblatex support, we just have to get these three macros above supportd to go a whole long way. That should be quite simple to do.

kohlhase avatar Apr 07 '13 15:04 kohlhase

Of course, it would be good if we could also support the new biblatex entry types and fields. I made issue #398 for that, since it is a separate issue.

kohlhase avatar Apr 07 '13 15:04 kohlhase

Oh, and there is of course one thing that will also have to be supported as well: the package options of biblatex. There are many (and they are in key/value form, which I am not sure LaTeXML currently supports). The most important one (and I guess the only one we really need for rudimentary support) is the style option. Here is a typical invocation from my papers:

\usepackage[hyperref=auto,style=alphabetic,isbn=false,mincrossrefs=2]{biblatex}

I guess we need to just translate this into \bibliographystyle{alpha}.

kohlhase avatar Apr 07 '13 19:04 kohlhase

I think you're misunderstanding the structure of the bibliography stuff; or the constructors. I would assume that \bibliography and \addbibresource would need to accumulate the names of the databases in some variable; these would likely be DefPrimitive. And then \printbibliography would be a constructor that generates the ltx:bibliography, but it's the one that needs to run beginBibliography, in order to set up the bibliography element.

brucemiller avatar Sep 18 '13 11:09 brucemiller

Would you consider this a high priority item for the 0.8 milestone? We're high on items for that milestone as-is. Maybe we could push it back to 0.9?

dginev avatar Nov 13 '13 18:11 dginev

I would be happy to have it pushed to 0.9, it is more important to get 0.8 out of the door.

kohlhase avatar Nov 13 '13 19:11 kohlhase

Thanks, bumping the milestone.

dginev avatar Nov 14 '13 00:11 dginev

Giving this issue a :+1: for higher priority, now that I am looking at the latest arXiv rerun. biblatex is not too common (~0.02% ?), but it could potentially be easy to add rudimentary support as far as an arXiv document is concerned (as it uses .bbl directly).

As an example, one of our very own articles would be upgraded from error status to no_problem, with just the most basic of biblatex support:

https://corpora.mathweb.org/preview/arxmliv/tex_to_html/1404.6549

dginev avatar Aug 19 '18 05:08 dginev

I am very happy to hear that. Do you have numbers for biblatex usage?

kohlhase avatar Aug 19 '18 05:08 kohlhase

The full warning report for missing_file is here, including all warning messages from warning, error and fatal tasks: https://corpora.mathweb.org/corpus/arxmliv/tex_to_html/warning/missing_file?all=true

So far it looks like only 0.1-0.2% of arXiv documents will require biblatex support, so it's really not that frequent.

While we're at it, I should also throw in that so far (50% of run finished), we're looking at a long tail of ~13,300 .sty and .cls files reported for arXiv as not yet present in latexml, in the report I linked here

dginev avatar Aug 19 '18 05:08 dginev

Ah, interesting. But I think the more interesting question is what is the percentage in 2018. I would suspect for me personally, the percentage of biblatex usage in my papers is 25%, but in 2018 100%. The latter makes a better prediction over future usage.

kohlhase avatar Aug 19 '18 07:08 kohlhase

+1 count of usage in 2019 ;-) I also don't know if ArXiv stats are representative. Since my usual stack is XeLaTeX and recently also biblatex but ArXiv is not able to compile XeLaTeX documents, thus I have to upload PDFs and get an exception. I don't know if these cases are considered in the stats.

white-gecko avatar Jan 08 '19 16:01 white-gecko

I have started playing around with basic support for arXiv for biblatex, which tries to simply map back into the existing {thebibliography} support. A minimal pragmatic stopgap, that resonates with the word "rudimentary" in the issue title here.

I welcome some feedback from @brucemiller (email works too, just connecting the issue to keep track with the github side as well). Maybe it's something to keep developing in this vein, maybe not... I am working on it in the extended arxmliv bindings repository, specifically here.

dginev avatar Feb 09 '22 00:02 dginev