2

I have some section/subsection titles with partial italicised text. With the hyperref and bookmark packages I get the required bookmarks, but the style for these partial italicised text disappears. According to this answer, it is not possible to implement this directly. My workaround consist of using the \unichar command in order to obtain the (math) italic letters (I learned this method from this question). Here is the MWE:

\documentclass{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[pdfencoding=unicode]{hyperref}
\usepackage{bookmark}

\begin{document}

% Title: Zorn lemma (d'après Zorn)

\section{Zorn lemma (\texorpdfstring{\emph{d'après}}{\unichar{"1D451}\unichar{"2019}\unichar{"1D44E}\unichar{"1D45D}\unichar{"1D45F}\unichar{"0300}\unichar{"1D452}\unichar{"1D460}} Zorn)}

\end{document}

Since no accented italic fonts are implemented in Unicode, I am using

Unicode Character 'Combining Grave Accent' (U+0300)

together with

Unicode Character 'Mathematical Italic Small E' (U+1D452)

in order to generate the character è. This is not working, though, because (I guess) the combining accent is trying to operate on the "s" character (U+1D460) as well:

enter image description here

A partial and unsatisfactory solution is to introduce a blank space before the "è" character:

\unichar{"1D451}\unichar{"2019}\unichar{"1D44E}\unichar{"1D45D}\unichar{"1D45F} \unichar{"0300}\unichar{"1D452}\unichar{"1D460}

enter image description here

(incidentally, this solution refutes my theory about the scope of the combining accent). My last resort was trying to create a specific command for the "è" character:

\newcomand{\dapres}{\unichar{"0300}\unichar{"1D452}}

But in this case I get the "Undefined control sequence" error message, even if I am not using the new command.

  • on windows the adobe reader doesn't like it at all if I try to use a combining accent with a math char in the bookmarks. Beside this I don't think that it is a sane idea: You are putting look over meaning. What should e.g. do a screen reader with such a bookmark? – Ulrike Fischer Jan 12 at 18:19
  • @UlrikeFischer Indeed, the correct implementation is PDF viewer-dependent: both Firefox and Edge put the grave accent onto the "s", whereas Chrome correctly shows "d'après". Regarding your "look over meaning" comment: you are totally right! I am somewhat obsessed with formatting details. But thanks anyway for your concern, perhaps the best course of action is "to let it go". – Matemáticos Chibchas Jan 12 at 18:28
1

Your command does not work because of a typo (it's \newcommand, with two M's):

\newcommand{\dapres}{\unichar{"0300}\unichar{"1D452}}

But even so, your command wouldn't do what you want. If you put the accent mark after the italicized E, however, we get the expected bookmark:

\documentclass{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%"unicode" works for hyperref
\usepackage[unicode]{hyperref}
\usepackage{bookmark}
%Use it if you want
\newcommand{\dapres}{\unichar{"1D452}\unichar{"0300}}

\begin{document}

% Title: Zorn lemma (d'après Zorn)
\section{Zorn lemma (\texorpdfstring{\emph{d'après}}{\unichar{"1D451}\unichar{"2019}\unichar{"1D44E}\unichar{"1D45D}\unichar{"1D45F}\unichar{"1D452}\unichar{"0300}\unichar{"1D460}} Zorn)}
Hello

\end{document}

Btw, it works on Linux, so I expect it works in Windows too: enter image description here

¡Suerte y muchos éxitos!

| improve this answer | |
1

I would avoid such tricks in the booksmarks. How they are handled depends on the implementation of the pdf viewer. On Windows e.g. the adobe reader doesn't like it at all if I try to use a combining accent with a math char in the bookmarks.

Beside this I don't think that it is a sane idea anyway: You are putting look over meaning. What should e.g. do a screen reader with such a bookmark?

It is imho much better to accept that bookmarks are simple navigation aids, and not to try to get high quality typesetting here.

| improve this answer | |

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.