0

I have to embed four documents{standalone} in another document{article}. \includestandalone is not working for me. (I have the data in the same folder, therefore the /./) I tried to include with this code:

\begin{figure} \includestandalone[width=\textwidth]
{/./name_of_document_to_embedd} 
\caption{My TikZ picture}
\label{..} 
\end{figure}

Ps.: Furthermore I'm asked to include a \ref{..} so it's possible to put a reference to the graphics and put two document-plots next to each other with \minipage (but first I need to solve the including problem).

.

.

Errors returned

  • What does "not work" mean? – Torbjørn T. Jun 2 '18 at 13:24
  • If yourdiagram.tex is in the same folder as your main .tex file, then use \includestandalone{yourdiagram}. You could use \includestandalone{./yourdiagram}, but that isn't needed. \includestandalone{/./yourdiagram} is wrong. – Torbjørn T. Jun 2 '18 at 13:30
  • With "not working" is ment i got several errors (screenshot coming) and i tried different versions for giving the path; ./ or putting nothing in front of the name is both giving errors too. – Don Ky Jun 2 '18 at 13:42
  • 2
    Try not using ä in the filename. – Torbjørn T. Jun 2 '18 at 13:49
2

The warning in your screenshot might give a hint to the cause. Note it looks for a filename Attraktivit\IeC{\"a}t_.... Probably best to stick to only the English alphabet in filenames, and not use ä.

As for side by side figures, the usual method (e.g. Two figures side by side) works fine. Make sure you place the \label after or within the \caption, and cross references with \ref etc. works as expected.

\documentclass{article}
\usepackage{tikz}
\usepackage{standalone}

%---------
% the following is only to make the example self-contained
\usepackage{filecontents}
\begin{filecontents*}{draw_ing.tex}
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node{foo};
\end{tikzpicture}
\end{document}
\end{filecontents*}
%---------

\begin{document}
\begin{figure}
\begin{minipage}{0.45\linewidth}
  \includestandalone[width=\textwidth]{draw_ing} 
  \caption{My TikZ picture}
  \label{a}
\end{minipage} 
\begin{minipage}{0.45\linewidth}
  \includestandalone[width=\textwidth]{draw_ing} 
  \caption{My TikZ picture}
  \label{b}
\end{minipage}
\end{figure}

See figure \ref{a} or \ref{b}.
\end{document} 

enter image description here

  • This solved my problem completly, thank you very much and enjoy this sunday. – Don Ky Jun 3 '18 at 10:31

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.