Change only ONE character in Latex template
Just change the \mathcode
of v
:
\documentclass{book}
\usepackage{amsmath}
\usepackage{txfonts}
\AtBeginDocument{\mathcode`v=\varv}
\begin{document}
A `v' in math: $v$
A `nu' in math: $\nu$
\end{document}
Output with the \AtBeginDocument
line commented out
Output with the \AtBeginDocument
line uncommented
Comments
I'd suggest using
\usepackage{newtxtext}
\usepackage[varvw]{newtxmath}
instead of \usepackage{txfonts}
. The fonts are essentially the same, but the defects of txfonts
are straightened off.
\documentclass{book}
\usepackage{amsmath}
\usepackage{newtxtext}
\usepackage[varvw]{newtxmath}
\begin{document}
A `v' in math: $v$
A `nu' in math: $\nu$
\end{document}
Supposing you are using:
\usepackage{newtxtext,newtxmath}
The following in your preamble replaces your 'v's in mathmode with the \varv
symbol in the output.
\DeclareMathSymbol{v}{\mathord}{lettersA}{51}
\documentclass{article}
\usepackage{newtxtext,newtxmath}
\usepackage[T1]{fontenc}
\DeclareMathSymbol{v}{\mathord}{lettersA}{51}
\begin{document}
This is \verb+\varv+ $\varv$
This is v $v$.
This is greek \verb+\nu+ $\nu$.
\end{document}