업데이트

업데이트

여러 세그먼트로 구성된 그림을 작성 중인데 tikz가 이를 좋아하지 않는 것 같습니다. 그래서 나는 다음과 같이 덧붙였습니다.

\usepgfplotslibrary{external} 
\usetikzlibrary{matrix,chains,positioning,decorations.pathreplacing,arrows} 
\tikzexternalize

잘 작동했고, 갑자기 호가 하나만 더 있으면 컴파일이 차단됩니다.

\write18 enabled.
entering extended mode

myFigure.log를 보면 잘못된 내용을 볼 수 없습니다. 그것은로 끝난다

Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is availabl 

오류 메시지가 전혀 없어서 어디서 찾아야 할지 정말 모르겠습니다.

다음은 내 시스템에서 컴파일되지 않는 2개의 그림의 예입니다.

\documentclass[11pt,a4]{article}
\usepackage{graphics}
\usepackage{url}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[dcucite,abbr]{harvard}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{external}
\usetikzlibrary{matrix,chains,positioning,decorations.pathreplacing,arrows}
\tikzexternalize

\textwidth 150mm \textheight 230mm \topmargin -20mm
\renewcommand{\baselinestretch}{1.25}
\marginparwidth 17mm
\oddsidemargin 7mm
\newcommand{\cvd}{\hfill\raisebox{3pt}{\fbox{\rule{0mm}{1mm}\hspace*{1mm}\rule{0mm}{1mm}}\,} \vspace{5mm}}
\newcommand{\proof}{\vspace{1mm}\noindent{\it Proof}\quad}
\renewcommand{\thefootnote}{\arabic{footnote}}
\newcounter{bean}

\date{}

\begin{document}
\pagestyle{empty}

\begin{figure}[h]\begin{center}

\begin{tikzpicture}[
init/.style={
  draw,
  circle,
  inner sep=2pt,
  font=\Huge,
}]
\matrix[row sep= 5mm, column sep=8mm] (m) {
\node [init] (x0) {}; & \node [init] (x1) {}; & \node[init] (x2) {}; & \node[init] (x3) {}; & \node[init] (x4) {}; & \node[init] (x5) {}; & \node[init] (x6) {}; & \node[init] (x7) {};\\
\node [init] (y0) {}; & \node [init] (y1) {}; & \node[init] (y2) {}; & \node[init] (y3) {}; & \node[init] (y4) {}; & \node[init] (y5) {}; & \node[init] (y6) {}; & \node[init] (y7) {};\\
\node [init] (z0) {}; & \node [init] (z1) {}; & \node[init] (z2) {}; & \node[init] (z3) {}; & \node[init] (z4) {}; & \node[init] (z5) {}; & \node[init] (z6) {}; & \node[init] (z7) {};\\
};

\node [init, left=of m] (s) {$s$};

\node [init, right=of m] (e) {$e$};

\path (s) edge[->, dotted] (x0);
\path (s) edge[->, dotted] (y0);
\path (s) edge[->, dotted] (z0);
\path (s) edge[->, dotted] (x1);
%\path (s) edge[->, dotted] (y1);
\path (s) edge[->, thick] (z1);
\path (s) edge[->, dotted] (x2);
%\path (s) edge[->, dotted] (y2);
\path (s) edge[->, dotted] (z2);
\path (s) edge[->, dotted] (x3);
%\path (s) edge[->, dotted] (y3);
\path (s) edge[->, dotted] (z3);
\path (s) edge[->, dotted] (x4);
%\path (s) edge[->, dotted] (y4);
\path (s) edge[->, dotted] (z4);
\path (s) edge[->, dotted] (x5);
%\path (s) edge[->, dotted] (y5);
\path (s) edge[->, dotted] (z5);
\path (s) edge[->, dotted] (x6);
%\path (s) edge[->, dotted] (y6);
\path (s) edge[->, dotted] (z6);
\path (s) edge[->, dotted] (x7);
%\path (s) edge[->, dotted] (y7);
\path (s) edge[->, dotted] (z7);

\path (x0) edge[->, dotted] (x1);
\path (x0) edge[->, dotted] (y1);
\path (x0) edge[->, dotted] (z1);
\path (y0) edge[->, dotted] (x1);
\path (y0) edge[->, dotted] (y1);
\path (y0) edge[->, dotted] (z1);
\path (z0) edge[->, dotted] (x1);
\path (z0) edge[->, dotted] (y1);
\path (z0) edge[->, dotted] (z1);

\path (x1) edge[->, dotted] (x2);
\path (x1) edge[->, dotted] (y2);
\path (x1) edge[->, dotted] (z2);
\path (y1) edge[->, dotted] (x2);
\path (y1) edge[->, dotted] (y2);
\path (y1) edge[->, dotted] (z2);
\path (z1) edge[->, dotted] (x2);
\path (z1) edge[->, thick] (y2);
\path (z1) edge[->, dotted] (z2);

\path (x2) edge[->, dotted] (x3);
\path (x2) edge[->, dotted] (y3);
\path (x2) edge[->, dotted] (z3);
\path (y2) edge[->, dotted] (x3);
\path (y2) edge[->, thick] (y3);
\path (y2) edge[->, dotted] (z3);
\path (z2) edge[->, dotted] (x3);
\path (z2) edge[->, dotted] (y3);
\path (z2) edge[->, dotted] (z3);

\path (x3) edge[->, dotted] (x4);
\path (x3) edge[->, dotted] (y4);
\path (x3) edge[->, dotted] (z4);
\path (y3) edge[->, dotted] (x4);
\path (y3) edge[->, thick] (y4);
\path (y3) edge[->, dotted] (z4);
\path (z3) edge[->, dotted] (x4);
\path (z3) edge[->, dotted] (y4);
\path (z3) edge[->, dotted] (z4);

\path (x4) edge[->, dotted] (x5);
\path (x4) edge[->, dotted] (y5);
\path (x4) edge[->, dotted] (z5);
\path (y4) edge[->, thick] (x5);
\path (y4) edge[->, thick] (y5);
\path (y4) edge[->, dotted] (z5);
\path (z4) edge[->, dotted] (x5);
\path (z4) edge[->, dotted] (y5);
\path (z4) edge[->, dotted] (z5);

\path (x5) edge[->, thick] (x6);
\path (x5) edge[->, dotted] (y6);
\path (x5) edge[->, dotted] (z6);
\path (y5) edge[->, thick] (x6);
\path (y5) edge[->, dotted] (y6);
\path (y5) edge[->, dotted] (z6);
\path (z5) edge[->, dotted] (x6);
\path (z5) edge[->, dotted] (y6);
\path (z5) edge[->, dotted] (z6);

\path (x6) edge[->, thick] (x7);
\path (x6) edge[->, dotted] (y7);
\path (x6) edge[->, dotted] (z7);
\path (y6) edge[->, dotted] (x7);
\path (y6) edge[->, dotted] (y7);
\path (y6) edge[->, dotted] (z7);
\path (z6) edge[->, dotted] (x7);
\path (z6) edge[->, dotted] (y7);
\path (z6) edge[->, dotted] (z7);

\path (x0) edge[->, dotted] (e);
%\path (y0) edge[->, dotted] (e);
\path (z0) edge[->, dotted] (e);
\path (x1) edge[->, dotted] (e);
%\path (y1) edge[->, dotted] (e);
\path (z1) edge[->, dotted] (e);
\path (x2) edge[->, dotted] (e);
%\path (y2) edge[->, dotted] (e);
\path (z2) edge[->, dotted] (e);
\path (x3) edge[->, dotted] (e);
%\path (y3) edge[->, dotted] (e);
\path (z3) edge[->, dotted] (e);
\path (x4) edge[->, dotted] (e);
%\path (y4) edge[->, dotted] (e);
\path (z4) edge[->, dotted] (e);
\path (x5) edge[->, dotted] (e);
%\path (y5) edge[->, dotted] (e);
\path (z5) edge[->, dotted] (e);
\path (x6) edge[->, dotted] (e);
%\path (y6) edge[->, dotted] (e);
\path (z6) edge[->, dotted] (e);
\path (x7) edge[->, dotted] (e);
\path (x7) edge[->, thick] (e);
\path (z7) edge[->, dotted] (e);

\node [left=of x0, xshift=-1cm] (A1) {A};
\node [left=of y0, xshift=-1cm] (A2) {B};
\node [left=of z0, xshift=-1cm] (A3) {C};

\node [above=of A1] (types) {Title 1};
\node [above=of m] (types) {Title 2};

\node [below=of z0, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{a}};
\node [below=of z1, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{b}};
\node [below=of z2, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{c}};
\node [below=of z3, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{d}};
\node [below=of z4, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{e}};
\node [below=of z5, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{f}};
\node [below=of z6, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{g}};
\node [below=of z7, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{h}};

\end{tikzpicture}

\end{center}\end{figure}

\begin{figure}[h!]\begin{center}

\begin{tikzpicture}[
init/.style={
  draw,
  circle,
  inner sep=2pt,
  font=\Huge,
  %join = by -latex
}]
\matrix[row sep= 5mm, column sep=8mm] (m) {
\node [init] (x0) {}; & \node [init] (x1) {}; & \node[init] (x2) {}; & \node[init] (x3) {}; & \node[init] (x4) {}; & \node[init] (x5) {}; & \node[init] (x6) {}; & \node[init] (x7) {};\\
\node [init] (y0) {}; & \node [init] (y1) {}; & \node[init] (y2) {}; & \node[init] (y3) {}; & \node[init] (y4) {}; & \node[init] (y5) {}; & \node[init] (y6) {}; & \node[init] (y7) {};\\
\node [init] (z0) {}; & \node [init] (z1) {}; & \node[init] (z2) {}; & \node[init] (z3) {}; & \node[init] (z4) {}; & \node[init] (z5) {}; & \node[init] (z6) {}; & \node[init] (z7) {};\\
};

\node [init, left=of m] (s) {$s$};

\node [init, right=of m] (e) {$e$};

\path (s) edge[->, dotted, very thick] node {\textbf{7}} (x0);
\path (s) edge[->, dotted, very thick] node {\textbf{1}} (y0);
\path (s) edge[->, dotted, very thick] node {\textbf{2}} (z0);
\path (s) edge[->, dotted] (x1);
\path (s) edge[->, dotted] (e);
\path (s) edge[->, dotted] (z1);
\path (s) edge[->, dotted] (x2);
\path (s) edge[->, dotted] (z2);
\path (s) edge[->, dotted] (x3);
\path (s) edge[->, dotted] (z3);
\path (s) edge[->, dotted] (x4);
\path (s) edge[->, dotted] (z4);
\path (s) edge[->, dotted] (x5);
\path (s) edge[->, dotted] (z5);
\path (s) edge[->, dotted] (x6);
\path (s) edge[->, dotted] (z6);
\path (s) edge[->, dotted] (x7);
\path (s) edge[->, dotted] (z7);

\path (x0) edge[->, dotted, very thick] node {\textbf{7}} (x1);
\path (x0) edge[->, dotted] (y1);
\path (x0) edge[->, dotted] (z1);
\path (y0) edge[->, dotted, very thick] node {\textbf{7}} (x1);
\path (y0) edge[->, dotted] (z1);
\path (z0) edge[->, dotted, very thick] node {\textbf{7}} (x1);
\path (z0) edge[->, dotted] (y1);
\path (z0) edge[->, dotted] (z7);

\path (x1) edge[->, dotted] (x7);
\path (x1) edge[->, dotted, very thick] node {\textbf{1}} (y2);
\path (x1) edge[->, dotted] (z2);
\path (y1) edge[->, dotted] (x2);
\path (y1) edge[->, dotted, very thick] node {\textbf{1}} (y2);
\path (y1) edge[->, dotted] (z2);
\path (z1) edge[->, dotted] (x2);
\path (z1) edge[->, dotted, very thick] node {\textbf{1}} (y2);

\path (x2) edge[->, dotted] (y3);
\path (x2) edge[->, dotted, very thick] node {\textbf{2}} (z3);
\path (y2) edge[->, dotted] (x3);
\path (y2) edge[->, dotted, very thick] node {\textbf{2}} (z3);
\path (z2) edge[->, dotted] (x3);
\path (z2) edge[->, dotted] (y3);
\path (z2) edge[->, dotted, very thick] node {\textbf{2}} (z3);

\path (x3) edge[->, dotted] (y4);
\path (x3) edge[->, dotted] (z4);
\path (y3) edge[->, dotted] (x4);
%\path (y3) edge[->, dotted] (y4);
\path (y3) edge[->, dotted] (z4);
\path (z3) edge[->, dotted] (x4);
\path (z3) edge[->, dotted] (y4);
%\path (z3) edge[->, dotted] (z4);
%
%\path (x4) edge[->, dotted] (x5);
\path (x4) edge[->, dotted] (y5);
\path (x4) edge[->, dotted[ (z5);
\path (y4) edge[->, dotted] (x5);
%\path (y4) edge[->, dotted] (y5);
\path (y4) edge[->, dotted] (z5);
%\path (z4) edge[->, dotted] (x5);
%\path (z4) edge[->, dotted] (y5);
%\path (z4) edge[->, dotted] (z5);
%
%\path (x5) edge[->, dotted] (x6);
%\path (x5) edge[->, dotted] (y6);
%\path (x5) edge[->, dotted] (z6);
%\path (y5) edge[->, dotted] (x6);
%\path (y5) edge[->, dotted] (y6);
%\path (y5) edge[->, dotted] (z6);
%\path (z5) edge[->, dotted] (x6);
%\path (z5) edge[->, dotted] (y6);
%\path (z5) edge[->, dotted] (z6);
%
%\path (x6) edge[->, dotted] (x7);
%\path (x6) edge[->, dotted] (y7);
%\path (x6) edge[->, dotted] (z7);
%\path (y6) edge[->, dotted] (x7);
%\path (y6) edge[->, dotted] (y7);
%\path (y6) edge[->, dotted] (z7);
%\path (z6) edge[->, dotted] (x7);
%\path (z6) edge[->, dotted] (y7);
%\path (z6) edge[->, dotted] (z7);
%
%\path (x0) edge[->, dotted] (e);
%\path (y0) edge[->, dotted] (e);
%\path (z0) edge[->, dotted] (e);
%\path (x1) edge[->, dotted] (e);
%\path (y1) edge[->, dotted] (e);
%\path (z1) edge[->, dotted] (e);
%\path (x2) edge[->, dotted] (e);
%\path (y2) edge[->, dotted] (e);
%\path (z2) edge[->, dotted] (e);
%\path (x3) edge[->, dotted] (e);
%\path (y3) edge[->, dotted] (e);
%\path (z3) edge[->, dotted] (e);
%\path (x4) edge[->, dotted] (e);
%\path (y4) edge[->, dotted] (e);
%\path (z4) edge[->, dotted] (e);
%\path (x5) edge[->, dotted] (e);
%\path (y5) edge[->, dotted] (e);
%\path (z5) edge[->, dotted, very thick] node {\textbf{0}} (e);
%\path (x6) edge[->, dotted] (e);
%\path (y6) edge[->, dotted] (e);
%\path (z6) edge[->, dotted] (e);
%\path (x7) edge[->, dotted, very thick] node {\textbf{0}} (e);
%\path (y7) edge[->, dotted, very thick] node {\textbf{0}} (e);
%\path (z7) edge[->, dotted, very thick] node {\textbf{0}} (e);

\node [left=of x0, xshift=-1cm] (A1) {A};
\node [left=of y0, xshift=-1cm] (A2) {B};
\node [left=of z0, xshift=-1cm] (A3) {C};

\node [below=of z0, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{a}};
\node [below=of z1, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{b}};
\node [below=of z2, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{c}};
\node [below=of z3, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{d}};
\node [below=of z4, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{e}};
\node [below=of z5, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{f}};
\node [below=of z6, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{g}};
\node [below=of z7, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{h}};

\end{tikzpicture}

\end{center}\end{figure}

\end{document}

이렇게 하면 test-Figure0.dep, .dpth, .log, .md5 및 .pdf 파일이 생성되지만, Figure1의 경우 PDF를 제외한 모든 파일이 있습니다. TeXShop을 사용하여 'pdflatex -shell-escape'를 기본 명령으로 사용하여 컴파일합니다.

답변1

문제는 edge두 번째 그림의 과도한 숫자로 인해 (정확한 이유를 찾지 못함) "메모리 부족" 오류가 발생하지 않고 컴파일러가 정지된다는 것입니다.

그림을 외부화하는 것은 도움이 되지 않습니다. 결국 pdflatex는 외부 그림에 대해 호출되어야 하고 이로 인해 컴파일러가 다시 정지되기 때문입니다.

코드와 컴파일을 향상시킬 수 있는 두 가지 전략은 다음과 같습니다.

  1. 대신 edge 대신 draw를 \path (a) edge[options] (b);사용하면 \draw[options] (a) -- (b);메모리 소비가 줄어듭니다(이유는 모르겠습니다).

  2. 루프를 사용하세요! 이것이 메모리 소비를 줄이는 이유가 무엇인지 생각할 수 없더라도 적어도 코드를 더 짧고 읽기 쉽고 유지 관리하기 쉽게 만들 것입니다.

이것이 두 번째 수치에 대한 나의 견해입니다.

\begin{tikzpicture}[ 
init/.style={ 
  draw, 
  circle, 
  inner sep=2pt, 
  font=\Huge, 
  %join = by -latex 
}] 
\matrix[row sep= 5mm, column sep=8mm] (m) { 
\node [init] (x0) {}; & \node [init] (x1) {}; & \node[init] (x2) {}; & \node[init] (x3) {}; &             → \node[init] (x4) {}; & \node[init] (x5) {}; & \node[init] (x6) {}; & \node[init] (x7) {};\\ 
\node [init] (y0) {}; & \node [init] (y1) {}; & \node[init] (y2) {}; & \node[init] (y3) {}; &             → \node[init] (y4) {}; & \node[init] (y5) {}; & \node[init] (y6) {}; & \node[init] (y7) {};\\ 
\node [init] (z0) {}; & \node [init] (z1) {}; & \node[init] (z2) {}; & \node[init] (z3) {}; &             → \node[init] (z4) {}; & \node[init] (z5) {}; & \node[init] (z6) {}; & \node[init] (z7) {};\\ 
}; 

\node [init, left=of m] (s) {$s$};     
\node [init, right=of m] (e) {$e$}; 

\foreach \start/\end/\label in { 
    s/x0/7,  s/y0/1,  s/z0/2, 
    x0/x1/7, y0/x1/7, z0/x1/7, 
    x1/y2/1, y1/y2/1, z1/y2/1,
    x2/z3/2, y2/z3/2, z2/z3/2 } {
        \draw[->,dotted,very thick] (\start) -- (\end) node[midway] {\textbf{\label}};
};
\foreach \n [count=\previous from 0] in {1,...,7} {
    \draw[->,dotted] (s) -- (x\n);   \draw[->,dotted] (x\n) -- (e);
    \draw[->,dotted] (s) -- (z\n);   \draw[->,dotted] (z\n) -- (e);
    \draw[->,dotted] (x\previous) -- (y\n);
    \draw[->,dotted] (x\previous) -- (z\n);
    \draw[->,dotted] (y\previous) -- (x\n);
    \draw[->,dotted] (y\previous) -- (z\n);
    \draw[->,dotted] (z\previous) -- (x\n);
    \draw[->,dotted] (z\previous) -- (y\n);
}
\path (s) edge[->, dotted] (e);

\node [left=of x0, xshift=-1cm] (A1) {A};
\node [left=of y0, xshift=-1cm] (A2) {B};
\node [left=of z0, xshift=-1cm] (A3) {C};

\foreach \letter [count=\n from 0]in {a,b,c,d,e,f,g,h} {
    \node [below=of z\n, xshift=-0.3cm, yshift=0.5cm]  {\rotatebox{60}{\letter}};
}
\end{tikzpicture}

이 코드는 문제 없이 컴파일되며 짧은 시간 내에 다음을 생성합니다.

결과

업데이트

일부 누락된 가장자리(글쎄, 의도한 그림이 무엇인지 잘 모르겠습니다)와 노드 사이에 무수히 많은 작은 가장자리를 그리는 부분에서 내부 루프를 사용하여 코드를 훨씬 더 압축할 수 있는 기회가 있음을 확인했습니다.

\foreach \n [count=\previous from 0] in {1,...,7} {
    \draw[->,dotted] (s) -- (x\n);   \draw[->,dotted] (x\n) -- (e);
    \draw[->,dotted] (s) -- (z\n);   \draw[->,dotted] (z\n) -- (e);
    \foreach \s in {x,y,z} {
       \foreach \e in {x,y,z} {
          \draw[->,dotted] (\s\previous) -- (\e\n);
        }
    }
}

결과는 다음과 같습니다.

새로운 결과

관련 정보