Text FormattingSlanted Font with the caption and siunitx packages

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
cbkschroeder
Posts: 55
Joined: Sun Nov 09, 2008 7:48 pm

Slanted Font with the caption and siunitx packages

Post by cbkschroeder »

Hello,

Thanks for reading my posting.

I'm using both the siunitx and caption packages; they are very good.

In the options I set for caption, I'd like to use the slanted "font=sl" font. This uses a slanted font in all my captions and works very well. The problem arises when I need to use a command like

Code: Select all

\SI{5}{\milli\meter}
from siunitx in that caption. The font which is used to typeset this number/unit combination is the same as the font in the rest of the text external to the captions. Using the detect-all=true option of the \SI command doesn't seem to help.

Does anyone have any thoughts as to how one might reasonably easily fix this problem, if, indeed, it is reasonably "fixable"?

Thanks for your time!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Slanted Font with the caption and siunitx packages

Post by josephwright »

Please post a minimal example, not just a snippet.
Joseph Wright
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Slanted Font with the caption and siunitx packages

Post by josephwright »

Actually, I can reproduce this. What's happening is that siunitx looks for italic but not for slanted shapes. I need to think about the best interface to deal with this: let me thing about it for a little while.
Joseph Wright
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Slanted Font with the caption and siunitx packages

Post by josephwright »

Will be fixed in upcoming v2.0o. Test example

Code: Select all

\documentclass{article}
\usepackage{caption,siunitx}
\captionsetup{font = sl}
\sisetup{detect-all}
\begin{document}
\begin{figure}
  \caption{Test \SI{5}{\milli\metre}.}
\end{figure}
\end{document}
Joseph Wright
cbkschroeder
Posts: 55
Joined: Sun Nov 09, 2008 7:48 pm

Re: Slanted Font with the caption and siunitx packages

Post by cbkschroeder »

Yes, your example nails it.

Thanks for being so responsive! I'll ask just so I know when I might see a change: do you know when 2.0o is coming through? Feel free to ignore that question; I'm not being passive aggressive! :roll:

Incidentally, if one could have a favorite package, siunitx would definitely be a candidate for me. It's really quite good.

Thanks again.
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Slanted Font with the caption and siunitx packages

Post by josephwright »

Uploaded to CTAN already. There will be a lag in it appearing in TeX Live 2010, as they are currently doing the release work. For MiKTeX, I guess a few days.
Joseph Wright
cbkschroeder
Posts: 55
Joined: Sun Nov 09, 2008 7:48 pm

Re: Slanted Font with the caption and siunitx packages

Post by cbkschroeder »

Amazing; thank you so much!!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Slanted Font with the caption and siunitx packages

Post by localghost »

Now that the problem is solved, please mark the topic accordingly as described in Section 3 of the Board Rules.
cbkschroeder
Posts: 55
Joined: Sun Nov 09, 2008 7:48 pm

Slanted Font with the caption and siunitx packages

Post by cbkschroeder »

Hi again,

Unfortunately, using your above MWE (and my document) I cannot report that the problem is solved.

I've just run the update wizard for MikTeX and it tells me I have no other updates, so that implies I'm good to go, I guess.

From my siunitx.sty file:
\ProvidesExplPackage {siunitx} {2010/07/21} {2.0o}
From my caption.sty file:
\ProvidesPackage{caption}[2010/01/09 v3.1m Customizing captions (AR)]
Attached is the output from my pdfLaTeX.

If you have any further insights regarding this, I would appreciate them.

Thanks,

Christian
Attachments
test.pdf
(21 KiB) Downloaded 397 times
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Slanted Font with the caption and siunitx packages

Post by josephwright »

I will investing further!
Joseph Wright
Post Reply