diff options
author | Karl Berry <karl@freefriends.org> | 2009-05-22 23:51:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-05-22 23:51:44 +0000 |
commit | 566f5207d7e3cafb0633d31277067336ccd9cca7 (patch) | |
tree | 7af53e7ac405185168bc1dc38c4e820f442b78d0 /Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-varwidth.html | |
parent | b0beea26ffffd915bb6d9b82f2d65a0a05b7e23b (diff) |
move generic english documents out of texmf-doc
git-svn-id: svn://tug.org/texlive/trunk@13396 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-varwidth.html')
-rw-r--r-- | Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-varwidth.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-varwidth.html b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-varwidth.html new file mode 100644 index 00000000000..31f029b31e8 --- /dev/null +++ b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-varwidth.html @@ -0,0 +1,70 @@ +<head> +<title>UK TeX FAQ -- question label varwidth</title> +</head><body> +<h3>Automatic sizing of <code>minipage</code></h3> +<p/>The <code>minipage</code> environment requires you to specify the +width of the “page” you’re going to create. This is sometimes +inconvenient: you would like to occupy less space, if possible, but +<code>minipage</code> sets a box that is exactly the width you +specified. +<p/>The <i>pbox</i> package defines a <code>\</code><code>pbox</code> whose width is exactly +that of the longest enclosed line, subject to a maximum width that you +give it. So while <code>\</code><code>parbox{2cm}{Hello\\world!}</code> produces a +box of width exactly <code>2cm</code>, +<code>\</code><code>pbox{2cm}{Hello\\world!}</code> produces one whose width is +<code>1.79cm</code> (if one’s using the default <i>cmr</i> font for the +text, at least). The package also provides a +<code>\</code><code>settominwidth[</code><em>min</em><code>]{</code><em>length</em><code>}{</code><em>text</em><code>}</code> (which looks (almost) +like the standard <code>\</code><code>settowidth</code> command), and a <code>\</code><code>widthofpbox</code> +function analogous to the <code>\</code><code>widthof</code> command for use with the +<i>calc</i> package. +<p/>The <i>eqparbox</i> package extends <i>pbox</i>’s idea, by +allowing you to set a series of boxes, all with the same (minimised) +width. (Note that it doesn’t accept a limiting maximum width +parameter.) The package documentation shows the following example +drawn from a joke <em>curriculum vitae</em>: +<blockquote> + +<pre> +\noindent% +\eqparbox{place}{\textbf{Widgets, Inc.}} \hfill +\eqparbox{title}{\textbf{Senior Widget Designer}} \hfill +\eqparbox{dates}{\textbf{1/95--present}} + +... + +\noindent% +\eqparbox{place}{\textbf{Thingamabobs, Ltd.}} \hfill +\eqparbox{title}{\textbf{Lead Engineer}} \hfill +\eqparbox{dates}{\textbf{9/92--12/94}} +</pre> +</blockquote><p> +The code makes the three items on each of the heading lines have +exactly the same width, so that the lines as a whole produce a regular +pattern down the page. A command <code>\</code><code>eqboxwidth</code> allows you to use +the measured width of a group: the documentation shows how the command +may be used to produce sensible-looking columns that mix <code>c</code>-, +<code>r</code>- or <code>l</code>-rows, with the equivalent of a <code>p{...}</code> +entry, by making the fixed-width rows an <i>eqparbox</i> group, and +making the last from a <code>\</code><code>parbox</code> using the width that’s been +measured for the group. +<p/>The <i>varwidth</i> package defines a <code>varwidth</code> +environment which sets the content of the box to match a “narrower +natural width” if it finds one. (You give it the same parameters as +you would give <code>minipage</code>: in effect, it is a ‘drop-in’ +replacement.) <i>Varwidth</i> provides its own ragged text command: +<code>\</code><code>narrowragged</code>, which aims to make narrower lines and to put more +text in the last line of the paragraph (thus producing lines with more +nearly equal lengths than typically happens with <code>\</code><code>raggedright</code> +itself). +<p/>The documentation (in the package file) lists various restrictions and +things still to be done, but the package is already proving useful for +a variety of jobs. +<dl> +<dt><tt><i>eqparbox.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/eqparbox.zip">macros/latex/contrib/eqparbox</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/eqparbox.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/eqparbox/">browse</a>) +<dt><tt><i>pbox.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/pbox.zip">macros/latex/contrib/pbox</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/pbox.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/pbox/">browse</a>) +<dt><tt><i>varwidth.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/misc/varwidth.sty">macros/latex/contrib/misc/varwidth.sty</a> +</dl> +<p/> +<p/><p/><p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=varwidth">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=varwidth</a> +</body> |