8000 Latex turnoff lualatex ligatures by jfbu · Pull Request #5790 · sphinx-doc/sphinx · GitHub
[go: up one dir, main page]

Skip to content

Latex turnoff lualatex ligatures #5790

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

Merged
merged 3 commits into from
Dec 16, 2018

Conversation

jfbu
Copy link
Contributor
@jfbu jfbu commented Dec 15, 2018

Closes: #5179. Notice that also -{}- mark-up (cf.

# used to separate -- in options
('', r'{}'),

where the invisible escaped character is a U+FEFF ZERO WIDTH NO-BREAK SPACE)
which prevents ligatures with pdflatex and xelatex does not prevent it with lualatex. This PR fixes that, too.

This is a bugfix but not applied to 1.8 branch because due to the fact LuaLaTeX is configured on 1.8 branch to not modify the default fonts (Latin Modern) chosen by fontspec, it would need different approach to turn off the automatic TeX ligatures, this PR works by disabling TeX ligatures for any font configured after loading of fontspec.

(besides the fontspec manual is obscure about exact syntax, it mentions ..Off or No.. variants which do not work at all, so it is quite a mess).

The method here is to not complicate our TeX escaping, keep it the same, but make sure fonts are loaded without the automatic Ligatures = TeX done by fontspec by default (LuaLaTeX contrarily to XeLaTeX applies ligature even if mark-up is like \textgreater{}\textgreater{} or -{}-).

But this requires 2.0, because workaround needs that \setmainfont, \setsansfont are explicitly used at least once after loading fontspec, thus either by user custom choice of fonts, or Sphinx default font choice as done in LUALATEX_DEFAULT_FONTPKG.

@jfbu jfbu added this to the 2.0.0 milestone Dec 15, 2018
@codecov
Copy link
codecov bot commented Dec 15, 2018

Codecov Report

Merging #5790 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5790   +/-   ##
=======================================
  Coverage   83.28%   83.28%           
=======================================
  Files         294      294           
  Lines       39532    39532           
  Branches     5866     5866           
=======================================
  Hits        32926    32926           
  Misses       5249     5249           
  Partials     1357     1357
Impacted Files Coverage Δ
sphinx/writers/latex.py 83.34% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0031c9b...eb36589. Read the comment docs.

Copy link
Member
@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jfbu
Copy link
Contributor Author
jfbu commented Dec 16, 2018

thanks @tk0miya for quick review!

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

Successfully merging this pull request may close these issues.

Lualatex: escaping of > by \textgreater{} is not enough, >> applies ligature
2 participants
0