0

I would like to extract images and TikZ diagrams as separate pdf files for each diagram on overleaf. Each output should contain only single image without extra spaces. I could not find an automated solution for this. Currently, I have prepared minimalExport.tex for this purpose as below. If I have modified the documentclass as article, the error is disappeared but it is not what I really need because the image is placed on a paper rather than squeezing the outer rectangle of image. How can I eliminate this error ?

I have also tried other solutions which were commented out on the below code because there was no success. Do you think this method makes sense once you would like to export each diagram as vector file (.pdf) from your latex document ?

%\documentclass{article}
\documentclass{standalone}

%\usepackage{standalone} %\usepackage[pdftex,active,tightpage]{preview} %\usepackage[mode=buildnew,subpreambles=true]{standalone}

\usepackage{float, graphicx}

\def\DiagramTemp{ \begin{figure}[h] \centering \resizebox{0.7\linewidth}{!}{ \includegraphics{img/overleaf-logo.png} } \end{figure} }

\begin{document} \DiagramTemp{} \end{document}

The error output on overleaf:

LaTeX Error: Something's wrong--perhaps a missing \item.

‪jot-latex-template/minimini.tex, 22‬ There are no entries found in a list you have created. Make sure you label list entries using the \item command, and that you have not used a list inside a table. Learn more See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.22 \DiagramTemp {} Try typing <return> to proceed. If that doesn't work, type X <return> to quit.

enter image description here

ozturkib
  • 160

0 Answers0