summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/bxcalc/bxcalcux.tex
blob: 4f6ca48b41468cbe41fc704c970ca87ebeeee48f (plain)
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
\documentclass[a4paper]{article}
\usepackage[scale=0.75]{geometry}
\usepackage{shortvrb}
\MakeShortVerb{\|}
\newcommand{\PkgVersion}{1.0b}
\newcommand{\PkgDate}{2019/11/24}
\newcommand{\Pkg}[1]{\textsf{#1}}
\newcommand{\Meta}[1]{$\langle$\textit{#1}$\rangle$}
\newcommand{\Note}{\par\noindent \textbf{NB:}\quad}
\newcommand{\Means}{~:\quad}
\providecommand{\eTeX}{$\varepsilon$-{\TeX}}
%-----------------------------------------------------------
\begin{document}
\title{The \Pkg{bxcalcux} package}
\author{Takayuki YATO\quad (aka.~``ZR'')}
\date{v\PkgVersion \quad[\PkgDate]}
\maketitle

%===========================================================
\section{Overview}

This package allows one to create a new unit of length
that can be used in length expressions
of the  \Pkg{calc} package.
For example,
\begin{quote}\small\begin{verbatim}
\newcalcunit{thou}{0.07227pt}% thousandth of inch
\setlength{\lengthA}{10thou}
\end{verbatim}\end{quote}
will assign 0.72266\,pt to |\lengthA|.%
\footnote{Using \texttt{0.001in} instead of
\texttt{0.07227pt} will give rather inaccurate results,
since \texttt{0.001in} is evaluated to 0.7277\,pt.}

\paragraph{Supported format} \LaTeX.
\paragraph{Supported engine} Any engine with {\eTeX} extension.
\paragraph{Prerequisite packages}
\Pkg{calc}, \Pkg{etoolbox}.

%===========================================================
\section{Package Loading}

Use |\usepackage| as usual, with no options.
\begin{quote}\small\begin{verbatim}
\usepackage{bxcalcux}
\end{verbatim}\end{quote}

%===========================================================
\section{Usage}

\begin{itemize}
\item |\newcalcunit{|\Meta{unit}|}{|\Meta{length}|}|\Means
Declares a new unit \Meta{unit} as equal to \Meta{length}.
The unit name must consist only of alphabets.
You can use relative units such as |0.5em| in \Meta{length},
and such relative units are resolved
when \Pkg{calc} expressions are evaluated.

\item |\DeclareCalcUnit{|\Meta{unit}|}{|\Meta{text}|}|\Means
\textsl{(for {\TeX}nicians)}
Declares a new unit \Meta{unit} as equal to the unit
expressed by a token list \Meta{text},
which must form a ``unit of dimen'' (in {\TeX} terminology).
Here is an example.
\begin{quote}\small\begin{verbatim}
\DeclareCalcUnit{ls}{\baselineskip}% current line skip
\end{verbatim}\end{quote}

\end{itemize}

%===========================================================
\section{Notices}

\begin{itemize}
\item Usually unit names are treated as case-insensitive;
but as exception, unit names with a single letter are
case-sensitive.
\item You must not create a unit name that coincides
with a prefix of existing (built-in or created) units
or any keywords that could be used in \Pkg{calc} expressions
(such as |plus|, |fil|, etc.); otherwise unexpected
things would occur.
\end{itemize}

%===========================================================
\end{document}