Information and discussion about graphics, figures & tables in LaTeX documents.
LKB
Posts: 19 Joined: Wed Jul 11, 2012 5:19 pm
Post
by LKB » Fri Aug 24, 2012 10:50 pm
Joseph,
I am using Lyx as my front end but I dont think this make any difference. Testing following code
Code: Select all
\documentclass[oneside,british,oldfontcommands]{memoir}
\usepackage{babel}
\OnehalfSpacing
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\sisetup{per-mode=fraction, tight-spacing = true , fraction-function = \tfrac , quotient-mode = fraction}%
\sisetup{inter-unit-product = \ensuremath { { } \cdot { } } , exponent-product = \cdot }%
\sisetup{input-product=x , output-quotient = \ensuremath { { } \times{}}} %for 1x2x3
\sisetup{group-minimum-digits = 4} %start grouping from 4 digits, in 3 no groups
\sisetup{range-units = single} %2-3C not 2C-3C
\sisetup{separate-uncertainty=true} %2+-1 not 2(1)
%\sisetup{scientific-notation = engineering } % exp in multiple of 3
\sisetup{prefixes-as-symbols=false} %10^-9 ect ect
%\sisetup{zero-decimal-to-integer, round-mode = places,round-precision = 3}
%\DeclareSIUnit[scientific-notation = engineering, prefixes-as-symbols=false]
% {\second}{s}
\DeclareSIUnit[scientific-notation = engineering, prefixes-as-symbols=false]
{\ns}{\nano\second}
\makeatother
\begin{document}
\begin{center}
Where short term stability is $\SI{10(1)}{\nano\second}$ as well as $\SI{10(1)}{\ns}$, but our network edge is $\SI{10}{\km}$.
\par\end{center}
\end{document}
Show no display difference between $\SI{10(1)}{\nano\second}$ and $\SI{10(1)}{\ns}$ despite different settings
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 » Sat Aug 25, 2012 9:54 pm
I can confirm
LKB 's observation. This MWE
Code: Select all
\documentclass{article}
\usepackage{siunitx}
\sisetup{
scientific-notation=false,
prefixes-as-symbols=true
}
\DeclareSIUnit[scientific-notation=engineering,prefixes-as-symbols=false]{\second}{s}
\DeclareSIUnit[scientific-notation=engineering,prefixes-as-symbols=false]{\ns}{\nano\second}
\begin{document}
\SI{10e2}{\nano\second}
\SI{10e2}{\kilo\metre}
\end{document}
on TL 2012 with »siunitx« v2.5g gives
siunitx.png (2.25 KiB) Viewed 8641 times
LKB
Posts: 19 Joined: Wed Jul 11, 2012 5:19 pm
Post
by LKB » Tue Sep 04, 2012 12:12 pm
Is there any more news on this one? Does it mean that unit specific definition cannot be made?
josephwright
Site Moderator
Posts: 814 Joined: Tue Jul 01, 2008 2:19 pm
Post
by josephwright » Tue Sep 04, 2012 8:00 pm
Per unit settings work for that unit command alone: settings for \second
will not apply to \ns
, for example.
Joseph Wright
LKB
Posts: 19 Joined: Wed Jul 11, 2012 5:19 pm
Post
by LKB » Tue Sep 04, 2012 11:54 pm
If you look at Klemens example it does not work. Unit only definitions are not applied in the document in comparison to general command using \sisetup.
I think that way around it would be
Code: Select all
\newcommand*{\FlexUnits}[2]{\SI[scientific-notation=engineering,prefixes-as-symbols=false]{#1}{#2}}
but is not as nice nor flexible as using siunitx only
josephwright
Site Moderator
Posts: 814 Joined: Tue Jul 01, 2008 2:19 pm
Post
by josephwright » Thu Sep 06, 2012 10:05 am
It does work, but as I say only for
exactly the units set up
Code: Select all
\documentclass{article}
\usepackage{siunitx}
\sisetup{
scientific-notation=false,
prefixes-as-symbols=true
}
\DeclareSIUnit[scientific-notation=engineering,prefixes-as-symbols=false]{\second}{s}
\DeclareSIUnit[scientific-notation=engineering,prefixes-as-symbols=false]{\nanosecond}{\nano\second}
\DeclareSIUnit[scientific-notation=engineering,prefixes-as-symbols=false]{\ns}{\nano\second}
\begin{document}
\SI{10e2}{\nanosecond}
\SI{10e2}{\ns}
\end{document}
Joseph Wright
LKB
Posts: 19 Joined: Wed Jul 11, 2012 5:19 pm
Post
by LKB » Thu Sep 06, 2012 6:14 pm
Compiled it shows different behaviour pattern for \nanosecond and \ns. It seems like I can re-define existing units and have to create new ones only. Is this correct?
Attachments
Results in Lyx a.png (8.33 KiB) Viewed 8604 times
josephwright
Site Moderator
Posts: 814 Joined: Tue Jul 01, 2008 2:19 pm
Post
by josephwright » Fri Sep 07, 2012 9:49 am
Settings per unit only apply to exactly that unit command. So \nanosecond
and \ns
are different: if you want to cahnge how \ns
behaves you will need to redefine it. The reason for this is that with compound units what 'should' happen rapidly becomes impossible to tell. So siunitx only checks for a set of options for the 'outer' unit (the one you actually type in), and not for what that then is converted to.
Joseph Wright