\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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
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}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis