| 1 |
\documentclass[pagesize=auto, fontsize=12pt, DIV=10]{scrartcl} |
| 2 |
|
| 3 |
\usepackage{fixltx2e} |
| 4 |
\usepackage{etex} |
| 5 |
\usepackage{lmodern} |
| 6 |
\usepackage[T1]{fontenc} |
| 7 |
\usepackage{textcomp} |
| 8 |
\usepackage[svgnames]{xcolor} |
| 9 |
\usepackage{listings} |
| 10 |
\usepackage{microtype} |
| 11 |
\usepackage{hyperref} |
| 12 |
|
| 13 |
\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} |
| 14 |
\newcommand*{\pkg}[1]{\textsf{#1}} |
| 15 |
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} |
| 16 |
\makeatletter |
| 17 |
\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} |
| 18 |
\makeatother |
| 19 |
\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle} |
| 20 |
\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}} |
| 21 |
|
| 22 |
\addtokomafont{title}{\rmfamily} |
| 23 |
|
| 24 |
\lstset{% |
| 25 |
language=[LaTeX]TeX,% |
| 26 |
columns=flexible,% |
| 27 |
upquote=true,% |
| 28 |
numbers=left,% |
| 29 |
basicstyle=\ttfamily,% |
| 30 |
keywordstyle=\color{Navy},% |
| 31 |
commentstyle=\color{DimGray},% |
| 32 |
stringstyle=\color{SeaGreen},% |
| 33 |
numberstyle=\scriptsize\color{SlateGray}% |
| 34 |
} |
| 35 |
|
| 36 |
\title{The \pkg{printlen} package\thanks{This manual corresponds to \pkg{printlen.sty}~v1.1a, dated~2009/09/03.}} |
| 37 |
\subtitle{Print lengths in a variety of units} |
| 38 |
\author{Peter Wilson, Herries Press\and Harald Harders\thanks{\mail{[email protected]}}\and Maintainer: Will Robertson\thanks{\mail{[email protected]}}} |
| 39 |
\date{2009/09/03} |
| 40 |
|
| 41 |
|
| 42 |
\begin{document} |
| 43 |
|
| 44 |
\maketitle |
| 45 |
|
| 46 |
|
| 47 |
\section{Usage} |
| 48 |
|
| 49 |
\cmd{\printlength}\marg{length} prints the value of a \LaTeX\ length in the |
| 50 |
units specified by \cmd{\uselengthunit}\marg{unit}, where \meta{unit} may be any \TeX\ % |
| 51 |
length unit except for scaled point. That is, \meta{unit} may be any of: |
| 52 |
\texttt{pt}, \texttt{pc}, \texttt{in}, \texttt{mm}, \texttt{cm}, \texttt{bp}, \texttt{dd} or \texttt{cc}. When \texttt{pt} is set the printed length |
| 53 |
value will include any stretch or shrink values, otherwise these |
| 54 |
are not printed. The \meta{unit} argument may also be \texttt{PT}, in which case |
| 55 |
length values will be printed in pt units but without any stretch |
| 56 |
or shrink values. An unknown value for \meta{unit} is treated as though it |
| 57 |
had been specified as \texttt{pt}. |
| 58 |
|
| 59 |
The unit is separated from the number using the command |
| 60 |
\cmd{\unitspace} which is set to \cmd{\,} by default. In math mode the units are |
| 61 |
printed upright. |
| 62 |
|
| 63 |
\cmd{\rndprintlength}\meta{length} prints the rounded value of a \LaTeX\ length. |
| 64 |
Use \texttt{PT} instead of \texttt{pt} for rounded points if there are stretch or |
| 65 |
shrink values. |
| 66 |
|
| 67 |
The initial setting is \verb+\uselengthunit{pt}+ |
| 68 |
|
| 69 |
|
| 70 |
\minisec{Example:} |
| 71 |
|
| 72 |
\begin{lstlisting} |
| 73 |
The \verb|\textwidth| is \printlength{\textwidth} which is also |
| 74 |
\uselengthunit{in}\printlength{\textwidth} and |
| 75 |
\uselengthunit{mm}\printlength{\textwidth}. |
| 76 |
\end{lstlisting} |
| 77 |
|
| 78 |
|
| 79 |
\section{Change history} |
| 80 |
|
| 81 |
\minisec{Version 1.1a (2009/09/03)} |
| 82 |
|
| 83 |
\begin{itemize} |
| 84 |
\item New maintainer (Will Robertson) |
| 85 |
\end{itemize} |
| 86 |
|
| 87 |
|
| 88 |
\minisec{Version 1.1 (2001/12/09)} |
| 89 |
|
| 90 |
\begin{itemize} |
| 91 |
\item Print rounded values |
| 92 |
\item Space between value and units |
| 93 |
\end{itemize} |
| 94 |
|
| 95 |
|
| 96 |
\minisec{Version 1.0 (2001/11/03)} |
| 97 |
|
| 98 |
\begin{itemize} |
| 99 |
\item First public release |
| 100 |
\end{itemize} |
| 101 |
|
| 102 |
\end{document} |