Fonts & Character SetsSelective use of T1 font encoding

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Selective use of T1 font encoding

Post by php1ic »

I have a fraction within a sum so want to enlarge the size of the summation symbol which I can do with a \scalebox as so

Code: Select all

\documentclass[a4paper,11pt]{report}

\usepackage{graphicx}
%\usepackage[T1]{fontenc}
%\usepackage{mathptmx}
%\usepackage[scaled=.90]{helvet}
%\usepackage{courier}

\def\Sum{\ensuremath\mathop{\scalebox{2}{$\displaystyle\sum$}}}

\begin{document}

\[
\frac{1}{N}\sum_{n=1}^{N} \frac{\left(m_{\eta}-\tilde{m}{_{\eta}}\right)^{2}}{\Big(\sigma_{m_{\eta}}\Big)^{2} + \Big(\sigma_{m}^{syst}\Big)^{2} + \left(\sigma_{m_{\eta}}^{stat}\right)^{2}} = 1
\]

\begin{equation}
\frac{1}{N}\Sum_{n=1}^{N} \frac{\left(m_{\eta}-\tilde{m}{_{\eta}}\right)^{2}}{\Big(\sigma_{m_{\eta}}\Big)^{2} + \Big(\sigma_{m}^{syst}\Big)^{2} + \left(\sigma_{m_{\eta}}^{stat}\right)^{2}} = 1
\end{equation}

\end{document}
to get
No T1 font encoding
No T1 font encoding
bigsumT1no.png (29.39 KiB) Viewed 3887 times
However, when I uncomment the T1 encoding I get
With T1 encoding
With T1 encoding
bigsumT1yes.png (28.1 KiB) Viewed 3887 times
I prefer the look of the large summation that is drawn without T1 encoding, but don't want to not have it for the entire document.

Is there a way to selectively turn off the encoding for a single symbol, or does anybody know of a better way to create a large summation size.

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Selective use of T1 font encoding

Post by frabjous »

From what I can tell, the difference between those is not the font encoding, but the font. The top one is using the default Computer Modern font; the bottom one appears to be using the mathptmx (Times) fonts, at least for the summation sign. (I can't duplicate your results entirely; in particular, it's obscure to me why the variables in the bottom example appear simply slanted rather than in true italics, but but you didn't say what output routine you were using or what viewer you were using.)

You must have uncommented the mathptmx line too, right?

Do you have your heart set on using Times fonts elsewhere? If not, you can leave the T1 fontenc line in but not use mathptmx, or perhaps, replace it with the lmodern package, which will preserve the look of the Computer Modern fonts but with more modern encoding.
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Re: Selective use of T1 font encoding

Post by php1ic »

Thanks for the response. I made the pdf using latex->dvips->ps2pdf, the viewer was acrobat reader, but it looks the same with xpdf and yes, I did uncomment the mathptmx line.

You are right, it is the mathptmx package, if I use lmodern it looks like the top example, but of course all of the other text also changes.

I don't particularly have any preference for font, I found this website for creating high quality pdfs
http://dsanta.users.ch/resources/type1.html
then altered the obsolete pslatex package according to
http://ctan.org/pkg/l2tabu

I think I'll have to print out a few pages with both fonts to see which I prefer generally.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Selective use of T1 font encoding

Post by frabjous »

Well if you wanted a Times-looking font for the body text, and Computer/Latin modern for stuff in math mode, you could use the TeX Gyre Termes package:

\usepackage[T1]{fontenc}
\usepackage{tgtermes}

There are also some fairly easy ways using the mathspec and XeLaTeX for getting the variables in mathmode to be in Times as well, leaving all the symbols in Computer/Latin modern, though I find that to be uglier. If you want everything in Times except for that one symbol--well, I'm pretty sure that can be done too, but I don't know how offhand.
Post Reply