我正在尝试在数学公式中放大希腊字母。为此,我遵循这个答案\scaleobj
并从包中使用scalerel
但是,当我尝试在节标题中使用包含我的放大符号的表达式并使用时\tableofcontents
,会出现错误。
错误的原因是什么?如何在不破坏目录的情况下在节标题中使用我的小公式?
这是一个最小错误产生的例子:
% minimum working example to demonstrate a problem with math mode and scalebox not working together with headers and table of contents
% this is the base class of my document
\documentclass{scrbook}
% minimum number of imports
\usepackage{scalerel}
\usepackage{amsmath}
% define upscaled \pi
\newcommand{\PI}{\scaleobj{1.5}{\pi}}
% use this symbol inside math mode
\newcommand{\mypi}{\(\PI_\text{mypi}\)}
\begin{document}
\tableofcontents
\chapter{Main Chapter}
Some text about \mypi.
% comment out the following line to get a minimum working example
\section{What's the matter with \mypi?}
Some more text.
\end{document}