7

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?

  • 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
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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.