Summary. Quick demo of how to make figures with TikZ in DocOnce.
TikZ
is a very strong tool for making figures in LaTeX. DocOnce supports
such figures: if a figure file myfig
exists in a version
myfig.tikz
, DocOnce will, in case of latex
or pdflatex
output,
utilize the myfig.tikz
figure directly. The problem is what do to
with other output formats. In html
format one can use a
corresponding SVG version of the figure, and for other formats, one
needs a plain PNG file. DocOnce will automatically create such
versions of the figure and store them along with myfig.tikz
, as is
done when other figure formats need automatic conversion.
The most fundamental shape is the line in Figure 1. See the
source code
for how this TikZ figure is defined in LaTeX as a file line.tikz
(and included in DocOnce through FIGURE: [line, width=500] caption
). Such
lines can be combined to form other shapes, e.g., a square
as in Figure 2, but that figure was created directly by
the rectangle
TikZ command.
A grid can also be easily made.
A circle, however, cannot be formed by a finite number of straight lines. It requires special code.
TikZ can be used to plot functions. The next figure will be inlined.
See the source code for how you make this figure.
All details are in the source code.