Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Consider the following minimal document:

\documentclass{article}
\begin{document}

tām आ ṁ

\end{document}

If you compile it with xelatex se.tex, you get something normal and innocuous, like:

This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian)
entering extended mode
(./se.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov
ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1
9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san
skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn
orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian
, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po
rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo)) (./se.aux) [1] (./se.aux)
 )
(see the transcript file for additional information)
Output written on se.pdf (1 page).
Transcript written on se.log.

which does not seem to contain any error message. But if you open the PDF file, you'll notice that it just says "tm" (or if you had used \usepackage{fontspec}, it says "tām") instead of tām आ ṁ.

XeTeX has silently dropped characters, without user warning!

To be fair, if you really look inside se.log, it contains a line saying:

Missing character: There is no ā in font cmr10!

or, if you had used \usepackage{fontspec}, it may contain:

Missing character: There is no ṁ in font [lmroman10-regular]:mapping=tex-text
!

but most people are not in the habit of looking inside the log file when there's no indication of error.

Is there a way of telling XeTeX that missing characters should be treated more seriously, and reported in the main screen itself? Some command-line flag, environment variable, or config file change, perhaps?

(Of course, now that I've been bitten by this, I can write a shell script that will grep for such messages in the log file... but I'm wondering if there's a way to make it the default, and get this change into default distributions, so that it will help other users as well.)

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

If you set \tracinglostchars=2, then the message is printed also during the run on the terminal

This is XeTeX, Version 3.1415926-2.3-0.9997.5 (TeX Live 2011)
 restricted \write18 enabled.
entering extended mode
(./lostla.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, galician, german, ngerman, swissgerman, monogreek, greek, hungarian,
 icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, marathi, or
iya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji,
 lao, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, pol
ish, portuguese, romanian, russian, sanskrit, serbian, serbianc, slovak, sloven
ian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, welsh, loaded
.
(/usr/local/texlive/2011/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2011/texmf-dist/tex/latex/base/size10.clo))
No file lostla.aux.
Missing character: There is no ā in font cmr10!
Missing character: There is no आ in font cmr10!
[1] (./lostla.aux) )
Output written on lostla.pdf (1 page).
Transcript written on lostla.log.

If I also add \usepackage{fontspec} I get instead only

Missing character: There is no आ in font [lmroman10-regular]:mapping=tex-text!
share|improve this answer
    
Thanks, this is the sort of answer I was hoping for! That works. I don't know why it isn't on by default, but I'll remember to include \tracinglostcharacters=2 in future, in my files and in instructions I give others. –  ShreevatsaR Jan 16 '12 at 10:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.