2

I'm using \texorpdfstring to display math symbols in PDF bookmark. The problem I have is that: the symbol {} is missing in the bookmark. Besides, I don't know how to show \underline{\sigma} in unicode format. In a previous post, people suggested that I copy/paste unicode characters from https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts. But I didn't find the symbol \underline{\sigma} on this website.

The codes I'm writing is:

\documentclass{article}
\usepackage[pdfencoding=unicode]{hyperref}
\usepackage{amsfonts}
\begin{document}

\section{The case of \texorpdfstring
          {$f(x_i, \sigma)$, $\forall i \in \left\{1, 2, 3 \right\}$, $\forall 
           \sigma \in (0, \underline{\sigma})$}{f(xᵢ,σ), ∀i∈{1,2,3}, ∀σ∈(0,σ)}}
\end{document}

The output is: enter image description here

As shown in the above figure, the symbol {} is missing in the bookmark (it should be i∈{1,2,3} rather than i∈1,2,3). Besides, I don't know how to type \underline{\sigma} in unicode format.

Can anyone solve the two problems? Any answer or comments are welcome.

1
  • There is also \lbrace and \rbrace. Commented 3 hours ago

1 Answer 1

3

The left and right braces should be \{ and \}. The underlined sigma is attained by combining U+03C3 (σ) and U+0332 ( ̲ ).

\documentclass{article}
\usepackage[pdfencoding=unicode]{hyperref}
\usepackage{bookmark}
\usepackage{amsfonts}
\begin{document}

\section{The case of \texorpdfstring
          {$f(x_i, \sigma)$, $\forall i \in \left\{1, 2, 3 \right\}$, $\forall 
           \sigma \in (0, \underline{\sigma})$}{f(xᵢ,σ), ∀i∈\{1,2,3\}, ∀σ∈(0,σ̲)}}
\end{document}

If you use VS Code and Insert Unicode extension, it's pretty handy to enter.

5
  • One more question: how to combine U+03C3 (σ) and U+0332 ( ̲ )? When I type \unichar{"03C3}\unichar{"0332} in the second {} of \texorpdfstring{}{}, it shows σ̲ (the lower bar is not under sigma) in the PDF bookmark. This is not the symbol I need. So what's the correct unicode for \underline{\sigma}?
    – Ya He
    Commented 11 hours ago
  • Do you use VS Code. If so, you can try the Insert Unicode plugin.
    – Stephen
    Commented 11 hours ago
  • @YaHe I really think you are misusing the bookmark system, you should not try to force 2d mathematical layout into the plain text. You can use U+03CC U+0332 σ̲ so a sigma followed by a combining under bar, but whether the underbar does combine and appear under, or if it appears after the sigma, or if it does not appear at all, then depends on the font used for showing bookmarks on the reader's pdf reading system over which you have no control. Commented 10 hours ago
  • @DavidCarlisle Thanks for your comments. I know it's not good to display math symbols in the PDF bookmark. But this is my paper and I have no other choice. Btw, I still don't understand how to combine U+03C3 and U+0332 to show \underline{\sigma}).
    – Ya He
    Commented 9 hours ago
  • 1
    @YaHe as I say there is no way to ensure that will happen as there is no markup allowed in pdf bookmarks, you always have a choice to use a more suitable text. Your best bet is to use a sigma and combining underbar ie copy and paste σ̲ but whether that works in a specific pdf reader depends on the font used by that reader over which you have no control it is part of the reader's implemented user interface not part of the document. But I would re-word the bookmark not to need an underlined sigma Commented 9 hours ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .