1

Feeding xelatex or lualatex with

\documentclass{article} \pagestyle{empty} \usepackage{unicode-math} \setmainfont[Ligatures=TeX]{TeX Gyre Termes} \setsansfont{TeX Gyre Heros}[Scale=0.88]%%% Somewhat ok. \setmonofont{TeX Gyre Cursor}%%% No explicit turning on ligatures for the monospaced font. \setmathfont[Ligatures=TeX]{TeX Gyre Termes Math} \tracinglostchars=2 \begin{document} \(\mathit{\vec{i}}\) \end{document} 

results in

i

without any arrow. Of course, the problem can be circumvented by dropping \usepackage{unicode-math}\setmathfont[Ligatures=TeX]{TeX Gyre Termes Math} or exchanging the order of calling \vec and \mathit or simply dropping \mathit for single-letter arguments (as no kerning between adjacent letters of the argument would be needed). However, since the calls to the two macros may be hidden inside other macros (and for my larger, non-minimal LaTeX sources, they are indeed hidden inside other macros), it would be better to solve the problem already on the level of the preamble or in the unicode-math package or by patching it or, ideally, extending the TeX Gyre Termes Math font in such a way that the user's main document needn't be changed. Any idea how to do this?

PS. For latex/pdflatex and NewTX, cf. \mathit{\vec{…}} silently swallows up the vector when using latex/pdflatex and newtxmath .

14
  • 1
    Side note, regarding "how to give error instead of silently ignore" see e.g. errors - Getting xetex to complain when a character is missing - TeX - LaTeX Stack Exchange and others Commented May 11, 2022 at 1:09
  • By the way it's recommended to use https link instead of http link, so that some functionalities in the site works properly. Commented May 11, 2022 at 1:10
  • @user202729 As for http vs. https, I don't know which functionality would make the difference. As for \tracinglostchars=2, thanks!!! Commented May 11, 2022 at 1:12
  • This looks suspiciously like tex.stackexchange.com/q/643756 (also from you) which differs only in the font used, and has an answer. Commented May 11, 2022 at 1:14
  • 1
    you can use \usepackage[mathit=sym]{unicode-math}, then \mathit will no longer switch to a text font. But basically your input is errounous. \mathit is not a command to make a mathematical expression italic, but should normally be used with letters only. Commented May 11, 2022 at 7:27

0

You must log in to answer this question.