Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
-
svend_tveskaeg
- Posts: 478
- Joined: Sun Jul 12, 2009 5:31 am
Post
by svend_tveskaeg »
Consider the following example.
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[
locale=DE
]{siunitx}
\begin{document}
\noindent Should I use
\[
\SI{38.0}{\cm} + 2 \cdot \SI{26.2}{\cm} + \SI{32.6}{\cm}
= \SI[parse-numbers=false]{(38{,}0 + 52{,}4 + 32{,}6)}{\cm}
= \SI{123.0}{\cm}.
\]
or
\[
\SI{38.0}{\cm} + 2 \cdot \SI{26.2}{\cm} + \SI{32.6}{\cm}
= (\num{38.0} + \num{52.4} + \num{32.6})\,\si{\cm}
= \SI{123.0}{\cm}.
\]
when typing physical units?
\end{document}
The question is in the attached screenshot of the output.
-
Attachments
-

- The output.
- output.png (14.39 KiB) Viewed 8125 times
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
NEW: TikZ book now 40% off at Amazon.com for a short time.
-
cgnieder
- Site Moderator
- Posts: 2000
- Joined: Sat Apr 16, 2011 7:27 pm
Post
by cgnieder »
This is rather subjective I think. I would prefer the second version but I can't tell you why, exactly. This is just a feeling.
Best
-
svend_tveskaeg
- Posts: 478
- Joined: Sun Jul 12, 2009 5:31 am
Post
by svend_tveskaeg »
Okay. Thank you, Clemens.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
-
cgnieder
- Site Moderator
- Posts: 2000
- Joined: Sat Apr 16, 2011 7:27 pm
Post
by cgnieder »
BTW: one could think of a third way:
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[
locale=DE
]{siunitx}
\begin{document}
\[
\SI{38.0}{\cm} + 2 \cdot \SI{26.2}{\cm} + \SI{32.6}{\cm}
= \SIlist[list-separator=+,list-final-separator=+,list-units=brackets]{38;52.4;32.6}{\cm}
= \SI{123.0}{\cm}.
\]
\end{document}
But I'm still not entirely sure which one I'd choose in the end.
Regards
-
svend_tveskaeg
- Posts: 478
- Joined: Sun Jul 12, 2009 5:31 am
Post
by svend_tveskaeg »
This is really nice. I'll use the following:
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[
locale=DE
]{siunitx}
\newcommand*\horse[3]{
\SIlist[
list-separator=#1,
list-final-separator=#1,
list-units=brackets
]{#2}{#3}
}
\begin{document}
\[
\SI{38.0}{\cm} + 2 \cdot \SI{26.2}{\cm} + \SI{32.6}{\cm}
= \horse{+}{100; 38; 52.4; 32.6}{\cm}
= \SI{123.0}{\cm}.
\]
\end{document}
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)