[UPDATE]
I'm sorry, if my question is less clear. I mean is how to simplify the writing of syntax in main.tex to display images with the same settings,
\begin{figure}[ht]
\centering
\includegraphics{Pictures/pic1.png}
\caption{Picture 1}
\label{fig:pic1}
\end{figure}
with just write, maybe,
\includegraphics[caption,label]{pic1.png}
[ORIGINAL QUESTION]
I am writing an ebook that contains some of graphics. Some of them generated by code (using TikZ), for example pic1.tex
. I think it will be easier to edit if they save in a separated file. I drop all graphics in a folder named Pictures. I named all graphics with the same prefix pic
, for example pic2.png, pic3.jpg, etc.
How to include them with a minimal code, say:
\include{pic1.tex}
Than
\begin{figure}[h]
\centering
\includegraphics{Pictures/pic1.tex}
\caption{Picture 1}
\label{fig:pic1}
\end{figure}
figure
environment. You can just use theincludegraphics
command, thus saving some typing. Wether that's very useful is another different question :)\include
is for bigger pieces of text and it always emits a\clearpage
, so it's definitely not good for such usages;\input
is what you're looking for.\includegraphics
is for embedding driver dependent non-TeX graphic files (Postscript, PDF, PNG, etc.), which are not processed by TeX. TikZ code is TeX code and needs to be digested by TeX. Therefore\inlcudegraphics
doesn't work here.