Figures in format-independent documents are a problem. You cannot avoid contact with the final format (HTML, LaTeX or whatever) if you want to include figures in a text. The way Yodl approaches figures, is currently the folloowing.
epsf
must be stated as one of the LaTeX
styles using latexoptions
macro.
The file in question is stated in Yodl without an extension. Yodl provides a
default extension, being .ps
.
<img src=...>
stanza. The file must be a GIF
file. The file is -again- stated without the filename extension; Yodl
supplies .gif
.
figure
. It takes
three arguments:
.gif
file, for usage with HTML documents. The conversion to PostScript could be
automated, e.g., using a Yodl macro:
SYSTEM(xpmtoppm picture.xpm | pnmtops > picture.ps)
See the discussion of the SYSTEM
macro (section ??) for the danger
of live data and how Yodl handles them.
After this, you would be reasonably safe that the picture is available for both HTML and LaTeX output. The picture would be typeset in a figure using:
figure(picture) (A photo of me.) (photo)
Note how the first argument, the filename, does not contain an extension. The third argument, which is a label, can be used in, e.g.,
See figure ref(photo) for a photograph.
Yodl has a few auxiliary macros, which are:
fig(label)
: This macro is a shorthand for getfigurestring()
ref(label)
. It just makes typing shorter, and is used as e.g.: See
fig(photo) for a photograph.
Note that the string figure
that is
generated by this macro can be (re)defined, see below.
setfigurestring(name)
: This macro is similar to
setchapterstring
etc.. It defines the string that is used to identify a
figure, and is (appropriately) figure
by default. The macro
getfigurestring()
expands to the string in question. See also section
?? for a discussion of national language support.
sethtmlfigureext(.new)
: This macro redefines the filename extension
for HTML conversions from .gif
to .new
. Note that you must include a
leading dot in the redefinition.
The new extension is used in the first following figure
statement.
sethtmlfigurealign(align)
: This redefines the alignment of figures
in HTML, which is default bottom
. Check your HTML handbook for possible
options; top
and center
should be fairly standard.
setlatexfigureext(.new)
: Redefines the extension from .ps
to
.new
.
Finally, an example of a picture is shown in figure ??. The picture is
also distributed with the Yodl package as Documentation/pictures/world.xpm
.
Please send Yodl questions and comments to yodl@icce.rug.nl.
Please send comments on these web pages to (address unknown)
Copyright (c) 1997, 1998, 1999 Karel Kubat and Jan Nieuwenhuizen.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.