Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
6  
You could simply use \input. –  Stefan Kottwitz Aug 3 '12 at 12:12
    
See also tex.stackexchange.com/questions/59283/…. –  Ahmed Musa Aug 3 '12 at 13:41

1 Answer 1

up vote 2 down vote accepted

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}
share|improve this answer
    
I almost forgot that I have answered this question. –  Who is crazy first Oct 30 '12 at 17:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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