Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How to change the text font in a document to "Times" and keep the font for equations unchanged (i.e Computer Modern)?

share|improve this question
2  
Welcome to TeX.sx! –  texenthusiast Mar 11 '13 at 3:37
    
for more text and math font choices xelatex and lualatex would be well suited compared to pdflatex –  texenthusiast Mar 11 '13 at 4:45
    
As it stands this question is too vague. We assume by default you are using LaTeX, but which engine are you using? which fonts would you like to use? As wasteofspace explains below, there are many packages for fonts, some only change the text. –  Andrew Swann Mar 11 '13 at 12:44

2 Answers 2

up vote 2 down vote accepted

One thing I like to do, which might be related to what you want, is to put this in my header:

\renewcommand{\rmdefault}{ptm}

It changes all my body text to Times, but is not the same as

\usepackage{times}

because it doesn't change the typewriter font to Courier, and it doesn't change the sans-serif font to Helvetica; it leaves both of those as the standard Computer Modern versions.

share|improve this answer
3  
without a minimal example, we don't know what you are doing to cause the effect you want to avoid. note that, by default, text and maths use different fonts, anyway; some text font packages change both at the same time, but without an example we can't guess what you are after. –  wasteofspace Mar 11 '13 at 10:53
    
I wanted to change the font for all the text in the document to Times, except for the default font used for equations which I wanted to remain in Computer Modern. The answer by John Wickerson does exactly that. Thanks and sorry for not having been very explicit. –  Ultimabstract Mar 12 '13 at 4:57

This is the XeLaTeX version using fontspec package:

\documentclass{article}
\usepackage[no-math]{fontspec}
\setromanfont{Times}
\begin{document}
    Whatever
\end{document}

In General, the current font depends on some parameters such as 'size', 'family', 'series', and 'shape'. For example, if one says \sffamily, LaTeX will try to change the current font family to sf (stands for 'sans serif') with other parameters unchanged: same size, same series, and same shape.

But before LaTeX changes the current font, LaTeX need to know the exact font family you want. (Since 'sans serif' is not really a font family but more like 'description' about fonts.) This information is stored in \sfdefault. Similarly \rmdefault and \ttdefault contain informations for \rmfamily and \ttfamily.

Therefore editing it by \renewcommand\rmdefault{blahblahblah} results the current font being changed. The good news is that the preceding mechanism affects only the body texts of your document. There is another mechanism designed for math mode. Hence the trick work: math font unchanged.

The bad news is that font packages for body texts sometimes change the math font simultaneously. This makes your document looks more compatible. So fontspec also changes the math font when \setromanfont is design for body texts. And I need to pass [no-math] to stop it.

Update

under this answer Mico mentioned another bad news: Some fonts are named different on different system. For example Times, Times Roman, Times-Roman, and Times New Roman. It is difficult to tell whether it is a font with nicknames or they are different font looks undistinguishable. So PLEASE DOUBLE CHECK font names whenever you want to try new fonts.

share|improve this answer
    
You may want to mention that -- depending on the computer system and the naming convention for fonts -- it may be necessary to specify Times Roman or Times New Roman rather than "just" Times to make this font the main text font. –  Mico Sep 17 at 7:03
    
@Mico The naming convention makes me sick. But in your case, I think Times and Times New Roman are different fonts? –  Symbol 1 Sep 17 at 7:07
    
There's not much anyone can do about the multitude of names under which a given font (or a close clone of the font) may be known. All you can do, I'm afraid, is point out that a given font may have different names on different systems. (There are some slight differences between Times Roman and Times New Roman, but most people will have a hard time detecting them.) –  Mico Sep 17 at 8:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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