I like Heiko Oberdiek's solution. The question remains what one can do if one wants to add Unicode characters that don't have predefined commands like \int
and \sum
.
One option is to \usepackage[utf8]{inputenc}
and \hypersetup{pdfencoding=unicode}
(if it is not already set as an option to hyperref
), and to include literal UTF-8 encoded characters in the source file.
This works fine, but personally I don't like using non-ASCII encodings in source files. One reason is that my preferred text editor does not always have the fonts to display every Unicode character. Another is that I like to be able to copy and paste source code into places (like here) where Unicode may or may not show up correctly at the other end.
Here is another option, using TeX's ^^
input syntax to "armor" the Unicode as ASCII. This requires first determining the byte-per-byte UTF-8 encoding of each character. They can then be written like this:
\documentclass{article}
\usepackage[pdfencoding=unicode]{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\begin{document}
\section{The group \texorpdfstring
{$U_n(\mathbb{D}[\omega])$}
{U^^e2^^82^^99(^^e2^^85^^85[^^cf^^89])}}
\end{document}
(source: mathstat.dal.ca)