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

Already on GitHub? Sign in to your account

Support LaTeX math in citations #866

Closed
jgm opened this Issue May 29, 2013 · 16 comments

Comments

Projects
None yet
4 participants
Owner

jgm commented May 29, 2013

Currently math in the title of a bibtex citation is not parsed as math -- it comes across in HTML, for example, with the literal $ characters.

Perhaps pandoc could make a pass through titles and just parse LaTeX math?

Contributor

nichtich commented Jun 13, 2013

The handling of bibliographic data should be consistent across output formats. I would expect pandoc to either escape `$' and similar characters in LaTeX output (as done by Zotero by the way) or convert it to Pandoc AST for math output also in HTML. By the way one could also argue to support other kind of markup in bibliographies, e.g. verbatim, italic, bold. The handling of markup should also be consistent for all bibliographic fields, not just the title.

Contributor

timtylin commented Aug 16, 2013

A large number of Bibtex entries left over from the pre-Extended Latin charset days also uses Latex markup to express diacritics in authors' names. For example, Lemarié would be written as Lemari\'{e} in the authors field.

Owner

jgm commented Aug 16, 2013

LaTeX diacritics in authors' names seem to be handled okay already by
bibutils (in my tests).

+++ Tim Lin [Aug 16 13 12:54 ]:

A large number of Bibtex entries left over from the pre-Extended Latin charset days also uses Latex markup to express diacritics in authors' names. For example, Lemarié would be written as Lemari\'{o} in the authors field.


Reply to this email directly or view it on GitHub:
#866 (comment)

Contributor

timtylin commented Aug 16, 2013

In that case, I'm all for parsing LaTeX math in the title. That would save me the trouble of going through our old Bibtex libraries and sanitizing all the math notation.

Owner

jgm commented Dec 7, 2013

This is fixed by the latest pandoc-citeproc.

@jgm jgm closed this Dec 7, 2013

mdekauwe commented Nov 1, 2016 edited

Whilst this works when converting markdown to PDF, it doesn't for me when converting markdown to docx. For example if I had: "CO$_2$" then I get CO2 in my PDF but I get a weird square character between the O and the 2 in the docx file.

Owner

jgm commented Nov 1, 2016

What version of pandoc? Some issues with subscripts in docx
were fixed fairly recently. I'd suggest using the latest
version if you aren't.

+++ Martin De Kauwe [Oct 31 16 20:42 ]:

Whilst this works when converting markdown to PDF, it doesn't for me
when converting markdown to docx. For example if I had: "CO$_2$" then I
get CO2 in my PDF but I get a weird square character between the O
and the 2 in the docx file.


You are receiving this because you modified the open/close state.
Reply to this email directly, [1]view it on GitHub, or [2]mute the
thread.

References

  1. #866 (comment)
  2. https://github.com/notifications/unsubscribe-auth/AAAL5KMbmy4KtNad3OWyQZhUj8X9U4kfks5q5rUugaJpZM4AsTo0

mdekauwe commented Nov 1, 2016

It is the latest version I think:

$ pandoc --version
pandoc 1.18

The latex generated PDF file is fine when the bibtex entry has {C}O$_2$ in the title, but not the docx.

Owner

jgm commented Nov 1, 2016

--version should also say what version of texmath it was
compiled against, and this would be helpful to know

+++ Martin De Kauwe [Nov 01 16 02:28 ]:

It is the latest version I think:

$ pandoc --version
pandoc 1.18

The latex generated PDF file is fine when the bibtex entry has {C}O$_2$
in the title, but not the docx.


You are receiving this because you modified the open/close state.
Reply to this email directly, [1]view it on GitHub, or [2]mute the
thread.

References

  1. #866 (comment)
  2. https://github.com/notifications/unsubscribe-auth/AAAL5CUP7LQkIxvC8S-qr4Wv5UUvr-qKks5q5wZYgaJpZM4AsTo0

mdekauwe commented Nov 1, 2016

pandoc 1.18
Compiled with pandoc-types 1.17.0.4, texmath 0.8.6.6, highlighting-kate 0.6.3

Here is a screen print example:

screen shot 2016-11-01 at 8 53 09 pm

Owner

jgm commented Nov 1, 2016

Owner

jgm commented Nov 1, 2016

Ah, I also wonder about the pandoc-citeproc version, and how
you compiled/obtained it? Finally, what are you using to
look at the Word document?

+++ Martin De Kauwe [Nov 01 16 02:54 ]:

pandoc 1.18
Compiled with pandoc-types 1.17.0.4, texmath 0.8.6.6, highlighting-kate
0.6.3

Here is a screen print example:

[1]screen shot 2016-11-01 at 8 53 09 pm


You are receiving this because you modified the open/close state.
Reply to this email directly, [2]view it on GitHub, or [3]mute the
thread.

References

  1. https://cloud.githubusercontent.com/assets/278045/19885917/55950170-a075-11e6-8397-2adb75893f5c.png
  2. #866 (comment)
  3. https://github.com/notifications/unsubscribe-auth/AAAL5DggqMBA57tZ1KDV7cFOK3EiXLtFks5q5wxQgaJpZM4AsTo0

mdekauwe commented Nov 1, 2016

I made a simple example that replicates it but it won't let me paste it here. I could email it?

I was looking at the document in MS Word.

$ pandoc-citeproc --version
pandoc-citeproc 0.10.2.1

Owner

jgm commented Nov 1, 2016

If you just produce a docx using pandoc from the source

$CO_2$

do you see the square? My current speculation is that you may be using a version of pandoc-citeproc that was compiled against an earlier version of texmath, and this would be confirmed if you saw the square only with tex math in citations.

Owner

jgm commented Nov 1, 2016

+++ Martin De Kauwe [Nov 01 16 04:17 ]:

I made a simple example that replicates it but it won't let me paste it
here. I could email it?

Sure, you can email me at jgm at berkeley dot edu.

I was looking at the document in MS Word.

$ pandoc-citeproc --version
pandoc-citeproc 0.10.2.1

IS this the version from the pandoc binary we provide, or
did you install it in some other way?

mdekauwe commented Nov 1, 2016

I re-installed via the cabal example, e.g.

cabal update
cabal install pandoc-citeproc
(which installed pandoc again)

I made sure I linked to this new version, but the issue hasn't gone away for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment