| 1 |
\documentclass[a4paper]{article} |
| 2 |
\usepackage[scale=0.75]{geometry} |
| 3 |
\usepackage{shortvrb} |
| 4 |
\MakeShortVerb{\|} |
| 5 |
\newcommand{\PkgVersion}{1.1} |
| 6 |
\newcommand{\PkgDate}{2020/09/25} |
| 7 |
\newcommand{\Pkg}[1]{\textsf{#1}} |
| 8 |
\newcommand{\Meta}[1]{$\langle$\textit{#1}$\rangle$} |
| 9 |
\newcommand{\Note}{\par\noindent \textbf{NB:}\quad} |
| 10 |
\newcommand{\Means}{~:\quad} |
| 11 |
\providecommand{\eTeX}{$\varepsilon$-{\TeX}} |
| 12 |
%----------------------------------------------------------- |
| 13 |
\begin{document} |
| 14 |
\title{The \Pkg{bxcalcux} package} |
| 15 |
\author{Takayuki YATO\quad (aka.~``ZR'')} |
| 16 |
\date{v\PkgVersion \quad[\PkgDate]} |
| 17 |
\maketitle |
| 18 |
|
| 19 |
%=========================================================== |
| 20 |
\section{Overview} |
| 21 |
|
| 22 |
This package allows one to create a new unit of length |
| 23 |
that can be used in length expressions |
| 24 |
of the \Pkg{calc} package. |
| 25 |
For example, |
| 26 |
\begin{quote}\small\begin{verbatim} |
| 27 |
\newcalcunit{thou}{0.07227pt}% thousandth of inch |
| 28 |
\setlength{\lengthA}{10thou} |
| 29 |
\end{verbatim}\end{quote} |
| 30 |
will assign 0.72266\,pt to |\lengthA|.% |
| 31 |
\footnote{Using \texttt{0.001in} instead of |
| 32 |
\texttt{0.07227pt} will give rather inaccurate results, |
| 33 |
since \texttt{0.001in} is evaluated to 0.7277\,pt.} |
| 34 |
|
| 35 |
\paragraph{Supported format} \LaTeX. |
| 36 |
\paragraph{Supported engine} Any engine with {\eTeX} extension. |
| 37 |
\paragraph{Prerequisite packages} |
| 38 |
\Pkg{calc}, \Pkg{etoolbox}. |
| 39 |
|
| 40 |
%=========================================================== |
| 41 |
\section{Package Loading} |
| 42 |
|
| 43 |
Use |\usepackage| as usual, with no options. |
| 44 |
\begin{quote}\small\begin{verbatim} |
| 45 |
\usepackage{bxcalcux} |
| 46 |
\end{verbatim}\end{quote} |
| 47 |
|
| 48 |
%=========================================================== |
| 49 |
\section{Usage} |
| 50 |
|
| 51 |
\begin{itemize} |
| 52 |
\item |\newcalcunit{|\Meta{unit}|}{|\Meta{length}|}|\Means |
| 53 |
Declares a new unit \Meta{unit} as equal to \Meta{length}. |
| 54 |
The unit name must consist only of alphabets. |
| 55 |
You can use relative units such as |0.5em| in \Meta{length}, |
| 56 |
and such relative units are resolved |
| 57 |
when \Pkg{calc} expressions are evaluated. |
| 58 |
|
| 59 |
\item |\DeclareCalcUnit{|\Meta{unit}|}{|\Meta{text}|}|\Means |
| 60 |
\textsl{(for {\TeX}nicians)} |
| 61 |
Declares a new unit \Meta{unit} as equal to the unit |
| 62 |
expressed by a token list \Meta{text}, |
| 63 |
which must form a ``unit of dimen'' (in {\TeX} terminology). |
| 64 |
Here is an example. |
| 65 |
\begin{quote}\small\begin{verbatim} |
| 66 |
\DeclareCalcUnit{ls}{\baselineskip}% current line skip |
| 67 |
\end{verbatim}\end{quote} |
| 68 |
|
| 69 |
\end{itemize} |
| 70 |
|
| 71 |
%=========================================================== |
| 72 |
\section{Notices} |
| 73 |
|
| 74 |
\begin{itemize} |
| 75 |
\item Usually unit names are treated as case-insensitive; |
| 76 |
but as exception, unit names with a single letter are |
| 77 |
case-sensitive. |
| 78 |
\item You must not create a unit name that coincides |
| 79 |
with a prefix of existing (built-in or created) units |
| 80 |
or any keywords that could be used in \Pkg{calc} expressions |
| 81 |
(such as |plus|, |fil|, etc.); otherwise unexpected |
| 82 |
things would occur. |
| 83 |
\end{itemize} |
| 84 |
|
| 85 |
%=========================================================== |
| 86 |
\end{document} |