diff options
Diffstat (limited to 'Master/texmf-doc/doc/english/FAQ-en/html/FAQ-topgraph.html')
-rw-r--r-- | Master/texmf-doc/doc/english/FAQ-en/html/FAQ-topgraph.html | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-topgraph.html b/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-topgraph.html new file mode 100644 index 00000000000..e3906b52dd2 --- /dev/null +++ b/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-topgraph.html @@ -0,0 +1,42 @@ +<head> +<title>UK TeX FAQ -- question label topgraph</title> +</head><body> +<h3>Top-aligning imported graphics</h3> +<p>When TeX sets a line of anything, it ensures that the base-line of +each object in the line is at the same level as the base-line of the +final object. (Apart, of course, from <code>\</code><code>raisebox</code> commands...) +<p>Most imported graphics have their base-line set at the bottom of the +picture. When using packages such as <i>subfig</i>, one often +wants to align figures by their tops. The following odd little bit of +code does this: +<blockquote> +<pre> +\vtop{% + \vskip0pt + \hbox{% + \includegraphics{figure}% + }% +} +</pre> +</blockquote> +The <code>\</code><code>vtop</code> primitive sets the base-line of the resulting object to +that of the first "line" in it; the <code>\</code><code>vskip</code> creates the illusion +of an empty line, so <code>\</code><code>vtop</code> makes the very top of the box into the +base-line. +<p>In cases where the graphics are to be aligned with text, there is a +case for making the base-line one ex-height below the top of the box, +as in: +<blockquote> +<pre> +\vtop{% + \vskip-1ex + \hbox{% + \includegraphics{figure}% + }% +} +</pre> +</blockquote> +The fact is, <em>you</em> may choose where the base-line ends up. This +answer merely shows you sensible choices you might make. +<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=topgraph">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=topgraph</a> +</body> |