Missing character: There is no... Amsmath bug?
The “Missing character” warning is due to the fact that the dsrom
font is declared as a math alphabet, but the font family lacks a \skewchar
definition, so amsmath
assumes it is character 127 (hexadecimal 0x7F
) which the font doesn't provide.
The warning reports 7F
as missing with LuaLaTeX and ^^?
with pdflatex
.
Indeed, if I do
\documentclass{article}
\usepackage{amsmath}
\DeclareFontFamily{U}{dsrom}{\skewchar\font="AA }
\DeclareFontShape{U}{dsrom}{m}{n}{
<-10> dsrom8
<10-12> dsrom10
<12-> dsrom12
}{}
\usepackage{dsfont}
\begin{document}
\begin{equation}
\hat{\bar{\mathds{H}}}
\end{equation}
\end{document}
so as not to read the Udsrom.fd
file and declare another inexistent character as the \skewchar
I get warnings such as
Missing character: There is no <AA> in font dsrom10!
Don't panic. The warning is innocuous.
If you want to remove it, use an existing character as the \skewchar
:
\documentclass{article}
\usepackage{amsmath}
\DeclareFontFamily{U}{dsrom}{\skewchar\font=`A }
\DeclareFontShape{U}{dsrom}{m}{n}{
<-10> dsrom8
<10-12> dsrom10
<12-> dsrom12
}{}
\usepackage{dsfont}
\begin{document}
\begin{equation}
\hat{\bar{\mathds{H}}}
\end{equation}
\end{document}
Since the font is upright, there's no difference in the final typesetting.
checking the log, i do see the missing character messages. however, those are warnings, not errors, and they don't invalidate the output.
the ds
fonts are "incomplete"; only the uppercase letters, an extra "A",
lowercase "h" and "k", and the digit "1" are present in the font.
there should be no real problems unless you try to use \mathds
with
one of the missing characters. however, it seems that the tex engine
(whichever one you use) will report the omissions whether these characters
are accessed or not.
i'm not sure how one might get rid of the "spurious" warnings, but will try to find out. actually, you should accept egreg's answer. what he recommends will certainly get rid of the unwanted messages for this font; whether it will work as reliably for other "sparse" fonts, i won't try to predict.
addendum:
i have now tested the two amsmath
code modifications suggested in the question.
while they give the desired result when the requested letter is "H", they do
not do the right thing when the requested letter is "a" (which is not
in the ds
font). what they output is an accented "A", and no warning is
given. so those suggestions are a no-op.
further, as i have been reminded off-line, although these messages are warnings, they are reliable only for fonts that follow the model promulgated by knuth. thus the problem here really is a faulty font definition, and that is where the fix should be made. if a warning is generated for any other reason, it should be looked into carefully, as it might be the only evidence of something missing from the output. in this era of non-knuth fonts, it would be reasonable to elevate this to an error.