## LaTeX forum ⇒ Fonts & Character Sets ⇒ mathptmx + math environment

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
CDbile
Posts: 19
Joined: Mon Jan 31, 2011 6:48 pm

### mathptmx + math environment

Hello everybody,

Reading l2tabu, I found out that the package "times" I used was obsolete, and so I began to use mathpmx / helvet / courier.

But, any time I put a math env. in my document, pdflatex does not compile, and I get 0 pages, and no errors / warnings too.

Here is my sample code :

\documentclass{article} \usepackage[english]{babel}\usepackage[latin1]{inputenc}\usepackage[T1]{fontenc} \usepackage{mathptmx}\usepackage[scaled=0.90]{helvet}\usepackage{courier} %\usepackage{amsmath} % With or without, doesn't change anything \begin{document}$1$ % Or any other env.: \(, \[, displaymath, equation\end{document}

However, when there is no math env in my document, I don't encounter any problem and get my pages as I should do (e.g. if I remove the dollars in the sample code I will get a page with a "1", *in the Time font* (as far as I can judge)).

Any idea ?
(I use TeXnicCenter & MiKTeX 2.8 in Windows 7 Pro x64)
Last edited by CDbile on Tue Feb 01, 2011 8:06 pm, edited 1 time in total.
CDbile

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
I don't get any errors compiling that code. (I'm using TeXlive 2010 on GNU/Linux, but I don't see why that should matter.)

Could you add \listfiles to the beginning of the code, and then post the .log file that is generated when you compile this here?

Another thing to try would be the txfonts package, which would set the text/math font to Times, the sans font to Helvetica and the typewriter font to Courier with one package.

CDbile
Posts: 19
Joined: Mon Jan 31, 2011 6:48 pm

Here is the file list :

*File List*
article.cls 2005/09/16 v1.4f Standard LaTeX document class
size10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
babel.sty 2008/07/06 v3.8l The Babel package
bblopts.cfg 2006/07/31 v1.0 MiKTeX 'babel' configuration
english.ldf 2005/03/30 v3.3o English support from the babel system
inputenc.sty 2006/05/05 v1.1b Input encoding file
latin1.def 2006/05/05 v1.1b Input encoding file
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
mathptmx.sty 2005/04/12 PSNFSS-v9.2a Times w/ Math, improved (SPQR, WaS)
helvet.sty 2005/04/12 PSNFSS-v9.2a (WaS)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
courier.sty 2005/04/12 PSNFSS-v9.2a (WaS)
t1ptm.fd 2001/06/04 font definitions for T1/ptm.
***********

Note that I had to remove my math environments in the body to produce the file list : it seems that, when there is a math env in the body, LaTeX doesn't want to produce anything.

I'm going to try your other solution, but I'm interested in solving this problem too, because I may want to change the sf or tt font, and loading several fonts for the same usage doesn't seem very useful... And because it's an interesting problem too !
CDbile

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

I don't see it attached. Could you try again? (You may need to rename it or put it in a .zip file for the forum to accept it; not sure.) And actually, if a partial .log is created (even without the file list) when you try to compile the document with math environments, it would be worth seeing that too. I wonder if it's possible that you're encountering the problem mentioned here, for example.

Here's my file list, by the way. I am using some newer stuff, but actually not from the packages that would seem more likely to generate this problem. (I expect the few things I have but you don't relate to fonts in math mode.)

  *File List*  article.cls    2007/10/19 v1.4h Standard LaTeX document class   size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)    babel.sty    2008/07/06 v3.8l The Babel package  english.ldf    2005/03/30 v3.3o English support from the babel systeminputenc.sty    2008/03/30 v1.1d Input encoding file   latin1.def    2008/03/30 v1.1d Input encoding file  fontenc.sty    t1enc.def    2005/09/27 v1.99g Standard LaTeX filemathptmx.sty    2005/04/12 PSNFSS-v9.2a Times w/ Math, improved (SPQR, WaS)    helvet.sty    2005/04/12 PSNFSS-v9.2a (WaS)    keyval.sty    1999/03/16 v1.13 key=value parser (DPC)  courier.sty    2005/04/12 PSNFSS-v9.2a (WaS)     t1ptm.fd    2001/06/04 font definitions for T1/ptm.ot1ztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OT1/ztmcm.omlztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OML/ztmcm.omsztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMS/ztmcm.omxztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMX/ztmcm.   ot1ptm.fd    2001/06/04 font definitions for OT1/ptm.

CDbile
Posts: 19
Joined: Mon Jan 31, 2011 6:48 pm
Hmm, sorry for the log, didn't see I had to click on "Add the file"...

So, the only differences are the files :

ot1ztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OT1/ztmcm.omlztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OML/ztmcm.omsztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMS/ztmcm.omxztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMX/ztmcm.   ot1ptm.fd    2001/06/04 font definitions for OT1/ptm.

After a quick check, I found them on my computer (in C:\Program Files (x86)\MiKTeX 2.8\tex\latex\psnfss which corresponds to texmf/tex/latex/psnfss), so can there be any reason why these files are not loaded in my case ?

Edit: and there is no "GUI framework cannot be initialized", so it's not one of the big known issues (but I'm going to browse this site, just in case...)

EDIT 2: Well, you may have been right for the MiKTeX / TeXnicCenter compatibility... I tried to compile the file with pdflatex in command-line and got a request for installing a new package...

So, now that works ! Problem's solved. Thank you very much for your time !
CDbile

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
Those aren't the only differences -- look at the dates of the other files. Still, I doubt that's the issue.

Anyway, those are font definition files related to math mode, so it makes sense that they're not loaded in withoutmathenv.log -- they aren't loaded for me either if I take out the math environment. Even without the list at the end, you can tell from withmathenv.log that they are loaded in that attempt, indeed they're mentioned right near the end.

I guess the problem could be that there's something wrong with those files, but I wouldn't jump to that conclusion. The log doesn't show any errors when trying to load them. It just seems to cut out while typesetting the first page. Do you know what happens exactly? Does it hang while compiling? Are you manually ending the compilation midway through? Or does it just crash there or something? That's very strange behavior. You might try running latex on the file from the command prompt and watch it while it happens to see if it hangs, or crashes or what...

I guess you could try forcibly reinstalling the psnfss package in the MikTeX package manager and see if that helps. I'm not sure though.

Another diagnostic step you also might try would be to try the txfonts package just to see if it generates the same error (--I'm guessing it will, but...)