12

How would I change equation font in the \begin{equation} environment to Times? For instance, I use this code in LaTeX:

    \begin{equation}
    \begin{split}
    {L_{CML}}\left( \theta  \right) &= \,\Biggl( {\prod\limits_{g = 1}^{QSJ - 1} {\prod\limits_{g' = g + 1}^{QSJ} {P\left( {{{\left[ y \right]}_g} = {{\left[ m \right]}_g},{{\left[ y \right]}_{g'}} = {{\left[ m \right]}_{g'}}} \right)} } } \Biggr)\\
    &= \Biggl( {\prod\limits_{g = 1}^{QSJ - 1} {\prod\limits_{g' = g + 1}^{QSJ} {\,\,\,\Biggl[ \begin{split}
    \,\,\,{\Phi _2}({{\tilde \vartheta }_g},{{\tilde \vartheta }_{g'}},{\nu _{gg'}}) - {\Phi _2}({{\tilde \vartheta }_g},{{\tilde \phi }_{g'}},{\nu _{gg'}})\\
     - {\Phi _2}({{\tilde \phi }_g},{{\tilde \vartheta }_{g'}},{\nu _{gg'}}) + {\Phi _2}({{\tilde \phi }_g},{{\tilde \phi }_{g'}},{\nu _{gg'}})
    \end{split} \Biggr]} } } \Biggr),
    \end{split}
    \end{equation}

I'm currently facing the following issues:

  1. The equations are in cmr font. How to make it Times New Roman only for the equation environment? When I use \usepackage{times} outside the entire document font gets changed.
  2. I cannot bold and italicize certain elements at once. Also, the Greek letters like nu in the equation cannot be bold and italicized at once.
  3. How can I undo the centering of the equation environment? Can it by any chance be made left aligned?
  4. How can I make the equations more compact? I find that certain equations which sits nicely in Word when I use MathType overflows the paragraph limits in LaTeX.

I use the amsmath package for the equations.

4
  • 2
    your question sounds like you don't want to change the fonts for in-line math, only for displays. is this true? (it's not a good idea to have two different font styles for the same expressions.) please clarify. Aug 16, 2012 at 14:40
  • 1
    Welcome to TeX.sx! As well as the main question (about the font), you have several 'secondary' questions here. The TeX-sx format works best with one question per post, so it would be handy if you could edit this one to focus on the font issue then post other (perhaps linked) questions on the other issues.
    – Joseph Wright
    Aug 16, 2012 at 14:43
  • @barbarabeeton I would like the same style for all the math in the document. Not just the equation environment.
    – sriramn
    Aug 16, 2012 at 15:16
  • @JosephWright I feel that Mico addressed all my questions. Though, I do agree with you that the questions might have been a bit all over the place. Henceforth I will post more focused questions. And thank you - TeC.sx is really an awesome resource pool and forum - glad to be a part of it!
    – sriramn
    Aug 16, 2012 at 15:19

2 Answers 2

11

Addressing your questions in turn:

  1. To change only the math-mode font, while leaving the text-mode font unchanged (cmr, right?), you could load either the newtxmath package or the mtpro2 (short for MathTime Professional II) package. (Note that the latter package isn't free; however, a subset of the fonts, called the "lite" set, provides basic lettering capabilities -- but not "fancy" math fonts such as fraktur, caligraphic, curly, and blackboard bold styles -- and is free.) The mtpro2 font features "optically sized" glyphs for first-level sub- and superscript materials (aka "scriptstyle"-level materials).

    • Separately, if you happen to use LuaTeX or XeTeX, you may want to give the "XITS Math" font package a try.
    • If you happen to be a font purist: be aware that these font packages technically give you Times Roman, not Times New Roman. And if you're not a font purist? You may be excused for not noticing any differences -- they are are quite subtle.
  2. In math-mode, be careful about making some symbols both bold and italics. In mathematics, each font shape and weight is generally understood to impart some special meaning. For sure, do not combine bolding and italics just for emphasis. Both newtxmath and mtpro2 provide methods for changing the slant of both lowercase and uppercase greek letters.

  3. To make all displayed equations be set flush-left rather than centered, use the document class option fleqn.

  4. How to set the contents of equations more compactly? Aaah, some would opine that MS Word's math mode is far too compact, leading to frequent overlaps of letters on the baseline and those in superscript or subscript position. Good news for you: Both newtxmath and mtpro2 render math expressions more compactly than does TeX's default math font (Computer Modern).

Putting these things together and simplifying some of your math code along the way leads to the following modified form of your MWE. The main substantive changes I've made are to replace the equation environment with an align environment and to replace the inner split environment with a bmatrix environment.

\documentclass[fleqn]{article}
\usepackage{amsmath}
\newcommand\QSJ{\mathit{QSJ}} % define a couple of acronyms
\newcommand\CML{\mathit{CML}}
\usepackage{newtxtext,newtxmath}
\begin{document}
\begin{equation}
\begin{split}
L_{\CML}( \theta ) 
&= \Biggl(\, \prod_{g  = 1}^{\QSJ - 1} 
             \prod_{g' = g + 1}^{\QSJ} 
      P\left( [ y ]_g = [ m ]_g,\ [ y ]_{g'} = [ m ]_{g'} \right)  
   \Biggr)\\
&= \Biggl(\, \prod_{g  = 1}^{\QSJ - 1} 
             \prod_{g' = g + 1}^{\QSJ} 
   \begin{bmatrix}
   \phantom{-}\Phi_2 ({\tilde \vartheta }_g,{\tilde \vartheta }_{g'},\nu_{gg'}) 
          - \Phi_2 ({\tilde \vartheta }_g,{\tilde \phi }_{g'},\nu _{gg'})\\
          - \Phi_2 ({\tilde \phi }_g,{\tilde \vartheta }_{g'},\nu _{gg'}) 
          + \Phi_2 ({\tilde \phi }_g,{\tilde \phi }_{g'},\nu _{gg'})
   \end{bmatrix} \Biggr)
\end{split}
\end{equation}
\end{document}

enter image description here


For comparison, here's how the equations look like if the times (for text font) and mtpro2 (for math font) packages instead of the newtxtext and newtxmath packages. The overall look is very similar, but the output produced with help of the newtxmath package is a bit more compact.

enter image description here

3
  • this method will change the math fonts for in-line as well as display math. Aug 16, 2012 at 14:38
  • Wow Mico! That pretty much addresses all my issues. Thanks for the detailed answer. The acronym definitions were a neat trick to improve the readability of the code. Thank you again!
    – sriramn
    Aug 16, 2012 at 15:20
  • @barbarabeeton -- I was aware of this issue when I wrote up my answer. I had interpreted the OP's question to pertain to all math mode material and not just material typeset in displaymath mode. Fortunately, my interpretation seems to have been the OP's as well. :-)
    – Mico
    Aug 17, 2012 at 16:28
8

You can use a package that loads times for math mode, for example mathptmx, txfonts or the new newtxfont (for the last one, for the text use \usepacakge{newtxtext} and for the math \usepackage{newtxmath}.

For bold math use \usepackage{bm} and then \bm{} for the part you want in bold.

To left align equations use the fleqn option of the amsmath package, i.e., \usepackage[fleqn]{amsmath}.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .