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 have to write a document in Times. Therefore I started writing it in TeX Gyre Termes, based on the note on Time's font page. However, I use PDFLaTeX, so I can't directly type Greek characters. So if I want to write isopropyl-1-thio-β-D-galactopyranoside I need to type isopropyl-1-thio-$\beta$-D-galactopyranoside.

However, this puts the beta as italic (Which I need anyway, not bad) but lists it in a different font then the surrounding text. I noticed that Times ( \usepackage{mathptmx} ) is listed as math-compatible, while TeX Gyre Termes is not, so I switched packages and lo and behold my beta now works.

However, I noticed that if you look through Termes technical documentation it lists it as having a beta, in normal, italic, bold and bold italic. (Character 03B2 on page 10, section 3. Standard other unicodes 0080 .. DFFF (actually in 00A0 .. uni2AB0))

Some examples with a MWE:

\documentclass[letterpaper,12pt]{article}
\usepackage{tgtermes}
\usepackage[T1]{fontenc}

\begin{document}
Hey, look, a $\beta$, that doesn't match the text. 
\end{document}

tgtermes with a non-matching beta

And a better looking example:

\documentclass[letterpaper,12pt]{article}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}

\begin{document}
Hey, look, a $\beta$, that better matches the text. 
\end{document}

A better looking beta from mathptmx

I thought \usepackage[utf8]{inputenc} would let me just type β and have it work, but no dice.

egreg also told me to try this:

\documentclass[letterpaper,12pt]{article}
\usepackage{tgtermes}
\usepackage[T1]{fontenc}
\usepackage{newunicodechar}
\newunicodechar{β}{\beta}


\begin{document}
Hey, look, a β that gives me gibberish
\end{document}

newunicodechar gives me gibberish

Which makes me wonder: 1) In what way is Termes better then Times if it isn't math-mode usable? 2) Can I use Times as my math-font and Termes as my body? 3) Can I get access to the 4 betas from Termes in PDFLaTeX?

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

A solution that integrates cgnieder's and rdhs's:

\documentclass[letterpaper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{mathptmx}
\usepackage{tgtermes,chemmacros}
\usepackage[artemisia]{textgreek}
\usepackage{newunicodechar}

\ExplSyntaxOn
\cs_new_protected:Npn \IfInIupac #1 #2
  { \bool_if:NTF \l_chemmacros_inside_iupac_bool {#1} {#2} }
\ExplSyntaxOff

\newunicodechar{β}{\IfInIupac{\Chembeta}{\ensuremath{\beta}}}
\newunicodechar{ᴅ}{\IfInIupac{\D}{\textsc{d}}}

\begin{document}

\iupac{isopropyl-1-thio-β-ᴅ-galactopyranoside}

\end{document}

enter image description here

Other equivalences can be defined similarly. If the upright beta is needed also in text, the best way is, in my opinion, not to use it in math at all and change the definition into

\newunicodechar{β}{\Chembeta}
share|improve this answer
    
In the standard setting of chemmacros \D is defined \textsc{D} in and outside of \iupac so \newunicodechar{ᴅ}{\D} should suffice. –  cgnieder Mar 25 '12 at 22:29
    
@cgnieder OK, but the same wouldn't be true for \L. A little overhead, but greater clarity. :-) –  egreg Mar 25 '12 at 22:35
    
True. (Need some more text to get the 15 full :) ) –  cgnieder Mar 25 '12 at 22:38
    
Ok, I get the beta, but how on earth do I copy and paste a smallcaps D? –  Canageek Mar 26 '12 at 17:16
1  
On another note: egreg, you finally pushed me over the edge and made me organize my \usepackage commands into sections. –  Canageek Mar 26 '12 at 17:21
show 2 more comments

Yes, you can use mathptmx for math and tgtermes for text; just load both packages. The "gibberish" example doesn't work because you didn't set the input to UTF-8. Here's the fix:

\documentclass[letterpaper,12pt]{article}
\usepackage{mathptmx}
\usepackage{tgtermes}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}
\newunicodechar{β}{\ensuremath{\beta}}
\newunicodechar{ᴅ}{\textsc{d}}

\begin{document}
isopropyl-1-thio-β-ᴅ-galactopyranoside
\end{document}

enter image description here

You could also use mtpro2 instead of mathptmx, for a lighter \beta with an upright option:

\documentclass[letterpaper,12pt]{article}
\usepackage{mtpro2}
\usepackage{tgtermes}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}
\newunicodechar{β}{\ensuremath{\beta}}
%\newunicodechar{β}{\ensuremath{\upbeta}}
\newunicodechar{ᴅ}{\textsc{d}}

\begin{document}
isopropyl-1-thio-β-ᴅ-galactopyranoside
\end{document}

enter image description here

The Symbol font (psy) provides a text-mode beta for Times, but it's only available in upright:

\documentclass[letterpaper,12pt]{article}
\usepackage{mtpro2}
\usepackage{tgtermes}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pifont}
\usepackage{newunicodechar}
\newunicodechar{β}{\Pisymbol{psy}{98}}
\newunicodechar{ᴅ}{\textsc{d}}

\begin{document}
isopropyl-1-thio-β-ᴅ-galactopyranoside
\end{document}

enter image description here

share|improve this answer
    
How would I get access to the other betas in Terms? Is that possible? –  Canageek Mar 25 '12 at 17:19
1  
@Canageek Not with (pdf)LaTeX, but only with XeLaTeX or LuaLaTeX. –  egreg Mar 25 '12 at 17:48
    
@Canageek The betas are in Termes's otf file, but not in the T1-encoded font available to pdftex. I'd think you could use the otf to make an LGR-encoded font which includes beta, and then switch to it using babel or such, as in this answer – but is it really worth that much effort? –  rdhs Mar 25 '12 at 17:51
    
If one loads babel, then \newunicodechar{β}{\textormath{{{\usefont{U}{psy}{m}{n}b}}}{\beta}} would give an upright beta in text mode. –  egreg Mar 25 '12 at 17:58
    
Probably not; I'll just leave it italic. I must say, the pain at using upright greek is really annoying, and probably the one place that TeX really gets its rear handed to it by Word. –  Canageek Mar 25 '12 at 18:20
add comment

Since IUPAC recommends an upright beta for such cases I'd probably just use the textgreek package.

From the IUPAC Green Book:

Greek leers are used in systematic organic, inorganic, macromolecular and biochemical nomenclature. These should be roman (upright), since they are not symbols for physical quantities.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tgtermes,chemmacros}
\usepackage[artemisia]{textgreek}

% this will activate \b (= beta symbol) in normal text, too, instead of only
% inside \iupac:
% \chemsetup[option]{iupac=strict}
\begin{document}

\iupac{isopropyl-1-thio-\b-\D-galactopyranoside}

\end{document}

enter image description here

share|improve this answer
    
To have textgreek use Symbol's beta: \def\textgreekfontmap{{qtm/*/*}{U/psy/*/*}} –  rdhs Mar 26 '12 at 9:16
    
@rdhs can you elaborate on this? What is the purpose/the benefit? –  cgnieder Mar 26 '12 at 11:20
    
Symbol's upright beta matches exactly the slanted beta from mathptmx, since Symbol was designed to match Times. –  rdhs Mar 26 '12 at 12:15
    
@rdhs But why should I want to use textgreek then in the first place? Seems like a detour to me. –  cgnieder Mar 26 '12 at 12:26
add comment

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.