diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/smartunits/smartunits.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/smartunits/smartunits.tex | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/Master/texmf-dist/doc/latex/smartunits/smartunits.tex b/Master/texmf-dist/doc/latex/smartunits/smartunits.tex index 78c23ee12a0..fe57502fbd4 100644 --- a/Master/texmf-dist/doc/latex/smartunits/smartunits.tex +++ b/Master/texmf-dist/doc/latex/smartunits/smartunits.tex @@ -107,8 +107,9 @@ Imperial units (there is no error checking, however). Depending on the (global) settings the unit will be printed either as a metric unit, or as an Imperial unit, or both. If the required unit is not - given as an argument to \Verb|\SmartUnit| then it is computed. The - units are printed using \ctan{siunitx}, so the formatting of the + given as an argument to \Verb|\SmartUnit| then it is computed. + + The units are printed using \ctan{siunitx}, so the formatting of the units can be controlled using \Verb|\sisetup| together with formatting parameters from \ctan{siunitx}. Some aspects of the formatting can be controlled ``locally'' using \Verb|\SmartUnit| and @@ -136,6 +137,7 @@ \SmartUnitSettings{places=2} % Some global settings < \SmartUnitSettings{places=2} > \SmartUnit{metric imperial} % Output format: metric (Imperial) < \SmartUnit{metric imperial} > \SmartUnit{cm=10} % < \SmartUnit{cm=10} > + \SmartUnit{cm=66} % < \SmartUnit{cm=66} > \SmartUnit{feet=4,inches=3} % < \SmartUnit{feet=4,inches=3} > \SmartUnit{celsius=20} % < \SmartUnit{celsius=20} > \SmartUnit{metric} % Output format: metric < \SmartUnit{metric} > @@ -223,6 +225,8 @@ \end{lstlisting} \item[Length -- cm, inches, feet] + Feet are always printed as integers. Significant figures/places + are applied only to the printing of inches. \begin{lstlisting}[texcl] \SmartUnit{feet=7, inches=1} % \SmartUnit{feet=7, inches=1} \SmartUnit{cm=189, feet=7, inches=1} % \SmartUnit{cm=189, feet=7, inches=1} @@ -230,10 +234,15 @@ \end{lstlisting} \item[Temperature -- celsius, fahrenheit] + Convesions between Celsius and Fehrenheit can be speficied using + \textsf{celsius}, \textsf{C}, \textsf{fahrenheit} or \textsf{F}. + \begin{lstlisting}[texcl] \SmartUnit{celsius=32,places=3} % \SmartUnit{celsius=32,places=3} \SmartUnit{celsius=0} % \SmartUnit{celsius=0} + \SmartUnit{C=37} % \SmartUnit{C=37} \SmartUnit{fahrenheit=0} % \SmartUnit{fahrenheit=0,places=2} + \SmartUnit{F=22,figures=4} % \SmartUnit{F=212,figures=4} \end{lstlisting} \item[Time -- hours, minutes, seconds, am, pm] @@ -277,8 +286,8 @@ \Verb|\sisetup| macro from the \ctan{siunitx} package. \begin{description} - \item[figures] This is equivalent to \Verb|\sisetup{round-mode=figures, precision=#1}|. All units are printed - with \#1 significant figures. + \item[figures] This is equivalent to \Verb|\sisetup{round-mode=figures, precision=#1}|. + Units are printed with \#1 significant figures. \begin{lstlisting}[texcl] \SmartUnit{miles=60, metric, figures=0} % \SmartUnit{miles=60, metric, figures=0} \SmartUnit{miles=60, metric, figures=1} % \SmartUnit{miles=60, metric, figures=1} @@ -288,8 +297,8 @@ \end{lstlisting} \item[places] - This is equivalent to \Verb|\sisetup{round-mode=figures, precision=#1}|. All units are printed - with \#1 significant figures. + This is equivalent to \Verb|\sisetup{round-mode=places, precision=#1}|. + Units are printed with \#1 decimal places. \begin{lstlisting}[texcl] \SmartUnit{miles=60, metric, places=0} % \SmartUnit{miles=60, metric, places=0} \SmartUnit{miles=60, metric, places=1} % \SmartUnit{miles=60, metric, places=1} @@ -404,12 +413,15 @@ The package was written in response to a \href{http://tex.stackexchange.com/questions/241169/}{TeX.SX question}, partly as a proof-of-concept and partly as an exercise to learn how - to use \ctan{pgfkeys}. I thank Mark Adams for asking the question. + to use \ctan{pgfkeys}. Thanks to Mark Adams for asking the question. \Section{Author} - \href{mailto:Andrew.Mathas@gmail.com?smartunits}{Andrew Mathas}, \copyright\space February 2016. + \href{mailto:Andrew.Mathas@gmail.com?smartunits}{Andrew Mathas}, + \copyright\space 2015, 2016. \Section{Licence} - Released under the \href{http://www.latex-project.org/lppl.txt}{LaTeX Project Public License}, v1.3c or later. + Released under the + \href{http://www.latex-project.org/lppl.txt}% + {LaTeX Project Public License}, v1.3c or later. \end{document} |