8

I've noticed dsfont package with amsmath nested accents produces Missing character: There is no... some symbol in a font.

Missing character: There is no  (U+007F) in font dsrom10!
Missing character: There is no  (U+007F) in font dsrom10!
.....
Missing character: There is no  (U+007F) in font dsrom8!
Missing character: There is no  (U+007F) in font dsrom8!
.....

MWE:

\documentclass{article}
\usepackage{amsmath}
\usepackage{dsfont}
\begin{document}
\begin{equation}
\hat{\bar{\mathds{H}}}
\end{equation}
\end{document}

Everything is fine if I add an extra group around \mathds. The problem is in \macc@a macro where \macc@skewchar is the previous char, and it's somehow inserted in \hbox'es in the same level with the font switching command:

...
\setbox\z@\hbox{$#1#2\@empty{}\macc@skewchar$}%
\setbox\tw@\hbox{$#1#2\@empty\macc@skewchar$}%
...

Question is it safe to edit \macc@a macro by adding an extra braces in these boxes, like:

\def\macc@a#1#2{%
  ...
  \setbox\z@\hbox{$#1{#2}\@empty{}\macc@skewchar$}%
  \setbox\tw@\hbox{$#1{#2}\@empty\macc@skewchar$}%
  ...
  }

or \mmacc@nested@a where it passes that parameter to \macc@a:

\def\mmacc@nested@a#1#2#3#4#5{%
  ...
  \macc@palette\macc@a{{#5}}%
}

?

3
  • there have been some recent updates to amsmath for tex live 2016. your example has no problems here, and produces the expected output. what is the date of your version of amsmath, and what vintage of tex live are you using? Aug 29 '16 at 12:55
  • Tested with "This is LuaTeX, Version 0.95.0 (TeX Live 2016/W32TeX) (format=dvilualatex 2016.5.12) 29 AUG 2016 16:11 restricted system commands enabled. **test.tex (./test.tex LaTeX2e <2016/03/31>..... Package: amsmath 2016/03/10 v2.15b AMS math features " I'll try to check where the newer version now. DVI (or PDF) output is ok, these errors just goes in log file
    – Linuxss
    Aug 29 '16 at 13:14
  • @barbarabeeton: I get the missing char messages in the log-file too, with pdflatex and lualatex and with an up-to-date amsmath (2016/06/28 v2.15d). The output looks ok. Aug 29 '16 at 13:24
8

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.

4
  • i've found a more insidious problem in this package: if a lowercase letter is requested but isn't present (and a lot of them are not ) the uppercase equivalent is silently substituted. not documented either, as far as i can tell. have sent report to author of package. Aug 29 '16 at 17:59
  • @barbarabeeton I only see A substituted for a (and indeed, the font has an uppercase A in the place for a).
    – egreg
    Aug 29 '16 at 19:17
  • oh -- do you mean that "b" or "c" instead gets the warning, but no substitution? i only tried it with 'a' ... will have to extend the test. thanks for the warning. Aug 29 '16 at 19:19
  • I'll except egregs answer, but it would still be nice to find out what happens in amsmath that this warning jumps on. Imagine that you see many these warnings while compiling a large math book. Than you'll need to check every char and that is very annoying when you see the character outputed while it writes that something wrong. The same fix I need to do for sans option of dsfont package.
    – Linuxss
    Aug 30 '16 at 6:35
4

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.

Your Answer

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

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