In a tex file, I need to draw a system diagram, so I put it in a separate tex like diagram.tex:
\documentclass[tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (1,1);
\end{tikzpicture}
\end{document}
and then in main.tex:
\documentclass[10pt, a4paper]{article}
\usepackage[UTF8]{ctex}
\begin{document}
\section{sectionA}
\include{diagram} % I also tried input the same error. I wish diagram.tex figure could be inserted at this place.
\subsection{subsectionA}
\section{sectionB}
\end{document}
besides: running diagram.tex alone in latex gives:
! LaTeX Error: File `standalone.cls' not found.Type X to quit or <RETURN> to proceed,or enter new name. (Default extension: cls)Enter file name:! Emergency stop.<read > \usepackage
So the question would be how to insert a standalone tex file? And is it possible to run a standalone tex alone? I am also studying tikz
, while demos I found are mostly using standalone
.
tikzpicture
in a separate file (no\documentclass
etc) then you can simply\input
it. – David Carlisle Feb 7 '18 at 7:48