Consider the following example (PDFLaTeX, TeXLive 2011):

% This isn't *stricly* necessary, of course...
  \def\ensuremath#1{\TextOrMath{\(\relax #1\)}{#1}}
% Common double-struck characters such as ℂ, ℍ, ℕ, ℙ, ℚ, ℝ and ℤ are
% set up to work by inputenc.sty.  They are in the range u+2102-2149
% along with some other characters that aren't in amsmath's blackboard
% bold font such as ⅆ and ⅈ.
\defTeXorMathorUnicodePDFcmd\CC{\mathbb C}{ℂ}
% 𝔽 is an example of a character that inputenc.sty doesn't make work. 
% It - along with the characters 𝔸, 𝔹, 𝔻, &c - are in the completely 
% different range u+1D538-1D7E1.
\defTeXorMathorUnicodePDFcmd\FF{\mathbb F}{𝔽}
\begin{document} \section{\CC and \FF, [\ldots]} \end{document}

The purpose of \CC is to get ℂ in both the text and the PDF TOC when used in for example a section header. What's needed to get \FF to do the same for 𝔽 (and similarly for the other "uncommon" double-struck characters)?

PS: I copied the characters from here: http://graphemica.com/search?q=double+struck

  • 1
    I can see both ℂ and 𝔽 in the bookmark, both with Skim and Adobe Reader.
    – egreg
    Feb 23 '12 at 11:59
  • I feel like an idiot... in my original file, I had those macro definitions before \usepackage[unicode]{hyperref}. Of course Adobe Reader doesn't display the double-struck F because its UI font is missing the glyph, but moving the definitions of \FF and friends to after hyperref did fix the problems I was having with pdflatex giving errors.
    – kahen
    Feb 23 '12 at 12:31
  • I don't get errors even putting the definitions before loading hyperref
    – egreg
    Feb 23 '12 at 12:39
  • But you made me encounter a valid problem trying to understand yours... And now I'd like to have it solved. Feb 28 '12 at 18:16

This is not an proper answer, but an analysis of the problem.

The problem seems pdf-viewer dependent. I see 𝔽 in the bookmarks with Adobe Reader, but not with Evince (a Linux pdf-viewer). The error message hints at the source of the error : it says that ' \xed\xa0\xb5\xed\xb4\xbd' (for 𝔽) is not a valid UTF8 sequence. Indeed, it is not a UTF-8 byte sequence, but a CESU-8 sequence. They are indistinguishable most of the common characters (on the basic multilingual plane), but 𝔽 is on another plane.

I don't know whether the pdf-format wants UTF-8 or CESU-8 encoded text, so I don't know if the bug is on the pdf generation side (in pdflatex) or on the viewer side.

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.