Fonts & Character SetsFourier fonts and siunitx-package

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
oyvist
Posts: 4
Joined: Tue Apr 14, 2009 11:42 am

Fourier fonts and siunitx-package

Post by oyvist »

Hi. I am experiencing a rather bizarre problem when I use a combination of the siunitx-package and fourier fonts.

Here is some minimal code that reproduces the problem (it happens both with pdflatex and latex. I'm using Miktex 2.7 btw):

Code: Select all

\documentclass{isblabx}

\usepackage{fourier}
\usepackage{siunitx}

\begin{document}
\section{Hello $x_\mathrm{a}$}
$x_\mathrm{a}$.\\
%\SI{60}{dB}.60dB\\
\end{document}
And here is the the isblabx.cls file:

Code: Select all

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{isblabx}[2009/02/01 v0.1
Lab document class]

\LoadClass[12pt]{article} % based on the article class

\AtBeginDocument{
\tableofcontents
}
What happens is that the subscript 'a' in x_\mathrm{a} is differently typeset in the table of contents and the remainder of the document. Typesetting of units with the \SI-command also looks odd (try removing the comment). Make any number of changes to the above code and the problem disappears:
  • If I move the \tableofcontents command out of the cls-file and into the main document, the problem disappears.
  • If I remove \usepackage{fourier} the problem disappears.
  • If I remove \usepackage{siunitx} the problem disappears.
  • If I remove \mathrm from the section heading (though I can use it everywhere else) the problem disappears.

I have tried to make a more minimal example, but if I drop the class-file and use article instead, the problem disappears.

I'll try to sum this up:
The problem appears in subscripts typeset with mathrm and in \SI-commands (from the siunitx-package) everywhere in the document if and only if (well, I think):
the siunitx-package is used
AND the fourier-package is used
AND the \tableofcontents is put in an external class-file
AND \mathrm occurs at least once in a subscript in a sectioning command

Does anyone have the faintest clue what is going on here?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Fourier fonts and siunitx-package

Post by josephwright »

Yes, me (I write siunitx!). This seems to be down to the method I currently use to ensure that there is an upright mu available. I emulate the way the upgreek package works, but obviously I'm missing a bad interaction (or one of fourier and upgreek do something to avoid it).

A temporary fix seems to be to load the upgreek package itself, as then my emulation bails out and all seems to be fine. I'll look at this later today, and expect to have a fix with CTAN by the end of the day.
Joseph Wright
oyvist
Posts: 4
Joined: Tue Apr 14, 2009 11:42 am

Re: Fourier fonts and siunitx-package

Post by oyvist »

Ah. Very good. I really like siunitx, but have wondered about the upright mu--it doesn't look quite 'native' in any typeface I've seen. Is there no 'definitive' version of this letter?

As a temporary (or perhaps permanent) fix, I changed from fourier to \usepackage[utopia]{mathdesign}, which worked. With the naked eye I cannot tell the difference between these two, on my screen at least. Is there any reason to prefer one over the other?

Thanks for the help!
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Fourier fonts and siunitx-package

Post by josephwright »

Fixed version 1.2m just uploaded to CTAN.
oyvist wrote:Ah. Very good. I really like siunitx, but have wondered about the upright mu--it doesn't look quite 'native' in any typeface I've seen. Is there no 'definitive' version of this letter?
Computers Modern doesn't have upright lower-case Greek letters. Currently, I use the Euler font ones, as almost all TeX systems will have these installed (they are part of the AMS bundle). If one day the base font moves to Latin Modern then I'll have something better available!
Joseph Wright
Post Reply