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

Lualatex: escaping of > by \textgreater{} is not enough, >> applies ligature #5179

Closed
jfbu opened this issue Jul 15, 2018 · 3 comments · Fixed by #5790
Closed

Lualatex: escaping of > by \textgreater{} is not enough, >> applies ligature #5179

jfbu opened this issue Jul 15, 2018 · 3 comments · Fixed by #5790

Comments

@jfbu
Copy link
Contributor

jfbu commented Jul 15, 2018

Sphinx LaTeX escapes > in source to \textgreater{} in produced TeX file. Unfortunately with lualatex, \textgreater{}\textgreater{} becomes a ligature: ». This is not the case with xelatex or pdflatex.

This showed up as real-life problem when trying to build the PDFs of the CPython documentation using lualatex, as Python wants >>> indexed of course!

@tk0miya
Copy link
Member

tk0miya commented Jul 16, 2018

It seems >> (not \textgreater{} is also combined to ». It should be change behavior of ligature for LuaLaTeX.

\documentclass{report}

\begin{document}
Ligature test: >> and \textgreater{}\textgreater{}
\end{document}

@jfbu
Copy link
Contributor Author

jfbu commented Jul 16, 2018

@tk0miya To prevent ligature I was recommended upstream by David Carlisle to use either \textgreater\/ or \mbox{\textgreater}.

side-note: for literals and code-blocks, preventing >> TeX ligature is achieved via other means and needs no fix for lualatex

@jfbu
Copy link
Contributor Author

jfbu commented Dec 15, 2018

By the way also -{}- or -{-} mark-up with LuaLaTeX give via ligature a long dash rather than -- in PDF. One does not see it easily in Sphinx documents, as in this example from our own doc sphinx.tex:

\pysigline{\sphinxbfcode{\sphinxupquote{-q}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}quiet}}\sphinxcode{\sphinxupquote{}}}

because:

  1. fontspec does not apply Ligatures = TeX for mono font, which is triggered by \sphinxcode or \sphinxbfcode by default,

  2. additionally \sphinxupquote does extra things with - which also make ligature impossible.

But with LuaLaTeX and a non-monospace font, input such as -{}- or -{-} does create ligature. (contrarily to pdflatex/xelatex)

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

Successfully merging a pull request may close this issue.

2 participants