LaTeX forum ⇒ XeTeXWhy is there huge kerning in Δ(σ) and how to reduce it automatically?

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
user49915
Posts: 62
Joined: Wed Apr 17, 2019 12:51 pm

Why is there huge kerning in Δ(σ) and how to reduce it automatically?

Postby user49915 » Mon Apr 22, 2019 10:21 pm

Consider the input
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \RequirePackage{ifthen}
  2. \RequirePackage{ifxetex,ifluatex}
  3. \newif\ifxetexorluatex
  4. \ifxetex
  5. \xetexorluatextrue
  6. \else
  7. \ifluatex
  8. \xetexorluatextrue
  9. \else
  10. \xetexorluatexfalse
  11. \fi
  12. \fi
  13. \documentclass{standalone}
  14. \ifxetexorluatex
  15. \tracinglostchars=2
  16. \usepackage{fontspec}%% needed only for xelatex.
  17. \usepackage[american,british,french,norsk,german,ngerman]{babel} % warning: last language option will be chosen for fixed text of environments like example or definition (in svmono)
  18. \usepackage{mathtools}%%% loads amsmath internally
  19. \mathtoolsset{mathic=true} %%% See <!-- m --><a class="postlink" href="http://tex.stackexchange.com/a/3496/">http://tex.stackexchange.com/a/3496/</a><!-- m -->
  20. \usepackage{amssymb}
  21. \usepackage[math-style=ISO]{unicode-math}
  22. \setmainfont[Ligatures=TeX]{TeX Gyre Termes}
  23. \setsansfont{TeX Gyre Heros}[Scale=0.88]%%% Somewhat ok.
  24. \setmonofont{TeX Gyre Cursor}%%% No explicit turning on ligatures for the monospaced font.
  25. \setmathfont[Ligatures=TeX]{TeX Gyre Termes Math}
  26. \setmathfont[Ligatures=TeX,range={\setminus}]{Asana Math}
  27. \else
  28. \usepackage[T2A,T1]{fontenc}%%% The fontenc package is explicitly loaded with the T2A,T1 argument simply to avoid the warning of babel about missing T2A in the log. As for the order of loading, David Carlisle says in <!-- m --><a class="postlink" href="https://tex.stackexchange.com/questions/241452/generating-a-template/241479#241479">https://tex.stackexchange.com/questions ... 479#241479</a><!-- m --> that fontenc produces information needed by inputenc (which, however, delays processing till the beginning of the document, which makes the order of these two packages irrelevant). Moreover, in the examples in the documentation of newtx fontenc is always loaded before newtx.
  29. \usepackage[utf8]{inputenc} % Native LaTeX umlaut support
  30. \usepackage[american,british,french,norsk,german,ngerman]{babel} % warning: last language option will be chosen for fixed text of environments like example or definition (in svmono)
  31. \usepackage{newtxtext}% Load it after babel according to Michael Sharpe's newtx manual from Dec 14, 2017.
  32. \usepackage[slantedGreek]{newtxmath}%% Should be loaded after the text font according to its manual. The default uppercase Greek letters should be slanted according to the Springer manual.
  33. \usepackage{courier}
  34. \usepackage{mathtools}%%% loads amsmath internally
  35. \mathtoolsset{mathic=true} %%% See <!-- m --><a class="postlink" href="https://tex.stackexchange.com/a/3496/">https://tex.stackexchange.com/a/3496/</a><!-- m -->
  36. \fi
  37. \usepackage[babel=true,verbose=errors]{microtype}%%% Microtype documentation says it determines the best settings itself, depending on the compiler and the driver.
  38. \begin{document}
  39. \(\Delta(\sigma)\)
  40. \end{document}


All the fonts are Times-like. Depending on which compiler you use (see the attachment), you get different kerning in and around the parentheses ( ). In particular, for {xe|lua}latex, the kerning seems exorbitantly larger than for pdflatex; the output is wider although the single symbols are less slanted and/or thinner. Why does it happen and how to get properly small kerning when compiling with {xe|lua}latex?
Attachments
q.xelatex.jpg
Compiled with xelatex
q.xelatex.jpg (6.15 KiB) Viewed 922 times
q.pdflatex.jpg
Compiled with pdflatex
q.pdflatex.jpg (6.44 KiB) Viewed 922 times
q.lualatex.jpg
Compiled with lualatex
q.lualatex.jpg (6.15 KiB) Viewed 922 times


kaiserkarl13
Posts: 636
Joined: Tue Mar 25, 2008 5:02 pm

Postby kaiserkarl13 » Wed Apr 24, 2019 9:14 am

My guess is that there is a font substitution for the slanted Dellta symbol (which is an unusual glyph). I don't get any of that extra space if I just use txfonts, newtxmath, or mathptmx without substituting the main text fonts for something else (as you did in your example).

user49915
Posts: 62
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Wed Apr 24, 2019 10:34 pm


So, does that mean that I have to create a feature file with n^2 combinations myself, where n is the number of characters present in the font (or at least the number of characters I use)? Is there nothing already available?

user49915
Posts: 62
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Wed Apr 24, 2019 10:36 pm

kaiserkarl13 wrote:txfonts, newtxmath, or mathptmx

All these go with pdflatex. As for the OTF fonts, the situation is different.

user22741
Posts: 35
Joined: Fri Nov 09, 2018 12:03 pm

Postby user22741 » Wed Apr 24, 2019 10:43 pm

user49915 wrote:

So, does that mean that I have to create a feature file with n^2 combinations myself, where n is the number of characters present in the font (or at least the number of characters I use)? Is there nothing already available?


No need for n^2 combinations, just for the few ones that cause a problem

user49915
Posts: 62
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Wed Apr 24, 2019 11:10 pm

user22741 wrote:No need for n^2 combinations, just for the few ones that cause a problem

The problem with that is that even if I had time for all the combinations that cause problems (the above is simply one example out of many), I'm not educated enough in typesetting to get the best kerning values.


Return to “XeTeX”

Who is online

Users browsing this forum: No registered users and 2 guests