3

I have a tikz picture in a tex file

\begin{figure}[ht!]
\begin{center}
\resizebox{.4\textwidth}{!}{\begin{tikzpicture}[
....

\end{tikzpicture}}
\end{center}
\end{figure}

The ... portion is quite long. Is it possible to put the ... portion in a file and load it with code like \include...?

william007
  • 4,781

1 Answers1

4

Adapt the following code!

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents*}{tikzcode.tex}
\documentclass[tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
    \fill[red] (1,2) circle (3);
\end{tikzpicture}
\end{document}
\end{filecontents*}

\usepackage{tikz}
\usepackage{standalone}
\begin{document}
\input{tikzcode.tex}
\end{document}