手册中给出的大多数示例仅显示来自 TiKZ、PGF 和 circuiTiKZ 包的图形。没有单个示例将这些图形嵌入到常规文档中。
答案1
\documentclass{article}
\usepackage{circuitikz}% loads tikz automatically
\usepackage{wrapfig}
\newcommand\atikzpicture{%
\begin{tikzpicture}[baseline=(Q.B)]%baseline is the base of Q
\draw (0,0) to[short, o-] ++(0.5,0)
node[npn, anchor=base](Q){};
\end{tikzpicture}
}
\begin{document}
Basically a Ti\emph{k}Z picture is a box, and you can put it where you like, even in the \atikzpicture\ flow of text; normally you'll have it between paragraph:
\atikzpicture
In the case above, the picture is basically a paragraph by itself, but you can put it even in a formula:
\begin{equation}
\atikzpicture
\end{equation}
\begin{wrapfigure}{r}{0.5\linewidth}
\centering
\atikzpicture
\caption{Look, mum, a transistor!}
\label{fig:one}
\end{wrapfigure}
You can clearly put it in a wrap-figure like in this case where I need to add a bit of text to fill the spaces\dots
Clearly you can use it in a floating figure, so that it can move around in the ``best place'' according to \LaTeX{} point of view\dots
\begin{figure}[htpb!]
\centering
\atikzpicture
\caption{Look, dad, another one!}
\label{fig:two}
\end{figure}
\end{document}
基本上,你不能放一个 Ti钾Z 图片可能位于另一个图片中(例如,作为节点的内容),因此在将其放入移动参数中时需要非常小心。但基本上 --- 它会像您将要处理的那样,比如说,\includegraphics
您应该是安全的。