1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
%% $Id: pst-calculate-doc.tex 724 2018-02-04 13:01:03Z herbert $
%
\listfiles
\documentclass[fontsize=11pt,DIV=14,parskip=half-]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{multido}
\usepackage{libertine}
\usepackage[scaled=0.88]{beramono}
\usepackage{pst-calculate} % support opentype spark fonts
\makeatletter
\let\Version\pstcalculate@version
\makeatother
\usepackage{showexpl,xltabular,booktabs,xurl,xcolor,ragged2e}
\lstset{%
language=[LaTeX]TeX,%
float=hbp,%
basicstyle=\ttfamily\small, %
keywordstyle=\bfseries, %
columns=flexible, %
tabsize=4, %
% frame=single, %
extendedchars=true, %
showspaces=false, %
showstringspaces=false, %
% numbers=left,
% numbersep=0.8em,
% numberstyle=\tiny, %
breaklines=true, %
breakautoindent=true,
captionpos=b,
xleftmargin=1em
}
\usepackage[style=dtk]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{dtk-logos} % for Wikipedia W
\pagestyle{headings}
\usepackage[colorlinks,hyperfootnotes=false]{hyperref}
% define \code for url-like breaking of typewriter fragments.
\ifx\nolinkurl\undefined \let\code\url \else \let\code\nolinkurl \fi
% Define \cs to prepend a backslash, and be unbreakable:
\DeclareRobustCommand\cs[1]{\mbox{\texttt{\char`\\#1}}}
\title{Support for floating point operations on \LaTeX-Level \\--\\ v.~\Version}
\author{Herbert Voß}
\begin{document}
\maketitle
\tableofcontents
\section{Introduction}
The upcoming \LaTeX3 can already be used. It is more or less stable and
macros will change only if really needed.
\section{Package options}
The package knows two optional arguments which, of course, have a corresponding
name in package \texttt{siunitx}. One can also use that one.
\begin{tabularx}{\linewidth}{@{}llX@{}}\toprule
\emph{name} & \emph{\texttt{siunitx}} & \emph{description}\\\midrule
\texttt{useComma} & \texttt{output-decimal-marker=\{,\}} & Output always a comma instead of the default dot.\\
\texttt{roundDigit}& \texttt{round-mode=places,round-precision=<value>} & round the given digit number.\\
\bottomrule
\end{tabularx}
\section{Using the macros}
\begin{LTXexample}[pos=t]
\psCalculate{3.14126*314^2}\\ % Uses \num from siunitx
\pscalculate{3.14126*314^2} % doesn't use \num
\end{LTXexample}
Without using any additional argument all available digits are printed.
\section{Optional arguments}
All optional arguments of package \texttt{siunitx} can be used:
\begin{LTXexample}[pos=t]
\psCalculate[group-digits=false]{3.14126*314^2}\\
\psCalculate[output-decimal-marker={,}]{3.14126*314^2/sin(3)}\\
\psCalculate[exponent-product=\cdot,scientific-notation=true]{3.14126*314^2/sin(3)}\\
\psCalculate[scientific-notation=engineering]{3.14126*314^2/sin(3)}\\
\psCalculate[fixed-exponent=2,scientific-notation=fixed]{3.14126*314^2/sin(3)}\\
\psCalculate[round-precision=3]{3.14126*314^2/sin(3)}\\
\psCalculate[round-mode=places,round-precision=3]{3.14126*314^2/sin(3)}
\end{LTXexample}
For more optional argument to format the output have a look at the documentation of \texttt{siunitx}.
\RaggedRight
\nocite{*}
\printbibliography
\end{document}
y
|