I am trying to generate my own recipe collection. I've got my inspiration from An Aesthetically Pleasing Recipe Book Template. It is really similar but I've tweaked a few things. So far, it's working well but I found something that bugs me and I do not know how to solve it.
I wanted to generate a pdf file from my collection with easy access to the recipe so I used the hyperref package and its pdfbookmark command. It works until I am trying to use accented characters in that command. It seems that those characters are breaking the bookmark rendering.
- If I remove the accented characters, it works.
- If I replace
éby\`e, it does not work. - I've tried to use
utf8xwith\PrerenderUnicode{é}instead ofutf8as mentioned in this answer, but it does not work. - I've tried to use the
unicodeoption in thehyperrefpackage as mentioned in this answer, but it does not work.
Here is a minimal (kind of) working example of my collection:
\documentclass[twoside, 12pt]{article}
\usepackage[letterpaper, headheight=15pt, left=1cm, right=1cm, top=2cm, bottom=2cm]{geometry}
\usepackage{fancyhdr}
\usepackage[utf8]{inputenc}
\usepackage[hidelinks,bookmarks,unicode]{hyperref}
\usepackage{bookmark}
\newcommand{\group}[1]{
\pdfbookmark{#1}{#1}
}
\newcommand{\recipe}[1]{%
\newpage%
\pagestyle{fancy}%
\fancyhead[RO,LE]{\footnotesize{\textbf{#1}}}%
\fancyfoot[RO,LE]{\thepage}%
\fancyfoot[C]{}%
\pdfbookmark[1]{#1}{\pdfmdfivesum{#1}}%
\section*{#1}%
}
\begin{document}
\group{Boissons}
\recipe{Dark & stormy}
\recipe{Limonana}
\group{Desserts}
\recipe{Tiramisu}
\recipe{X-mas cake}
\group{Poisson}
\recipe{Gravlax de saumon au miel et à la moutarde}
\recipe{Pain de saumon}
\group{Viande}
\recipe{Boulets de Liège}
\recipe{Poulet à l'ananas}
\recipe{Ragoût à la joue de bœuf et lard paysan}
\end{document}
What should I do to allows the bookmarks to work properly with accents?

\usepackage[T1]{fontenc}in the preamble. – Mico Feb 03 '21 at 13:02\pdfbookmark[1]{#1}{\pdfmdfivesum{\detokenize{#1}}}– Ulrike Fischer Feb 03 '21 at 13:18