2

Is there a way to modify the bookmarksnumbered option of hyperref to add a prefix and/or suffix to the section numbers? The option currently changes the bookmark Introduction to 1 Introduction, but I was hoping to achieve something like C1 - Introduction

\documentclass{book}
\usepackage[bookmarksnumbered]{hyperref}
\begin{document}
\chapter{Introduction}
\end{document}

closed as unclear what you're asking by Mensch, user11232, Svend Tveskæg, Gonzalo Medina, egreg Sep 17 '15 at 15:31

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Oct 18 '14 at 17:54
2

Inserting a modified \thechapter command just before the bookmark writing operation works (at least for a small document).

(Most likely the \let...` statement is necessary. I'll check later on)

\documentclass{book}
\usepackage[bookmarksnumbered]{hyperref}
\usepackage{xpatch}

\let\origthechapter\thechapter

\makeatletter
\xpatchcmd{\addcontentsline}{%
\Hy@writebookmark{\csname the#2\endcsname}%
      {#3}%
      {\@currentHref}%
      {\Hy@toclevel}%
      {#1}%
}{%
\begingroup
\renewcommand{\thechapter}{C\origthechapter}
\Hy@writebookmark{\csname the#2\endcsname}%
{#3}%
{\@currentHref}%
{\Hy@toclevel}%
{#1}%
\endgroup
}{\typeout{Success}}{}
\makeatother


\begin{document}
\chapter{Introduction}
\section{Other One}
\chapter{Two}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.