← Back to team overview

ubuntu-developer-manual team mailing list archive

Re: how to anchor a graphic (\screenshot) to a bit of text?

 

Hello, Kyle.

On Mon, Jan 10, 2011 at 6:38 PM, Kyle Nitzsche
<kyle.nitzsche@xxxxxxxxxxxxx> wrote:
> http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
>
> I start to see how it works. For example:
>  * in ubuntu-developer-manual.cls
>  * where it specifies the \screenshot command (or environment.. not sure of
> the LaTeX terminology here)
>  * I can modify the figure 'environment' placement specifier to, for
> example, place figures at the bottom of a page, with the '[b]' in the last
> line of this:
> \newcommand{\screenshot}[4][htbp!]{%
>  \ifvmode\else\unskip\fi%
>  \IfFileExists{../images-\@ubuntu@language@code/#2}{%
>
>  \savebox{\screenshotgraphic}{\includegraphics[scale=\strip@pt\screenshotscale]{../images-\@ubuntu@language@code/#2}}%
>    \ifthenelse{\wd\screenshotgraphic>\textwidth}{%
>      \begin{figure*}[b]%

This modification is unnecessary.  You can pass the figure placement list as:

  \screenshot[b]{blah.png}{ss:blah}{caption}

instead of forcing it for every screenshot.  But as I've already
mentioned (and will again), I recommend *not* doing this until all the
text has been written and figures/screenshots included.

> Kevin:
> Placing figures is difficult in lots of tool chains. My gut feeling is that
> since we don't necessarily have scheduled time and person-power to go
> through the text and plcae figures *every* time we need to create a pdf, and
> since a misplaced figure is *worse* than extra whitespace on a page from the
> point of reader comprehension, we should consider a default placement of
> HERE (with "[h]") in the above.
>
> In other words, by default, the figure should appear where the author placed
> it in the text.
>
> That way, anyone at anytime can build a pdf without having to work through
> the whole thing.
>
> What do you think?

Again, though, the figure placement stuff is much more complicated
than this.  The 'h' (here) placement specifier is *only a suggestion*
and may be (and frequently is) ignored by LaTeX.  If you only provide
the 'h' placement specifier, then LaTeX is actually more likely (if it
can't place the image where you want it) to place the image on its own
page and push later floats further down the line.

I'm not sure what you mean by requiring a person to "go through the
text and plcae [sic] figures *every* time we need to create a pdf."
What I proposed is that you continue placing your \screenshot commands
in as you've been doing.  Before we create the final PDF that gets
released to the world, we'll go through and massage the placement of
the screenshots (and margin notes and other fiddly bits).  This
process occurs once, just prior to the release.  It does not and
should not be done each time someone runs 'make'.

--Kevin



Follow ups

References