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

inverted question or exclamation mark in pdf output after quote at the end of citation #5407

Closed
korakinos opened this issue Mar 29, 2019 · 3 comments

Comments

@korakinos
Copy link

korakinos commented Mar 29, 2019

$ pandoc --version
pandoc 2.7
Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.7.7

This is likely a variation of #1164, triggered in the special case of a citation. I haven't been able to find a way to work around it.

Observed behaviour: If the letter combinations ?", ?“, !" and !“ appear at the end of a citation, the question/exclamation mark is inverted and the quotation mark changed to a single in pdf output.

Steps to reproduce:

  1. Create the file temp.md, containing just the line:
    [@Lenz, "What is happening with the question mark end the closing quotation mark here?“]

  2. Create any bogus empty bibliography file in the same directory:
    $ touch bogus.bib

  3. Run pandoc:
    pandoc --output="temp.pdf" --bibliography="bogus.bib" "temp.md"

The resulting PDF shows the described behaviour:

temp.pdf

@jgm
Copy link
Owner

jgm commented Mar 29, 2019

Let's see:

% pandoc  --biblio biblio.bib -t latex
[@item1, "What is happening with the question mark end the closing quotation mark here?“]
^D
(Doe 2005, "What is happening with the question mark end the closing
quotation mark here?``)

Here the `` is pandoc's way of rendering a left double quote, since this is the normal latex ligature for that symbol. But it turns out that the sequence ?` is a LaTeX ligature for the Spanish inverted question mark, so in this context you get bad results!

For your purposes, one way around this is to insert a zero-width unicode space between the question mark and the ``. Another way around it is to disable the use of tex ligatures by specifying -t latex-smart. In this case you'd also want to use a curly quote for the opening quote, presumably, and you'd want to specify --pdf-engine=xelatex so that the unicode quotes will be processed properly.

@jgm
Copy link
Owner

jgm commented Mar 29, 2019

We can try to make pandoc's latex writer smarter, so that it doesn't inadvertently create the sequence ?`.

@jgm jgm added this to the 2.7.1.1 milestone Mar 29, 2019
@jgm jgm closed this as completed in 93ee73e Mar 29, 2019
@korakinos
Copy link
Author

korakinos commented Mar 29, 2019

Thanks a lot for both the zero-width whitespace quick fix and for the actual fix! This was fast!

(In case anybody else is in need of the quick fix before a new release of pandoc is made, the unicode code point for a zero-width space is U+200B. Edit: However, the zero-width space doesn't prevent line breaking. The "word joiner" character, code point U+2060, is thus more suitable.)

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

No branches or pull requests

2 participants