1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
\begin{function}{image}
The behavior of the \pkg{ikzinput} package is determined by whether the |image| option
is given. If it is not, then the \pkg{tikz} package is loaded, all other options are
passed on to it and |\tikzinput{|\meta{file}|}| inputs the TIKZ file \meta{file}|.tex|;
if not, only the \pkg{graphicx} package is loaded and |\tikzinput{|\meta{file}|}| loads
an image file \meta{file}|.|\meta{ext} generated from \meta{file}|.tex|.
\end{function}
The selective input functionality of the \pkg{tikzinput} package assumes that the TIKZ
pictures are externalized into a standalone picture file, such as the following one
\begin{latexcode}
\documentclass{standalone}
\usepackage{tikz}
\usetikzpackage{...}
\begin{document}
\begin{tikzpicture}
...
\end{tikzpicture}
\end{document}
\end{latexcode}
The \pkg{standalone} class is a minimal {\LaTeX} class that when loaded in a document
that uses the \pkg{standalone} package: the preamble and the |documenat| environment
are disregarded during loading, so they do not pose any problems. In effect, an
|\input| of the file above only sees the |tikzpicture| environment, but the file itself
is standalone in the sense that we can run {\LaTeX} over it separately, e.g. for
generating an image file from it.
\begin{function}{\tikzinput,\ctikzinput}
This is exactly where the \pkg{tikzinput} package comes in: it supplies the |\tikzinput|
macro, which -- depending on the |image| option -- either directly inputs the TIKZ
picture (source) or tries to load an image file generated from it.
Concretely, if the |image| option is not set for the \pkg{tikzinput} package, then
|\tikzinput[|\meta{opt}|]{|\meta{file}|}| disregards the optional argument \meta{opt}
and inputs \meta{file}|.tex| via |\input| and resizes it to as specified in the |width|
and |height| keys. If it is, |\tikzinput[|\meta{opt}|]{|\meta{file}|}| expands to
|\includegraphics[|\meta{opt}|]{|\meta{file}|}|.
|\ctizkinput| is a version of |\tikzinput| that is centered.
\end{function}
\begin{function}{\mhtikzinput,\cmhtikzinput}
|\mhtizkinput| is a variant of |\tikzinput| that treats its file path argument as a
relative path in a math archive in analogy to \stexcode|\inputref|. To give the archive
path, we use the |mhrepos=| key. Again, |\cmhtizkinput| is a version of |\mhtikzinput|
that is centered.
\end{function}
\begin{function}{\libusetikzlibrary}
Sometimes, we want to supply archive-specific TIKZ libraries in the |lib| folder of the
archive or the |meta-inf/lib| of the archive group. Then we need an analogon to
\stexcode|\libinput| for \stexcode|\usetikzlibrary|. The \pkg{stex-tikzinput} package
provides the \stexcode|libusetikzlibrary| for this purpose.
\end{function}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../stex-manual"
%%% End:
|