2

I am trying to include several Tikz figures drawn in R, below eachother in a Latex file. It keeps including the figures at the top of new pages.

Is there an easy way to make this work? The simple include command does not allow the float argument[H] which I use for other figures:

\input{C:/Users/Desktop/Res/Pictures/pic1.tex} \\
\input{C:/Users/Desktop/Res/Pictures/pic2.tex}

The following does not work:

\input[H]{C:/Users/Desktop/Res/Pictures/pic1.tex}

In R, the Tikz file was created using:

tikz("C:/Users/Desktop/Res/Pictures/pic1.tex",width=5,height=4)
...
dev.off
3
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – henry
    Commented Jun 10, 2015 at 9:05
  • 1
    Please also add an example of file you want to embed (R-generated TikZ pictures).
    – Astrinus
    Commented Jun 10, 2015 at 9:06
  • The tikz files are very long and won't make much sense posting? Is there a generic way to have Latex not do a \newpage after \input? I.e., have something similar to: `\input[H]{C:/Users/Desktop/Res/Pictures/pic2.tex}
    – Nick
    Commented Jun 10, 2015 at 9:11

1 Answer 1

2

Compile your original Tikz pictures using the standalone document class.

Then in your main file, add \usepackage{standalone} and then write \input{<tikzpicture name>.tex}; assuming they are located in the same folder, you won't need a path.

If you want it to appear where you have included it, then enclose it in a figure environment like:

\begin{figure}[h]
    \centering
\input{<tikzpicture name>.tex}
\end{figure}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .