\not
? For example,I'd like to define
\not\mycmd
as Code: Select all
\text{not}\mycmd
\not
? For example,\not\mycmd
as Code: Select all
\text{not}\mycmd
NEW: TikZ book now 40% off at Amazon.com for a short time.
Code: Select all
\documentclass{article}
\newcommand*\mycmd{foobar}
\renewcommand*\not{not}
\begin{document}
\not\mycmd
\end{document}
\not
to be \text{not}
I'm guessing you want something like a math operator?Code: Select all
\documentclass{article}
\usepackage{amsmath}
\newcommand*\mycmd{baz}
\let\not\relax
\DeclareMathOperator\not{\text{not}}
\begin{document}
\[\not\mycmd\]
\end{document}
\not
, only in combination with \mycmd
. In hindsight, it's not a big requirement for me.Code: Select all
\documentclass{article}
\usepackage{amsmath}
\newcommand*\mycmd{blub}
\makeatletter
\let\orig@not\not
\DeclareMathOperator\spec@not{\text{not}}
\renewcommand*\not{\@ifnextchar\mycmd{\spec@not}{\orig@not}}
\makeatother
\begin{document}
\[\not\mycmd ~ \not A\]
\end{document}
NEW: TikZ book now 40% off at Amazon.com for a short time.