2

In this MWE, how could you add a circumflex inside pdfstring argument of the \texorpdfstring command so it can be displayed in the pdf bookmarks?

MWE:

\documentclass{article}

\usepackage{amsfonts}
\usepackage{hyperref}

\begin{document}

\section{\texorpdfstring{Section $\mathbb{R}^k$}{Section R^k}}
Blah blah

\section{\texorpdfstring{Section $\mathbb{R}^k$ bis}{Section R\^k}}
Blah blah

\section{\texorpdfstring{Section $\mathbb{R}^k$ bis bis}{Section R\^ k}}

Blah blah

\end{document}

And this is what I am currently obtaining in the bookmarks:

Capture

What I would like to display in the bookmark is "Section R^k", with the circumflex (if this is possible...).

5

You could use the 'ASCII' circumflex provided by textcomp:

\documentclass{article}

\usepackage{amsfonts,textcomp}
\usepackage{hyperref}

\begin{document}

\section{\texorpdfstring{Section $\mathbb{R}^k$}{Section R\textasciicircum k}}
Blah blah

\end{document}
  • Thanks for the answer @cfr, it works as expected. Just for curiosity, would be possible to invoke directly the ASCII code without requiring the package? – epsilone Oct 11 '14 at 1:44
  • 1
    @epsilone Well it is not really a matter of the ASCII code. Rather, it is a matter of accessing a particular character in the font under the TS1 font encoding. See tex.stackexchange.com/questions/14386/… for information about ways to get a single symbol from a font. I don't, to be honest, see much point in doing so. textcomp is a useful package anyway (I just load it by default the same way I enable the T1 encoding and UTF8 input - it isn't worth thinking about whether I need it or not). – cfr Oct 11 '14 at 2:21

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.