| 1 |
%% |
| 2 |
%% This is file `xprintlen.tex', |
| 3 |
%% part of the package xprintlen. |
| 4 |
%% |
| 5 |
%% Copyright (C) 2014 by Liam Huang <[email protected]> |
| 6 |
%% -------------------------------------------------------------------------- |
| 7 |
%% This work may be distributed and/or modified under the |
| 8 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 9 |
%% of this license or (at your option) any later version. |
| 10 |
%% The latest version of this license is in |
| 11 |
%% http://www.latex-project.org/lppl.txt |
| 12 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 13 |
%% version 2005/12/01 or later. |
| 14 |
%% |
| 15 |
%!TEX option = -shell-escape |
| 16 |
%!TEX builder = latexmk |
| 17 |
\documentclass{article} |
| 18 |
\title{\bfseries The \textsf{xprintlen} package\thanks{This manual corresponds to \textsf{xprintlen.sty} v1.0, dated 2014/12/25}{\hspace{6pt}}\thanks{This work is released under the LaTeX Project Public |
| 19 |
License (\url{http://www.latex-project.org/lppl.txt}), v1.3c or later.}} |
| 20 |
\author{Liam Huang\thanks{\url{http://liam0205.me/}, \href{mailto:[email protected]}{[email protected]}}} |
| 21 |
\date{2014/12/25} |
| 22 |
\usepackage{mathpazo} |
| 23 |
\usepackage{minted} |
| 24 |
\usepackage{graphicx} |
| 25 |
\usepackage{hyperref} |
| 26 |
\hypersetup{hidelinks} |
| 27 |
\usepackage{geometry} |
| 28 |
\geometry{letterpaper, top = 1in, bottom = 1in} |
| 29 |
|
| 30 |
\begin{document} |
| 31 |
\maketitle |
| 32 |
|
| 33 |
\section{Requirements} |
| 34 |
|
| 35 |
\textsf{xprintlen} requires the package \textsf{fp} to be available and reasonably up to date on your system. |
| 36 |
|
| 37 |
\section{Installation} |
| 38 |
|
| 39 |
Put the \textsf{.sty} file into the folder \texttt{TEXMF/tex/latex/xprintlen}, and put other files into another folder \texttt{TEXMF/doc/latex/xprintlen}. Run \texttt{texhash} to refresh the file name data base. |
| 40 |
|
| 41 |
\section{Usage} |
| 42 |
|
| 43 |
This package defines a command, \verb|\printlen|, to print lengths in a variety of units. It supports all the units that \TeX{} supports, and its calculation depends on the package \textsf{fp}. |
| 44 |
|
| 45 |
\verb|\printlen| recieves three parameters, while the first two parameters are the optionals. The first (optional) parameter sets the length of significant digits, whose default value is $ 2 $, stored in the marco \verb|\defaultsignificant|. The second (optional) parameter sets the unit to be print, and the default value of it is \texttt{mm}, stored in the marco \verb|\defaultunit|. The third parameter of the command, also the only mandatory parameter, is the length that will be calculated. |
| 46 |
|
| 47 |
You can redefine the two marcos to revise the default length of significant digits and/or the default unit. |
| 48 |
|
| 49 |
\section{Example} |
| 50 |
|
| 51 |
\noindent\begin{minipage}[b]{0.55\linewidth} |
| 52 |
The following lines will produce: |
| 53 |
|
| 54 |
\begin{minted}{latex} |
| 55 |
\documentclass{article} |
| 56 |
\usepackage{xprintlen} |
| 57 |
\newlength{\testlen} |
| 58 |
\setlength{\testlen}{3.1415926cm} |
| 59 |
\begin{document} |
| 60 |
\obeylines |
| 61 |
\printlen{\testlen} |
| 62 |
\printlen[5]{\testlen} |
| 63 |
\printlen[5][pt]{\testlen} |
| 64 |
\end{document} |
| 65 |
\end{minted} |
| 66 |
\end{minipage}% |
| 67 |
\begin{minipage}[b]{0.45\linewidth} |
| 68 |
\includegraphics[scale = 0.6]{ex01} |
| 69 |
\end{minipage} |
| 70 |
|
| 71 |
\section{Change log} |
| 72 |
|
| 73 |
\subsection*{Version 1.0, 2014/12/25} |
| 74 |
\begin{itemize} |
| 75 |
\item The first public release. |
| 76 |
\end{itemize} |
| 77 |
\end{document} |