Summary. Quick demo of how to make figures with TikZ in DocOnce.
is a useful tool for making figures in LaTeX, and DocOnce supports
these figures. If a figure file myfig
exists in a version
myfig.tikz
, DocOnce will, for latex
or pdflatex
output,
use 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; for other formats, one
needs a plain PNG file. DocOnce will automatically create these figure
versions and store them with the myfig.tikz
figure, as is
done when other figure formats are automatically generated.
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. However, Figure 2
was created using 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.