8

I'm having a slight problem with siunitx and fontencwith T1 encoding (I write a lot in Swedish and most people suggest that I should use T1). When I compile to PDF with \usepackage[T1]{fontenc} the numbers put in with the \SI command are printed bolder than the rest of the text. This really makes them stand out from the rest of the text and it does not look good. If I remove \usepackage[T1]{fontenc} this does not happen. A minimum example:

\documentclass[11pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{siunitx}

\begin{document}
\section{Example}
The power was \SI{150}{\watt} \\
The power was 150 W
\end{document}

I'm using TeXworks on win7. The problem cannot really be seen in the TeXworks preview, but in Adobe Reader it can be seen clearly. Anyone know why this happens or can suggest a workaround?

David Carlisle
  • 757,742
Johan
  • 83
  • I can't reproduce this, it looks fine both in TeXmaker and in Adobe Reader. Are you using pdflatex to compile your file? – Jake May 22 '12 at 20:13
  • Yes, I'm using pdflatex to compile. – Johan May 22 '12 at 20:16
  • 1
    Does the same happen if you load \usepackage{lmodern}? – egreg May 22 '12 at 20:18
  • With \usepackage{lmodern} added to the example above the output looks fine. I haven't used Latin modern or any other special font previously but I guess I will have to try it now. – Johan May 22 '12 at 20:38
  • What fonts are listed at the end of the log file if you don't use lmodern? – Ulrike Fischer May 22 '12 at 21:25
  • @UlrikeFischer What does that line look like? – Johan May 22 '12 at 21:38
  • @Johan It's a common problem: you don't have the Type1 version for the T1 encoded Computer Modern fonts. Download the CM-Super package (or use Latin Modern fonts as already suggested). – egreg May 22 '12 at 22:30
  • Ok, now I know how I can solve this. Thanks for all the help. – Johan May 22 '12 at 23:23
  • Can someone write up a canonical answer, since it seems to be a problem that has happened before? – Canageek May 23 '12 at 03:37

1 Answers1

10

Adding \usepackage[T1]{fontenc} to your preamble is a good thing, but sadly it will load a bitmap font by default. To fix this, you should install the cm-super package or load a vector font (for example lmodern or libertine). Adding microtype will make the type face a little nicer.

No longer a minimum example, but here is how I would suggest to alter your document:

\documentclass[11pt,a4paper]{article}

\usepackage{siunitx}

\usepackage[utf8]{inputenc}
\usepackage[swedish]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[babel=true]{microtype}

\begin{document}
\section{Example}
The power was \SI{150}{\watt} \\
The power was 150 W. \\
Björkö is close to Göteborg, kind of.
\end{document}
David Carlisle
  • 757,742
matth
  • 12,381