I've just realized that I made a big mistake sometime ago when in my preamble I defined the new command
\renewcommand{\v}{\mathbf{v}}
Now, I'd like to type the czech s using \v{s}
, but I can't.
Do you have any suggestions?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIdeally, you should not define your macros using 1-letter names, because of ambiguity. Worse yet, you redefined an existing 1-letter macro name. If going through your document and reversing that usage is not feasible, then one can compensate by saving a copy of the original before redefining it. That way, the original is available under the saved alternate name.
\documentclass{article}
\let\altv\v
\renewcommand{\v}{\mathbf{v}}
\begin{document}
$\v + B = C$
ab\altv ecde
\end{document}
Don't do it again! ;-)
Count to one million before using \renewcommand
and then think twice.
For the document you already have typed, the best thing is to change all \v
referring to vectors into something else, say \vecv
.
Keeping the same command for doing different things is possible too, but I don't recommend it.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\let\ORIGINALv\v
\DeclareRobustCommand{\v}{%
\ifmmode\mathbf{v}\else\expandafter\ORIGINALv\fi
}
\begin{document}
\section{\v{c}č}
Háček or h\'{a}\v{c}ek
$\v+x=y$
\end{document}
\v
throughout your document. If this is infeasible, the, prior to the\renewcommand
, issue this:\let\svv\v
. Then you can use\svv
to capture the original definition.