I used tikz to define some custom symbols. They work fine in the text, but I have problems using them in a section title:
\documentclass{article}
\usepackage{tikz}
\newcommand{\customSymbol}[1]
{%
\begin{tikzpicture}[#1]
\draw (0,0) -- (1,0);
\end{tikzpicture}
}
\begin{document}
This works fine: \customSymbol{}.
% \section{This does not work: \customSymbol{}}
\end{document}
What can I do to fix this?
\section{This should work: \protect\customSymbol{}}instead. – Martin Scharrer Dec 19 '17 at 14:51