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?

Corentin
  • 9,981
Romstar
  • 559

3 Answers3

4

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.

Werner
  • 603,163
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

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}
  • and newtxmath is not a patchwork? –  Nov 08 '12 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 08 '12 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. – Philippe Goutet Nov 08 '12 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 08 '12 at 19:46
  • I found that \boldmath and \unboldmath work here. – Romstar Nov 08 '12 at 20:04