13

I have a book template of Elsevier for which in the math environment the character "v" looks very similar to greek \nu. This causes a lot of misunderstanding and frustration for the readers. I have tried the txfonts package and it solves the problem. Here are the outputs enter image description here

Since the book is already finished and I cannot replace all the "v" characters with \varv

MY QUESTION IS: Is there any way that I can change the "v" letter with \varv in the Latex template that I have? This will be a lifesaver.

  • What font package are you using? Is it mathptmx? – egreg Nov 28 '16 at 10:11
  • @egreg On the main file it reads: \documentclass[book,numbers]{elsbook-A07b} \usepackage{amsmath,amssymb,amsfonts,amsthm,makeidx,graphicx} \usepackage{txfonts} \usepackage{helvet} – Amin R. Nov 28 '16 at 10:21
  • Another option is to import \nu from Computer Modern. See the middle two lines of this answer: tex.stackexchange.com/a/435722/98394. – Gavin R. Putland Oct 23 '18 at 9:05
14

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

enter image description here

Output with the \AtBeginDocument line uncommented

enter image description here

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}

enter image description here

  • Thank you! It solved the issue. Should I use \AtBeginDocument{\mathcode`v=\varv} for the case that you suggested in the comments? – Amin R. Nov 28 '16 at 11:18
  • @AminR. No, with newtx, you just pass the option varvw (that also changes the w to be similar to v). – egreg Nov 28 '16 at 11:23
  • it complains that: 'varvw' undefined in families 'ntxmath'. – Amin R. Nov 28 '16 at 11:29
  • 3
    @AminR. Update your TeX distribution. The option was added in October 2016. – egreg Nov 28 '16 at 11:40
9

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}

enter image description here

  • 1
    As @egreg noticed, the [varvw] option to newtxmath does that also. You are never too old to learn something new. – Pieter van Oostrum Nov 28 '16 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.