Hi, I'm completely new to LaTeX (as of yesterday), but I've prepared a report in LaTeX, and it's working very well (thanks to Tobias Oetiker's The (Not So) Short Introduction to LaTeX2e).
I often need to use [number] [unit of measure] combinations such as: 32 mg kg^{-1} (i.e. 32 mg/kg ~matter of style preference). Which is the best practice to encode this?:
$32 mg kg^{-1}$
$32$ mg kg $^{-1}$
32 mg kg $^{-1}$
If the first option is preferable, should all symbols representing units of measure be done in math mode? Any justification for (or not for) using math mode to render units of measure?
Thanks to anyone who can help.
Last edited by Oldak on Wed Apr 06, 2011 5:44 pm, edited 1 time in total.
using math mode for the mathematical content (using \mathrm for the units does work, but usually is over-kill). However, there are a number of more semantic approaches to the problem. I'd point to my own siunitx package, where the same effect as the above is available using
I've been implementing siunitx for use with the report I am writing. I want to output "300–350g" (ndash, not hyphen). Using \SIrange{300}{350}{\gram}, the output is "300g to 350g". I've tried some quick hacks such as \SI{300}–{350}{\gram} which does output something similar to what I'm aiming for, except that the ndash is misaligned (the first number is followed by a small space). While skimming your documentation, I couldn't find a solution to this.
Is there an option for \SIrange to express the range using an ndash, with the unit following the end of the range (300–350g)?
P.S. \SI{3}{\gram\per\liter} results in "3 g L^{-1}". Is there an option to place a \cdot between "g" and "L" for the sake of clarity? Also, why does \litre result in "l" and \liter result in "L"? (I thought only "L" was acceptable.)
Last edited by Oldak on Wed Apr 06, 2011 5:48 pm, edited 1 time in total.
Oldak wrote:[…] While skimming your documentation, I couldn't find a solution to this.
Is there an option for \SIrange to express the range using an ndash, with the unit following the end of the range (300–350g)? […]
Actually the siunitx manual is quite clear in this regard. Searching the manual for „range“ with the search function of your PDF viewer gives you all necessary information, e. g. Table 16 and Table 23 (see code below}.
Oldak wrote:[…] \SI{3}{\gram\per\liter} results in "3 g L^{-1}". Is there an option to place a \cdot between "g" and "L" for the sake of clarity? […]
According to Section 5.10 of the manual this separator is also given by an option (see code below).
Oldak wrote:[…] Also, why does \litre result in "l" and \liter result in "L"? (I thought only "L" was acceptable.) […]
The according Wikipedia article has an explanation [1]. The German version of this article says that the „L“ has been introduced in order not to mix it up the „l“ with the digit „1“. Both symbols are accepted. I think the package just accommodates to that.
Many thanks localghost, the \sisetup example you give is exactly what I needed. It seems I could have read the documentation a bit more thoroughly.
Edit: Although if anyone intends to use localghost's example, replace "\cdot" with "{}\cdot{}", per the documentation advice (p38):
The standard setting is a thin space: another common choice is a centred dot. To get the correct spacing it is necessary to use {}\cdot{} in the later case.
I actually have a question according the \litre (l) - \liter (L) - situation.
I am using die SI-Unitx package in my report and needed to change the Liter-Character L to l. But despite the fact that I rewrite those spots from \liter to \litre I still get the L-Character as an output.
Am I doing something wrong or does LaTeX play games with me?
Thanks in advance for your answer and best regards,
Melike