Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curly quotes enclosing a lang-tagged span means otherlangs is not set properly #3770

Closed
bucklereed opened this issue Jun 27, 2017 · 3 comments

Comments

@bucklereed
Copy link
Contributor

$ echo -e '“[foo]{lang="nl"}”\n\n[bar]{lang="fr"}' | pandoc -o output.pdf
! Undefined control sequence.
l.69 ``\textdutch

pandoc: Error producing PDF

This also happens with HEAD.

Inspecting the standalone LaTeX, we see this:

\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[shorthands=off,french,main=english]{babel}
  \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
  \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
\else
  \usepackage{polyglossia}
  \setmainlanguage[]{english}
  \setotherlanguage[]{french}
\fi

So it's picking up the French fine, but missing the Dutch.

This doesn't happen if either the start or the end curly quote isn't included, so they're somehow critical.

It's not the Markdown reader specifically: the native output looks OK:

$ echo -e '“[foo]{lang="nl"}”\n\n[bar]{lang="fr"}' | pandoc -t native
[Para [Str "\8220",Span ("",[],[("lang","nl")]) [Str "foo"],Str "\8221"],Para [Span ("",[],[("lang","fr")]) [Str "bar"]]]
@bucklereed
Copy link
Contributor Author

$ echo -e '"[foo]{lang="nl"}"\n\n[bar]{lang="fr"}' | pandoc -o output.pdf
! Undefined control sequence.
l.69 ``\textdutch

pandoc: Error producing PDF

Straight quotes tickle it too. I probably should have thought of that before I submitted the bug, not after...

@jgm
Copy link
Owner

jgm commented Jun 28, 2017

Strange! When I put a traceShowId in the code to see how docLangs was being set, it worked fine (i.e., Dutch came through). When I took out the trace, it broke again. Could be a laziness related bug?

@jgm
Copy link
Owner

jgm commented Jun 28, 2017

Never mind: I left out the quotes when I did this test.
The quotes do matter.

@jgm jgm closed this as completed in cd690d0 Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants