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

xelatex fails because straight quote marks transformed to angle quotes #3848

Closed
vlotorev opened this issue Jun 2, 2017 · 5 comments
Closed
Milestone

Comments

@vlotorev
Copy link

vlotorev commented Jun 2, 2017

Problem

My rst file contains quoted "text". After upgrading from 1.5.3 to 1.6.2 PDF builds started failing.
Why sphinx replaces rst text, if I'd like to use angle quotes, I'd use them right in rst.
(I can see discussion in PR#3527, but don't understand a word in that magic).

Clean project project with straight quotes is compiling ok.
My project uses custom preamble, so it might be a problem with it but I'm not a Tex expert.

Error logs / results

Compilation ends with errors like:

Package Fancyhdr Warning: \fancyfoot's `E' option without twoside option is use
less on input line 115.

[2]
Глава 2.
! Extra \endgroup.
\endgroup

Environment info

  • OS: CentOS 6.2,
  • Python version: 2.7
  • Sphinx version: 1.6.2
  • texlive/2015
@jfbu
Copy link
Contributor

jfbu commented Jun 2, 2017

The #3527 which you quote has been obsoleted by a merge of #3666 at Sphinx 1.6.1.

You can turn off "smart quotes" currently by adding a docutils.conf file at same level as conf.py and with contents

[parsers]
smart_quotes: no

I hope this helps you.

The Fancyhdr warning is something else, probably oneside option is used. This is known problem but innocuous warning.

For further help, minimal project would be helpful.

Trying with "спасибо", language = 'ru' and latex_engine = 'xelatex' and

latex_elements = {
     #
    'preamble': r'''
\setmainfont{FreeSerif}
\setsansfont{FreeSans}
\setmonofont{FreeMono}
''',
}

I got no issue. Perhaps you use some special xetex set-up.

@jfbu jfbu added this to the 1.6.3 milestone Jun 2, 2017
@vlotorev
Copy link
Author

vlotorev commented Jun 7, 2017 via email

@jfbu
Copy link
Contributor

jfbu commented Jun 10, 2017

You can add this to your extension:

from docutils.utils import smartquotes
import sphinx.util.smartypants
smartquotes.smartchars.quotes = {}

at least with Sphinx 1.6.2 and Docutils 0.13.1 this should have effect to disable smart quotes. You should do that conditionally on Sphinx version. Indeed in the future sphinx.util.smartypants will be removed as it is used only as a patch for Docutils < 0.14.

I tested it briefly but do not at all recommend (it affects html target too). it would be much more valuable to understand exactly what is your problem with xelatex and quotes. At the present time I do not know your problem.

With the above "спасибо" in reST file becomes "спасибо" in latex file, which is rendered by xelatex in PDF usually by curly quotes; at least this is how it looks in my testing with FreeSerif.

capture d ecran 2017-06-10 a 12 35 09

This is quite bad.

@jfbu jfbu modified the milestones: 1.7, 1.6.3 Jun 19, 2017
@tk0miya
Copy link
Member

tk0miya commented Jan 13, 2018

In 1.6.6, we introduce a new option smartquotes to disable the feature.
http://www.sphinx-doc.org/en/stable/config.html#confval-smartquotes

Thanks,

@tk0miya tk0miya closed this as completed Jan 13, 2018
@tk0miya tk0miya modified the milestones: 1.7, 1.6.6 Jan 13, 2018
@vlotorev
Copy link
Author

vlotorev commented Jan 13, 2018 via email

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants