summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/varwidth/varwidth-doc.tex
blob: a182e6b8654bce486818ac2ac4e95b62151bccb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\documentclass[a4paper]{article}
\usepackage[a4paper]{geometry}
\usepackage{miscdoc,varwidth,multicol}
\newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}}

\newsavebox{\varbox}

\begin{document}
\title{The \Package{varwidth} package (version 0.92)}
\author{Donald Arseneau\thanks{Documentation put together by Robin Fairbairns}}
\maketitle

\section{The \environment{varwidth} environment}

The package defines a \environment{varwidth} environment (based on
\environment{minipage}) which is an
analogue of \environment{minipage}, but whose resulting width is the
natural width of its contents.  A trivial example:
\begin{center}
  \begin{varwidth}[t]{2in}
    \cmdinvoke{begin}{varwidth}[1in]\\
    \null\quad\texttt{Trivia}\\
    \cmdinvoke{end}{varwidth}
  \end{varwidth}%
  \quad and\quad
  \begin{varwidth}[t]{2in}
    \cmdinvoke{begin}{minipage}[1in]\\
    \null\quad\texttt{Trivia}\\
    \cmdinvoke{end}{minipage}
  \end{varwidth}
\end{center}
produce
\begin{center}
  \begin{lrbox}\varbox
    \begin{varwidth}{1in}
      Trivia
    \end{varwidth}
  \end{lrbox}
  \fbox{\usebox{\varbox}}%
  \quad and\quad
  \begin{lrbox}\varbox
    \begin{minipage}{1in}
      Trivia
    \end{minipage}
  \end{lrbox}
  \fbox{\usebox{\varbox}}%
\end{center}
(the output placed in an \cs{fbox} to emphasise the effect).

\section{The \cs{narrowragged} command}

The command works like \cs{raggedright}, but produces generally
narrowe lines in paragraphs, with more text in the last line (the
lines have more-equal lengths).
\end{document}