8

Feeding

\documentclass{standalone}
\usepackage{newtxtext}%%% 2020/07/22 v1.628
\begin{document}
bijection
\end{document}

to pdflatex leads to a PDF document (here is the image of it,

expected bijection

) in which you cannot copy bi or jection separately with the PDF readers Evince or Okular. If you don't use NewTX, you can select and copy bi or jection separately as expected. It seems to me that the glyph ij is graphically used (though copying the whole word from the text layer using the two PDF viewers correctly yields two separate letters ij inside the word). If this glyph is really used here, then it incorrectly spans the linguistical morpheme boundary; in any case you should be able to select and copy the “bi” part separately. How to avoid this weird behavior?

More information: https://graphicdesign.stackexchange.com/questions/142681

The NewTX maintainer has been informed.

8
  • @campa evince, okular
    – user224332
    Nov 2, 2020 at 10:20
  • 1
    I can't reproduce the behavior, both with Evince and Okular I can select i and j separately. I do have a slightly older version of newtxtext though (v1.531, 2018/03/27) so maybe it is different in the most recent version.
    – Marijn
    Nov 2, 2020 at 10:23
  • 3
    it is not a bug, it is a ligature ;-). You can input bi\/jection to split it. Nov 2, 2020 at 10:27
  • 3
    ask the maintainer. Imho it is an rather odd choice to make this a ligature by default. Nov 2, 2020 at 10:36
  • 4
    The T1 encoding has the glyphs “IJ” and “ij” but these should not be used for ligatures, because they're specific for Dutch. The font should instead define a kerning for the combination i+j. If I force OT1 encoding, the glyphs are indeed separate, but newtxtext uses T1 by default.
    – egreg
    Nov 2, 2020 at 11:15

2 Answers 2

9

UPDATE

In version 1.631 (and some later versions, not including v1.71) of the NewTX fonts the issue is fixed.

Original answer

The current version of the text font ntx-Regular-tlf-t1 has

   (LABEL C I)
   (LIG C J O 234)
   (STOP)
[...]
   (LABEL C i)
   (LIG C j O 274)
   (KRN O 224 R -0.03)
   (KRN C j R -0.035)
   (KRN C T R -0.03)
   (STOP)

Maybe the code above is cryptic, but it's what I get from tftopl that shows tfm files in (nearly) human readable form. The LABEL C i instruction introduces ligatures and kerning for the character at ASCII position for i as the first element.

Here LIG C j O 274 tells TeX that i followed by j should be replaced with the glyph sitting at slot octal 274 (in T1 encoding it's indeed the composite “ij” for Dutch). Instead KRN C T R -0.03 tells TeX that between i and T there should be a negative kern amounting to 3/100 of the design size (but this will be scaled by the magnification factor the font is loaded at). There is a KRN C j R -0.035 instruction, but since LIG C j comes first, the latter is discarded.

In previous versions of newtxtext fonts there is no ligature map for I and for i we read

   (LABEL C i)
   (KRN C j R -0.035)
   (KRN O 224 R -0.03)
   (KRN C T R -0.03)
   (STOP)

Adding the ligatures I+J mapping to the character at octal 234 and i+j mapping to octal 274 is wrong.

The T1 encoding has indeed glyphs “IJ” and “ij” at those positions, but they're specific for the Dutch language and its capitalization rules. They should not be used as general ligatures. This oversight has to be fixed by the maintainer.

In the meantime, you can use microtype to disable the wrong ligatures.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}%%% 2020/07/22 v1.628
\usepackage{microtype}

\DisableLigatures[I,i]{encoding=T1}

\begin{document}

bijection

\end{document}

enter image description here

Note that the kern is still applied. Disabling the ligature resurrects the kern mentioned above.

3
  • 1
    Thx! (1) Are there any other ligatures besides ij that \DisableLigatures[I,i]{encoding=T1} would disable? (2) Is it possible to restrict \DisableLigatures[I,i]{encoding=T1} to all languages except Dutch (e.g., when you use \usepackage[USenglish,british,dutch,latin,german,ngerman]{babel})?
    – user224332
    Nov 2, 2020 at 11:37
  • 3
    @GeekestGeek No, there is no provision for enabling ligatures only for a particular language. This might be possible with OpenType fonts. From the ligature tables I showed, there is no other ligature involving i as the first element.
    – egreg
    Nov 2, 2020 at 11:39
  • It would be nice to have such a provision, which would allow us to quote a paper of Dijkstra in Dutch and to talk about bijections in English :-). As for now, the most reasonable way seems to forbid such a ligature as you stated (or go with selnolig+LuaLaTex as Mico said).
    – user224332
    Nov 4, 2020 at 6:23
3

If you're free to employ LuaLaTeX to compile your document, you can employ the selnolig package to suppress the ij ligature automatically if the newtxtext text font package is in use.

enter image description here

If you compare the first and second word in each row, you'll notice that the kern between i and j is not affected by the operation of the selnolig package, even as the ligature is no longer there.

AFAICT, there are no good uses of the ij-ligature in English-language documents, even for words which have a Latin root -- e.g., bijection -- or which derive from another modern language, e.g., bijou, jipijapa (aka Panama hat), and Marijuana (Maryjane -- what else could you possibly have in mind?).

% !TEX TS-program = lualatex
\documentclass{article} 
\usepackage{fontspec} % is required by 'selnolig'
\usepackage{newtxtext}
\usepackage{selnolig}

\begin{document}
bijection bi\kern0ptjection

\em bijection bi\kern0ptjection
\end{document}
3
  • If you use LuaTeX, you would mostly like to employ OpenType fonts (rather than T1 fonts) anyway, wouldn't you?
    – user224332
    Nov 3, 2020 at 12:53
  • @GeekestGeek - Definitely. The main points of the answer are (a) that LuaLaTeX can be used just fine with the newtxtext package and (b) that such a setup allows use of the selnolig package even if no OpenType font is used. Aside: Not many OpenType fonts offer an ij ligature. One of the few that does (and that I'm aware of) is the italic face of Garamond Premier Pro.
    – Mico
    Nov 3, 2020 at 14:30
  • TeX Gyre Termes version 2.004 offers the ij ligature, too. But IMHO it's visually indistinguishable from a properly kerned ij.
    – user224332
    Nov 4, 2020 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy