I am attempting to define a command \ideal
that will wrap its argument in bold parentheses.
Here is my attempt: \newcommand{\ideal}[1]{\boldsymbol{\left(\right.} #1 \boldsymbol{\left.\right)}}
This compiles correctly visually (on overleaf) but produces this error:
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} ).
If I use too many of them in the same document, it will not compile at all.
\boldsymbol
is the wrong approach (as well as using\left
and\right
), instead you could use something like this:\newcommand\ideal[1]{\textbf{(}#1\textbf{)}}
. As it is currently defined the\left
and\right
calls don't do anything useful anyway\left
and\right
so that the parentheses would resize.\left
and\right
. What you're doing is using two empty pairs of\left
and\right
. This way it won't resize to anything.