我使用宏 \DeclarePairedDelimiterX 来定义映射 f 的定义域符号 $\mathbb{D}_f$。然而,Overleaf 编译器拒绝接受它作为有效符号。
\DeclarePairedDelimiterX{\domain}[1]{\mathds{D}}{}{{}_{#1}}
错误:
You need to enclose all mathematical expressions and symbols with special markers. These special markers create a ‘math mode’.
Use $...$ for inline math mode, and \[...\]or one of the mathematical environments (e.g. equation) for display math mode.
This applies to symbols such as subscripts ( _ ), integrals ( \int ), Greek letters ( \alpha, \beta, \delta ) and modifiers (\vec{x}, \tilde{x}).
答案1
左和右的参数需要是与
\left..\right
您一起工作的分隔符,不能用作\mathds{D}
左分隔符。
我怀疑你想要
\newcommand\domain[1]{\mathds{D}_{#1}}
$\domain{f}$