9

I'm using \usepackage{mathptmx} to use times new roman font in math. But I can't make the font bold by using \boldmath, which works fine with default computer modern font.

I'm using \renewcommand{\rmdefault}{ptm} to use times new roman for the whole document.

How to get bold times new roman font in math so that it blends well with other text?

1
  • Welcome to TeX.sx! A tip: You can use backticks ` to mark your inline code. Also, it would be great if you could add a minimal working example (MWE) that illustrates your problem. It is considered a lot better to put in some code that will compile, as it makes it a lot easier for us to copy it into our text editor and work with it, and see exactly what it is you are trying to do.
    – Corentin
    Nov 8, 2012 at 16:25

3 Answers 3

4

The mathptmx package is not the best way to load the times font as the fonts are both incomplete and a patchwork of symbols from different sources.

Among the free fonts, you best choice today is probably newtx (alternatively, on older distributions, you have txfonts, but they have some spacing problems):

enter image description here

\documentclass{article}

\usepackage{newtxtext}
\usepackage{newtxmath}

\begin{document}

$y = f(x)$

$\mathbf{y=f(x)}$

{\boldmath$y=f(x)$}

\end{document}
5
  • and newtxmath is not a patchwork?
    – user2478
    Nov 8, 2012 at 18:41
  • Does it change font of non-math text? I'm using \renewcommand{\rmdefault}{ptm} to set default font to times new roman.
    – Romstar
    Nov 8, 2012 at 19:35
  • @user21916: if you only want to change the math, then don't load newtxtext. But the text fonts are more complete than ptm (they have real small caps), so it's probably a good idea to load both packages. Nov 8, 2012 at 19:38
  • I have a lot of tables, in the header row of every table there are many math stuff. Is there a way to turn on math bold universally? something like \boldmath and \unboldmath
    – Romstar
    Nov 8, 2012 at 19:46
  • I found that \boldmath and \unboldmath work here.
    – Romstar
    Nov 8, 2012 at 20:04
4

there are no free math fonts for Times in Type 1 format. However, use the new OpenType font TeX Gyre Pagella Math with xelatex or lualatex

\documentclass{article}

\usepackage{unicode-math}
\setmainfont{TeX Gyre Termes}
\setmathfont[bold-style=TeX]{TG Termes Math}
\begin{document}

Times are gonna change \ldots

$y=f(x)$
$\mathbf{y=f(x)}$

\end{document}

enter image description here

If the bold letters should also be in italic use

\setmathfont[bold-style=ISO]{TG Termes Math}
4
  • 1
    the mathtime pro 2 lite fonts are (a) times-based, (b) pretty satisfactory for general user, and (c) free. they're not on ctan (in principle they could be withdrawn at any time) but they seem a good bargain to me (i don't write maths any more...) Nov 8, 2012 at 17:05
  • the lite version has no bold symbols
    – user2478
    Nov 8, 2012 at 17:26
  • Thanks for the solution but I didn't manage to set up XeLaTeX or LuaLaTeX in my Linux box
    – Romstar
    Nov 8, 2012 at 20:06
  • Can someone help me to get the NFSS name of "mathtime pro 2" upright bold font?
    – Eric
    Jul 2, 2018 at 13:18
3

Use \mathbf{..} instead of {\boldmath ..}. The following minimal example

enter image description here

\documentclass{article}
\usepackage{mathptmx}% http://ctan.org/pkg/mathptmx
\DeclareMathAlphabet{\mathbfit}{T1}{ptm}{b}{it}
\showoutput
\begin{document}
aaa\textbf{aaa}\textbf{\textit{aaa}}
$aaa \mathbf{aaa} \mathbfit{aaa}$
\end{document}

lists the output fonts as

Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
.\glue 16.0
.\vbox(617.0+0.0)x345.0, shifted 62.0
..\vbox(12.0+0.0)x345.0, glue set 12.0fil
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x345.0
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 539.77744fil
...\write-{}
...\glue(\topskip) 5.27003
...\hbox(4.72997+0.16492)x345.0, glue set 239.18018fil
....\hbox(0.0+0.0)x15.0
....\OT1/ptm/m/n/10 a
....\OT1/ptm/m/n/10 a
....\OT1/ptm/m/n/10 a
....\kern 0.0
....\OT1/ptm/b/n/10 a
....\OT1/ptm/b/n/10 a
....\OT1/ptm/b/n/10 a
....\kern 0.0
....\OT1/ptm/b/it/10 a
....\OT1/ptm/b/it/10 a
....\OT1/ptm/b/it/10 a
....\kern 0.0
....\glue 2.5 plus 1.49998 minus 0.59998
....\mathon
....\OML/ztmcm/m/it/10 a
....\OML/ztmcm/m/it/10 a
....\OML/ztmcm/m/it/10 a
....\hbox(4.72997+0.13994)x15.0
.....\OT1/ptm/b/n/10 a
.....\OT1/ptm/b/n/10 a
.....\OT1/ptm/b/n/10 a
....\hbox(4.555+0.13495)x15.0
.....\T1/ptm/b/it/10 a
.....\T1/ptm/b/it/10 a
.....\T1/ptm/b/it/10 a
....\mathoff
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue 0.0 plus 1.0fil
...\glue 0.0
...\glue 0.0 plus 0.0001fil
..\glue(\baselineskip) 23.18011
..\hbox(6.81989+0.0)x345.0, glue set 170.0fil
...\glue 0.0 plus 1.0fil
...\OT1/ptm/m/n/10 1
...\glue 0.0 plus 1.0fil

As a reference, see Bold italic vectors.

7
  • running pdffonts <file>.pdf is a bit shorter ...
    – user2478
    Nov 8, 2012 at 17:45
  • how to have italic bold when using both mathptmx and mathbf?
    – Romstar
    Nov 8, 2012 at 19:43
  • Is it possible to make \mathbfit the default for math env?
    – Romstar
    Nov 8, 2012 at 19:58
  • As in all math is \mathbfit? Always?
    – Werner
    Nov 8, 2012 at 20:00
  • 1
    I found that your solution can only make a-z letters bold, other stuff like operators are not bold
    – Romstar
    Nov 8, 2012 at 20:20

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.