2

How can I get work \textsuperscript inside \section?

\documentclass[unicode, fontsize=9pt, twoside=false, russian, a5paper]{scrbook}
\usepackage{polyglossia}
\setmainfont{PT Serif}
\setsansfont{PT Sans Caption}
\setmonofont{PT Mono}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text}
\setdefaultlanguage[spelling=modern]{russian}
\setotherlanguage{english}
\usepackage{xunicode}
\KOMAoptions{DIV=18,pagesize=auto}
\usepackage[
    colorlinks=true,
    linkcolor=black,
    citecolor=DarkGreen,
    urlcolor=SteelBlue,
    xetex,
    unicode=true,
    bookmarks=false,
    pdfstartview=FitH,
    pdfpagelayout=OneColumn,
    final=true,
    draft=false,
    debug=false,
]{hyperref}
\begin{document}
\title{Title}
\author{Author}
\maketitle{}
\tableofcontents{}

\section{Bla-bla\hyperlink{c_48}{\textsuperscript{\{48\}}}}

\end{document}

error:

$ xelatex test.tex:

! Undefined control sequence.
\hyper@@link ->\let \Hy@reserved@a 
                                   \relax \@ifnextchar [{\hyper@link@ }{\hyp...
l.33 ...hyperlink{c_48}{\textsuperscript{\{48\}}}}
4

\hyperlink is defined in package hyperref.

\usepackage{hyperref}

And \protect before \hyperlink lets it survive in the moving argument of \section:

\section{Bla-bla\protect\hyperlink{c_48}{\textsuperscript{\{48\}}}}
  • added \usepackage{hyperref} – fakel Jun 19 '14 at 11: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.