microtype icon indicating copy to clipboard operation
microtype copied to clipboard

Wishlist: disable and enable ligatures inside the document

Open AlMa1r opened this issue 1 year ago • 2 comments

Continuing http://tex.stackexchange.com/questions/652108, running pdflatex on

\documentclass{standalone}% v1.3b
\usepackage[T1]{fontenc}% v2.0v
\usepackage{babel}% v24.2
\usepackage{newtx}% v1.738
\begin{document}
bijection \foreignlanguage{dutch}{Dijkstra} \foreignlanguage{french}{Dijon}
\end{document}

in current TeX Live 2023 as of 2024-02-17 yields

bijection Dijkstra Dijon

Here, the ligature ij is employed in all three words (to test this, view the PDF output with the PDF viewer Evince, select ij, copy it, and paste it into a console or the window of an editor with a fixed-width font). Following https://tex.stackexchange.com/a/569293 and running pdflatex on

\documentclass{standalone}% v1.3b
\usepackage[T1]{fontenc}% v2.0v
\usepackage{babel}% v24.2
\usepackage{newtx}% v1.738
\usepackage{microtype}% v3.1a
\DisableLigatures[i]{encoding=T1}
\begin{document}
bijection \foreignlanguage{dutch}{Dijkstra} \foreignlanguage{french}{Dijon}
\end{document}

we obtain

bijection Dijkstra Dijon

with ij as two characters (to test this, view the PDF output with the PDF viewer Evince, select ij, copy it, and paste it into a console or the window of an editor with a fixed-width font). However, in certain Dutch words (Dijkstra, vrijgeven, …) some folks might prefer the digraph ij rather than the two characters ij, BUT there is no corresponding enabling command, such as \EnableLigatures[i]{encoding=T1}, and \DisableLigatures can be used only in the preamble per documentation of microtype v3.1a.

Therefore, we ask for a means to selectively enable and disable ligatures as we go. Future usage example: \addto\extrasdutch{\EnableLigature[ij]{encoding=T1}} and \addto\extrasngerman{\DisableLigature[ij]{encoding=T1}}. Perhaps, microtype with babel could do this even automatically without additional user commands.

AlMa1r avatar Feb 17 '24 13:02 AlMa1r