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...?

2
3

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}
1
  • 1
    I almost forgot that I have answered this question. – kiss my armpit Oct 30 '12 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.