summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/varwidth/varwidth-doc.tex
blob: 8d1e78b44af010a8fc178872e8b16bee67ea433e (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{minipage}[t]{1in}
    \cmdinvoke{begin}{varwidth}[1in]\\
    \null\quad\texttt{Trivia}\\
    \cmdinvoke{end}{varwidth}
  \end{minipage}%
  \quad and\quad
  \begin{minipage}[t]{1in}
    \cmdinvoke{begin}{minipage}[1in]\\
    \null\quad\texttt{Trivia}\\
    \cmdinvoke{end}{minpage}
  \end{minipage}
\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}