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.

I've read that the newtxtext and newtxmath packages are preferable to times, txfonts and mathptmx, at least for use with pdfTeX. I'm in the process of writing a paper where some measurements are given in microns (µm). Unfortunately, the \textmu (as well as \micro in siunitx) is replaced with a Computer Modern replacement.

Example:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{newtxtext}
\usepackage{newtxmath}

\usepackage{textcomp}

\begin{document}

This is 10\textmu m.

\end{document}

In the compilation process, I see this:

LaTeX Font Warning: Font shape `TS1/ntxrx/m/n' undefined
(Font)              using `TS1/cmr/m/n' instead
(Font)              for symbol `textmu' on input line 12.

and LaTeX Font Warning: Some font shapes were not available, defaults substituted.

This seems to happen with the \textohm command as well (and perhaps others I'm not using). It looks particularly bad in bold text. txfonts seems to produce output (though the mu symbol isn't quite as nice as it is with mathptmx). Using mathptmx causes compilation to fail with \textohm. Arg.

I'm wondering if there is some trick that I'm not aware of for getting \textmu (or \micro from siunitx) to work with these packages. I'm using version 1.07 of newtxtext, dated Dec 25, 2012.

Thanks.

share|improve this question
    
With \upmu you get the symbol you want. –  Manuel Feb 10 '13 at 21:36
    
To use \upmu, it seems like I have to enter math mode, which then ignores the text formatting (like bold), which doesn't seem ideal (especially for use with siunitx, for example). –  Tyler Feb 10 '13 at 21:39

1 Answer 1

up vote 5 down vote accepted

You can correct the wrong behavior with

\usepackage{textcomp}
\renewcommand{\textmu}{\ensuremath{\upmu}}
\renewcommand{\textOhm}{\ensuremath{\upOmega}}

However, newtx{text,math} don't have companion fonts in the TS1 encoding, so you might receive that warning for other symbols.

For usage with siunitx, just change the relevant settings:

\usepackage{siunitx}
\sisetup{math-micro=\upmu,text-micro=\ensuremath{\upmu},
         math-ohm=\upOmega,text-ohm=\ensuremath{\upOmega}}

With some more work, you can have a version of \textmu and \textohm that respect also boldface:

\makeatletter
\DeclareRobustCommand{\textmu}{{\usefont{U}{ntxmia}{\f@series}{it}\symbol{\string"16}}}
\DeclareRobustCommand{\textohm}{{\usefont{U}{ntxmia}{\f@series}{it}\symbol{\string"0A}}}
\makeatother
\sisetup{math-micro=\upmu,text-micro=\textmu,
         math-ohm=\upOmega,text-ohm=\textohm}

Italic is not supported, sorry; if you really need it, something could be done.


Update 2013-02-15

The last revision (version 1.08) of the newtx bundle provides the font definition files for the TS1 encoding in the family ntxrx, so the original example works and no workaround is needed any more. From the README file:

Changes in version 1.08:
All corrections affect only the Times mode in text and math.
1. Fixed problems with vector glyph in math italic.
2. Added missing file ts1ntxrx.fd.
3. Corrected problems in regular and bold math italic in sizes under 10pt.

share|improve this answer
    
The siunitx setup works well, though the renewed commands will ignore bold formatting (for example). But since I use everything with siunitx, it doesn't bother me too much. Thanks. –  Tyler Feb 10 '13 at 21:53
    
@Tyler Here it is. :) –  egreg Feb 10 '13 at 21:56
    
Ah, very nice. Don't worry about the italics, I don't need them at all. :) Thanks a lot! –  Tyler Feb 10 '13 at 22:01

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.