LaTeX math in BibTeX quotes not working with pandoc

Background

I use pandoc to convert Markdown -> PDF with links included in the BibTeX quote database. In my bibliography, I would like to refer to typographical conventions in the original article, namely italics and indexes. The citation in the bibliography should look like this:

enter image description here

I have the following quote exported from Zotero as BibTeX.

@article{stanley_restrictions_1969, title = {Restrictions on the Possible Values of $r_{12}$, Given $r_{13}$ and $r_{23}$}, volume = {29}, issn = {0013-1644}, url = {http://dx.doi.org/10.1177/001316446902900304}, doi = {10.1177/001316446902900304}, number = {3}, urldate = {2013-01-04}, journal = {Educational and Psychological Measurement}, author = {Stanley, JC and Wang, MD}, month = oct, year = {1969}, pages = {579--581} } 

Zotero speeds up dollar signs, brackets, and underscores ( \$r\_\{12\}\$ ) when exporting to BibTeX format, but I just use sed to pull them out before calling pandoc. But then pandoc runs off again. If I convert from Markdown -> LaTeX, pandoc produces:

 Stanley, JC, \& Wang, MD (1969). Restrictions on the Possible Values of \$r\_12\$, Given \$r\_13\$ and \$r\_23\$. \emph{Educational and Psychological Measurement}, \emph{29}(3), 579--581. doi:10.1177/001316446902900304 

which means i get:

enter image description here

Question

How can I include LaTeX math in the BibTeX quotes used by pandoc when converting from Markdown -> PDF?

+4
source share
1 answer

Not supported. Here's the problem in the pandoc bug tracker . Pandoc uses bibutils to read bibtex databases, converting them to MODS XML, which is then read by citeproc-hs. Unfortunately, MODS has no way of representing mathematics. And bibutils does not recognize math in bibtex. So there is currently no clear solution β€” save writing a bibtex parser from scratch that uses pandoc to convert LaTeX to fields β€” maybe not a bad idea!

The upcoming version of pandoc 1.12 will allow you to include your citations database in the YAML form inside the document itself (or in a separate file). When links are included in this way, simple math will be supported, as well as some other kinds of markup. A tool will appear to convert the existing bibtex database into YAML form, although since a tool like pandoc uses bibutils, it will not convert the math, and you will have to modify it later.

+4
source

Source: https://habr.com/ru/post/1500913/


All Articles