
다음 문서
\documentclass[11pt,a4paper]{report}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[remember picture]
\node [draw] (a) {%
\begin{tabular}{l}
line 1 \\
line 2
\begin{tikzpicture}[remember picture]
\coordinate (line2);
\end{tikzpicture}
\\
line 3 \\
line 4 \\
\end{tabular}
};
\node [draw, right=5cm of line2] (a) {a};
\draw (line2) -- (a);
\end{tikzpicture}
\end{document}
pdflatex
using dvips
및 then을 사용하여 PDF로 컴파일하면 다른 결과가 나타납니다 ps2pdf
.
예를 들어, 다음은 다음에서 생성된 (예상) 수치입니다 pdflatex
.
dvips
그리고 다음은 and가 생성한 (잘못된) 수치입니다 ps2pdf
.
이유는 무엇이며, 결과가 항상 에서 생성된 것과 같도록 수정하려면 어떻게 해야 합니까 pdflatex
?
답변1
remember picture
via 의 TikZ/pgf 버그입니다 latex-dvips-ps2pdf
...
이 특별한 경우에 matrix
라이브러리는 우아한 해결 방법을 제공합니다( pdflatex
및 을 통해 작업 latex-dvips-ps2pdf
).
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}[remember picture]
\matrix [draw,matrix of nodes] (m){
line 1 \\ % node m-1-1
line 2 \\ % node m-2-1
line 3 \\
line 4 \\
};
\node [draw, right=5cm of m-2-1] (a) {a};
\draw (m-2-1) -- (a);
\end{tikzpicture}
\end{document}