I achived generating smaller macrons thanks to Tobi's code from Question 263549, but Latex throws "Undefined control sequence" if I try to use it in \section, \subsection and so on. How can I make the command \smartmacron (code follows) work in headings?
\newlength\tmp
\newcommand{\smartmacron}[1]{%
\settowidth{\tmp}{#1}%
\makebox[\tmp][c]{%
\rule[1.2ex]{0.6\tmp}{0.035em}%
}\kern-\tmp#1%
}
Mnot-WE:
\documentclass{scrartcl}
\newlength\tmp
\newcommand{\smartmacron}[1]{%
\settowidth{\tmp}{#1}%
\makebox[\tmp][c]{%
\rule[1.2ex]{0.6\tmp}{0.05em}%
}\kern-\tmp#1%
}
\begin{document}
\section{\smartmacron e}
\end{document}
\smartmacronwhich would need protecting (or define robustly). For example\section{\protect\smartmacron e}. – Nicola Talbot Dec 11 '15 at 19:09