summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/printlen/printlen-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/printlen/printlen-doc.tex')
-rw-r--r--macros/latex/contrib/printlen/printlen-doc.tex102
1 files changed, 102 insertions, 0 deletions
diff --git a/macros/latex/contrib/printlen/printlen-doc.tex b/macros/latex/contrib/printlen/printlen-doc.tex
new file mode 100644
index 0000000000..2f3f912086
--- /dev/null
+++ b/macros/latex/contrib/printlen/printlen-doc.tex
@@ -0,0 +1,102 @@
+\documentclass[pagesize=auto, fontsize=12pt, DIV=10]{scrartcl}
+
+\usepackage{fixltx2e}
+\usepackage{etex}
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage[svgnames]{xcolor}
+\usepackage{listings}
+\usepackage{microtype}
+\usepackage{hyperref}
+
+\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
+\newcommand*{\pkg}[1]{\textsf{#1}}
+\newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
+\makeatletter
+\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}}
+\makeatother
+\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle}
+\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}}
+
+\addtokomafont{title}{\rmfamily}
+
+\lstset{%
+ language=[LaTeX]TeX,%
+ columns=flexible,%
+ upquote=true,%
+ numbers=left,%
+ basicstyle=\ttfamily,%
+ keywordstyle=\color{Navy},%
+ commentstyle=\color{DimGray},%
+ stringstyle=\color{SeaGreen},%
+ numberstyle=\scriptsize\color{SlateGray}%
+}
+
+\title{The \pkg{printlen} package\thanks{This manual corresponds to \pkg{printlen.sty}~v1.1a, dated~2009/09/03.}}
+\subtitle{Print lengths in a variety of units}
+\author{Peter Wilson, Herries Press\and Harald Harders\thanks{\mail{h.harders@tu-bs.de}}\and Maintainer: Will Robertson\thanks{\mail{will.robertson.@latex-project.org}}}
+\date{2009/09/03}
+
+
+\begin{document}
+
+\maketitle
+
+
+\section{Usage}
+
+\cmd{\printlength}\marg{length} prints the value of a \LaTeX\ length in the
+units specified by \cmd{\uselengthunit}\marg{unit}, where \meta{unit} may be any \TeX\ %
+length unit except for scaled point. That is, \meta{unit} may be any of:
+\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
+value will include any stretch or shrink values, otherwise these
+are not printed. The \meta{unit} argument may also be \texttt{PT}, in which case
+length values will be printed in pt units but without any stretch
+or shrink values. An unknown value for \meta{unit} is treated as though it
+had been specified as \texttt{pt}.
+
+The unit is separated from the number using the command
+\cmd{\unitspace} which is set to \cmd{\,} by default. In math mode the units are
+printed upright.
+
+\cmd{\rndprintlength}\meta{length} prints the rounded value of a \LaTeX\ length.
+Use \texttt{PT} instead of \texttt{pt} for rounded points if there are stretch or
+shrink values.
+
+The initial setting is \verb+\uselengthunit{pt}+
+
+
+\minisec{Example:}
+
+\begin{lstlisting}
+The \verb|\textwidth| is \printlength{\textwidth} which is also
+\uselengthunit{in}\printlength{\textwidth} and
+\uselengthunit{mm}\printlength{\textwidth}.
+\end{lstlisting}
+
+
+\section{Change history}
+
+\minisec{Version 1.1a (2009/09/03)}
+
+\begin{itemize}
+\item New maintainer (Will Robertson)
+\end{itemize}
+
+
+\minisec{Version 1.1 (2001/12/09)}
+
+\begin{itemize}
+\item Print rounded values
+\item Space between value and units
+\end{itemize}
+
+
+\minisec{Version 1.0 (2001/11/03)}
+
+\begin{itemize}
+\item First public release
+\end{itemize}
+
+\end{document}