| 1 |
\documentclass[a4paper]{article} |
| 2 |
\usepackage[a4paper]{geometry} |
| 3 |
\usepackage{miscdoc,varwidth,multicol} |
| 4 |
\newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}} |
| 5 |
|
| 6 |
\newsavebox{\varbox} |
| 7 |
|
| 8 |
\begin{document} |
| 9 |
\title{The \Package{varwidth} package (version 0.92)} |
| 10 |
\author{Donald Arseneau\thanks{Documentation put together by Robin Fairbairns}} |
| 11 |
\maketitle |
| 12 |
|
| 13 |
\section{The \environment{varwidth} environment} |
| 14 |
|
| 15 |
The package defines a \environment{varwidth} environment (based on |
| 16 |
\environment{minipage}) which is an |
| 17 |
analogue of \environment{minipage}, but whose resulting width is the |
| 18 |
natural width of its contents. A trivial example: |
| 19 |
\begin{center} |
| 20 |
\begin{varwidth}[t]{2in} |
| 21 |
\cmdinvoke{begin}{varwidth}{1in}\\ |
| 22 |
\null\quad\texttt{Trivia}\\ |
| 23 |
\cmdinvoke{end}{varwidth} |
| 24 |
\end{varwidth}% |
| 25 |
\quad and\quad |
| 26 |
\begin{varwidth}[t]{2in} |
| 27 |
\cmdinvoke{begin}{minipage}{1in}\\ |
| 28 |
\null\quad\texttt{Trivia}\\ |
| 29 |
\cmdinvoke{end}{minipage} |
| 30 |
\end{varwidth} |
| 31 |
\end{center} |
| 32 |
which produces |
| 33 |
\begin{center} |
| 34 |
\begin{lrbox}\varbox |
| 35 |
\begin{varwidth}{1in} |
| 36 |
Trivia |
| 37 |
\end{varwidth} |
| 38 |
\end{lrbox} |
| 39 |
\fbox{\usebox{\varbox}}% |
| 40 |
\quad and\quad |
| 41 |
\begin{lrbox}\varbox |
| 42 |
\begin{minipage}{1in} |
| 43 |
Trivia |
| 44 |
\end{minipage} |
| 45 |
\end{lrbox} |
| 46 |
\fbox{\usebox{\varbox}}% |
| 47 |
\end{center} |
| 48 |
(the output placed in an \cs{fbox} to emphasise the effect). |
| 49 |
|
| 50 |
\section{The \cs{narrowragged} command} |
| 51 |
|
| 52 |
The command works like \cs{raggedright}, but produces generally |
| 53 |
narrowe lines in paragraphs, with more text in the last line (the |
| 54 |
lines have more-equal lengths). |
| 55 |
\end{document} |