我使用 standalone 绘制了一些箭头来注释图形。但是,当我输入 [tikz]{standalone} 时,箭头不显示。如果我使用 report 或删除 [tikz],则箭头会显示出来,但是,我希望图形在各自的页面上分开。我该如何实现这一点?感谢您的时间。
\documentclass[tikz]{standalone}
\usepackage{graphicx}
\usepackage{pgfplots,tikz}
\usepackage{textcomp}
\usepackage{fixltx2e}
\usetikzlibrary{shapes,arrows,calc,backgrounds}
\pagestyle{empty}
\begin{document}
\tikzstyle{line} = [draw, -latex']
\tikzstyle{every picture}+=[remember picture]
\begin{tikzpicture}
\node [anchor=south, inner sep=0pt]{\includegraphics[width=4cm]{./graphics/imdligand.pdf}};
\node [anchor=west] (ligand) at (3,2.9) {2x L\textsubscript{IMD}};
\node [anchor=east] (top) at (0.35,4.56) {};
\node [anchor=east] (bottom) at (0.98,1.29) {};
\end{tikzpicture}
\begin{tikzpicture}[overlay]
\path [line,black,thick] (ligand) |- node {}(top);
\path [line,black,thick] (ligand) |- node {}(bottom);
\end{tikzpicture}
\begin{tikzpicture}
\node[anchor=south,inner sep=0pt]{\includegraphics[width=4cm]{./graphics/pyrligand.pdf}};
\node[anchor=west] (ligand2) at (3,4.3) {2x L\textsubscript{PYR}};
\node[anchor=east] (top1) at (0.85,5.9) {};
\node[anchor=east] (bottom2) at (0.85,2.6) {};
\end{tikzpicture}
\begin{tikzpicture}[overlay]
\path [line,black, thick] (ligand2) |-node{}(top1);
\path [line,black,thick] (ligand2) |-node{}(bottom2);
\end{tikzpicture}
\end{document}
答案1
当您使用该类的选项时,每个选项tikzpicture
都会开始一个新页面。这样可以防止图片出现,因为没有任何东西可以覆盖它。tikz
standalone
overlay
为了避免这种情况,只需将箭头包含在tikzpicture
相关图形的环境中。
例如:
\documentclass[tikz,multi,border=10pt]{standalone}
\usetikzlibrary{arrows}
\begin{document}
\tikzset{% \tikzstyle is deprecated
line/.style = {draw, -latex'}}
\begin{tikzpicture}
\node [anchor=south, inner sep=0pt]{\includegraphics[width=4cm]{example-image-a}};
\node [anchor=west] (ligand) at (3,2.9) {2x L\textsubscript{IMD}};
\node [anchor=east] (top) at (0.35,4.56) {};
\node [anchor=east] (bottom) at (0.98,1.29) {};
\path [line,black,thick] (ligand) |- node {}(top);
\path [line,black,thick] (ligand) |- node {}(bottom);
\end{tikzpicture}
\begin{tikzpicture}
\node[anchor=south,inner sep=0pt]{\includegraphics[width=4cm]{example-image-b}};
\node[anchor=west] (ligand2) at (3,4.3) {2x L\textsubscript{PYR}};
\node[anchor=east] (top1) at (0.85,5.9) {};
\node[anchor=east] (bottom2) at (0.85,2.6) {};
\path [line,black, thick] (ligand2) |-node{}(top1);
\path [line,black,thick] (ligand2) |-node{}(bottom2);
\end{tikzpicture}
\end{document}