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

Selectively disable typographic ligatures in LuaLaTeX #6534

Closed
fkohrt opened this issue Jul 14, 2020 · 9 comments
Closed

Selectively disable typographic ligatures in LuaLaTeX #6534

fkohrt opened this issue Jul 14, 2020 · 9 comments

Comments

@fkohrt
Copy link
Contributor

fkohrt commented Jul 14, 2020

English and German introductions to typography mention that some words must not contain ligatures at certain points, such as

  • shelfful
  • Kaufleute

(illegal ligature in strong emphasis)

In LaTeX, one would either have to manually disable them with \kern0pt or \hspace{0pt}(such as shelf{\kern0pt}ful), or use microtype to disable them globally.

However, there's a LuaLaTeX package that does this automatically for an included selection of words: selnolig. According to selnolig's documentation, it has to be loaded after the babel package. Therefore, just using header-includes is not feasible, as that's located before.

Hence I suggest loading the selnolig package in case the LuaLaTeX engine is used, probably somewhere after line 341 of the LaTeX template:

--- pandoc-templates/default.latex	2020-07-15 00:28:58.124000000 +0200
+++ -	2020-07-15 00:31:00.189391730 +0200
@@ -339,6 +339,9 @@
 $endif$
 \fi
 $endif$
+\ifluatex
+  \usepackage{selnolig}
+\fi
 $if(dir)$
 \ifxetex
   % Load bidi as late as possible as it modifies e.g. graphicx
@mb21
Copy link
Collaborator

mb21 commented Jul 15, 2020

you can probably use a custom template?

@fkohrt
Copy link
Contributor Author

fkohrt commented Jul 15, 2020

Oh yeah, I'm doing that. But I thought this might improve the default template; in a similar way everybody could load microtype themself, but instead it's been added to the default template.

@jgm
Copy link
Owner

jgm commented Jul 15, 2020

My only worry here is about depending on packages that aren't widely available. We try to stick with the most common ones so the default template will work with a more minimal install.

@jgm
Copy link
Owner

jgm commented Jul 15, 2020

Still, I think this is probably a good idea.

@jgm
Copy link
Owner

jgm commented Jul 15, 2020

I tried this. Maybe I'm doing it wrong, but I can't see any difference in the output (e.g. for Auflage in German). I still see a ligature.

@fkohrt
Copy link
Contributor Author

fkohrt commented Jul 15, 2020

Maybe you haven't set the language?

Running pandoc --standalone --from=markdown --to=latex --pdf-engine=lualatex --output=with-selnolig.pdf --template=default.latex test.md on the patched default.latex and the following test.md works for me:

---
title: Test
lang: de
---

Auflage

Compare this with pandoc --standalone --from=markdown --to=latex --pdf-engine=lualatex --output=without-selnolig.pdf test.md

@jgm
Copy link
Owner

jgm commented Jul 15, 2020

I did set lang. But I forgot to specify lualatex!

@fkohrt
Copy link
Contributor Author

fkohrt commented Oct 8, 2020

Shouldn't the selnolig package be also mentioned in the MANUAL, now that it's used in the template?

@jgm
Copy link
Owner

jgm commented Oct 9, 2020

Good thought, I added something.

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

3 participants