Recently, I learnt about the matlab code matlab2tikz
. The output of this code is a .tikz
file that can be used, I guess, alongside standard figure packages with a simple line \input{mysphere.tikz}
in the figure environment.
This got me wondering if .tikz
is a common way to include the TikZ code in your manuscript. It would be convenient for me to save TikZ scripts in separate files instead of having them all in my final manuscript. This will make my manuscript(s) more readable. Can anyone advise me in this regard?
I searched the pgfmanual
for the string .tikz
but found no results. I am still searching the web for examples of .tikz
files.
(I asked this question TeX.SeX
chat a few minutes ago and ported it here on the advise of @WillHunting
.)
standalone
package and class. With this you can have thetikz
figures in a separate file which can be compiled by itself, and also be included in the main document.mysphere.tikz
is not a complete document and just the picture environment, then you should create amysphere.tex
(either by copying the code frommysphere.tikz
, or using\input{mysphere.tikz}
) using thestandalone
class. Now,mysphere.tex
can be compiled to view/tweak the figure as necessary.\input{filename.ext}
command. I just realized after reading the wikibook onLaTeX
..tikz
file extension to make things clearer to you what the file contains. (Adding this also helps to link the questions in the 'related' pane on the right hand side of the site...)