3

Normally when using math equations inside titles with the classicthesis package, one can use \texorpdfstring to get out of problems. Here this does not seem to work, no idea why.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[nochapters]{classicthesis}
\usepackage{amsmath, scalerel}
\newcommand{\antishriek}{\scalerel*{$¡$}{!}}

\begin{document}
\subsection{\texorpdfstring{$a^{\antishriek}$}{TEXT}}
\end{document}
Damien L
  • 621

1 Answers1

3

\scalerel is a fragile command. Either you define \antishriek with \DeclareRobustCommand

\DeclareRobustCommand{\antishriek}{\scalerel*{$¡$}{!}}

or use \protect when in a moving argument (sectional titles or captions)

\subsection{\texorpdfstring{$a^{\protect\antishriek}$}{TEXT}}

Maybe you're interested in a different definition for \antishriek:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[nochapters]{classicthesis}
\usepackage{amsmath}

\DeclareMathSymbol{\antishriek}{\mathord}{operators}{'74}

\begin{document}

\subsection{\texorpdfstring{$a^{\antishriek}+a^{!}$}{TEXT}}

\end{document}

enter image description here

If you want the reverse exclamation mark to be raised at the same level as the exclamation mark, you can do as follows

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[nochapters]{classicthesis}
\usepackage{amsmath}

\DeclareMathSymbol{\antishrieksymbol}{\mathord}{operators}{'74}

\makeatletter
\DeclareRobustCommand{\antishriek}{{\mathpalette\anti@shriek\relax}}
\newcommand\anti@shriek[2]{%
  \raisebox{\depth}{$\m@th#1\antishrieksymbol$}%
}
\makeatother


\begin{document}

\subsection{\texorpdfstring{$a^{\antishriek}+a^{!}$}{TEXT}}

\end{document}

enter image description here

egreg
  • 1,121,712