我想将图片和 TikZ 图表提取为 overleaf 上每个图表的单独 pdf 文件。每个输出应仅包含单个图像,没有多余的空格。我找不到自动化解决方案。目前,我已为此目的做好了minimalExport.tex
如下准备。如果我修改了documentclass
as article
,错误就会消失,但这不是我真正需要的,因为图像放在纸上,而不是挤压图像的外部矩形。我该如何消除这个错误?
我也尝试过其他解决方案,但由于没有成功,因此在下面的代码中将其注释掉。当您想将每个图表从 latex 文档导出为矢量文件 (.pdf) 时,您认为这种方法有意义吗?
%\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}
背面的错误输出:
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.