
\documentclass{book}
\usepackage{graphs}
\usetikzlibrary{graphs}
\begin{doument}
\begin{tikzpicture}[new set=import nodes]
\begin{scope}[nodes={set=import nodes}] % make all nodes part of this set
\node [red] (a) at (0,1) {$a$};
\node [red] (b) at (1,1) {$b$};
\node [red] (d) at (2,1) {$d$};
\end{scope}
\graph {
(import nodes);
% "import" the nodes
a -> b -> c -> d -> e;
};
\end{tikzpicture}
\end{document}
이 코드를 컴파일할 때 오류가 발생했습니다.
! LaTeX Error: File `graphs.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
답변1
LaTeX는 기존 패키지만 로드할 수 있습니다. 존재하지 않는 것을 로드하려고 하면 오류 메시지가 표시됩니다.
graphs.sty
내 시스템에 존재하지 않습니다 . 아마도 당신이 원하는 패키지는 TikZ일 것 같습니다.
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary{graphs}
\begin{document}
\begin{tikzpicture}[new set=import nodes]
\begin{scope}[nodes={set=import nodes}] % make all nodes part of this set
\node [red] (a) at (0,1) {$a$};
\node [red] (b) at (1,1) {$b$};
\node [red] (d) at (2,1) {$d$};
\end{scope}
\graph {
(import nodes);
% "import" the nodes
a -> b -> c -> d -> e;
};
\end{tikzpicture}
\end{document}