Overleaf で tikz/standalone を外部化する適切な使用方法

Overleaf で tikz/standalone を外部化する適切な使用方法

私は基本的なTexファイルセットを持っていて、メインファイルは他の3つのファイル、、およびtest0.texでTikzを使用して生成された画像を読み込もうとします。これは私が書いたものですtest1.textest2.textest3.tex

%%%%%%%% test0.tex %%%%%%%%%
\documentclass{article}

%%%%%%%%%%%%%%%%%% Pre-Load Packages Order %%%%%%%%%%%%%%%%%%%
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage[mode=buildnew,group=true,subpreambles=false]{standalone} % For side loaded Tikz Figures
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%% Packages %%%%%%%%%%%%%%%%%%%
\usepackage{graphicx} % for Figures
\usepackage{pgfplots} % For plotting
\usepackage{tikz} % For the background and plotting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



\title{TBD}
\author{Boaty McBoatface}

\begin{document}
\begingroup
\let\newpage\relax%
\maketitle
\endgroup

\begin{figure}[h]\centering
    \begin{minipage}{4in}
        \centering
        \includegraphics[trim={0pt 0pt 0pt 0pt},clip,width=0.55\textwidth]{test1.pdf}
    \end{minipage}
    
    \begin{minipage}{4in}
        \centering
        \includegraphics[trim={0pt 0pt 0pt 0pt},clip,width=0.55\textwidth]{test2.pdf}
    \end{minipage}

    \begin{minipage}{4in}
        \centering
        \includegraphics[trim={0pt 0pt 0pt 0pt},clip,width=0.55\textwidth]{test3.pdf}
    \end{minipage}
    \caption{}
\end{figure}


\end{document}
%%%%%%%% test1.tex %%%%%%%%%
\documentclass[margin=10pt,tikz]{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}

\usetikzlibrary{positioning}
\pgfplotsset{compat=newest} 


\begin{document}

\begin{tikzpicture}[every axis/.append style={width=0.5\linewidth,title style={align=center}}]
\begin{axis}
     \addplot coordinates { (1,2) (2,3) (3,0)};
\end{axis}
\draw[-,line width=0.25mm] (-1,-13.4) -- (21.25,-13.4);
\draw[-,line width=0.25mm] (-1,-13.4) -- (-1,3.7);
\node[below, yshift=-5mm] at (10.375,-13.4) {{\huge $Y$}};
\node[left, xshift=-1cm, rotate=90] at (-1,-3.9) {{\huge $X$}};
\draw[-,line width=0.25mm] (-0.75,1.81) -- (-1,1.81)     node[left]  {{\LARGE$5$}};
\draw[-,line width=0.25mm] (-0.75,-2.35) -- (-1,-2.35)   node[left]  {{\LARGE $3.4$}};
\draw[-,line width=0.25mm] (-0.75,-6.51) -- (-1,-6.51)   node[left]  {{\LARGE $1.7$}};
\draw[-,line width=0.25mm] (-0.75,-10.67) -- (-1,-10.67) node[left]  {{\LARGE $0.1$}};
\draw[-,line width=0.25mm] (2.19, -13.15) -- (2.19,-13.4) node[below]     {{\LARGE $0$}};
\draw[-,line width=0.25mm] (7.79, -13.15) -- (7.79,-13.4) node[below]   {{\LARGE $1$}};
\draw[-,line width=0.25mm] (13.34,-13.15) -- (13.34,-13.4) node[below]   {{\LARGE $2$}};
\draw[-,line width=0.25mm] (18.89,-13.15) -- (18.89,-13.4) node[below] {{\LARGE $3$}};
\node[] at (10.375,4.5) {{\Huge Title \#1}};
\end{tikzpicture}

\end{document}
%%%%%%% test2.text %%%%%%%
\documentclass[margin=10pt,tikz]{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}

\usetikzlibrary{positioning}
\pgfplotsset{compat=newest} 


\begin{document}

\begin{tikzpicture}[every axis/.append style={width=0.5\linewidth,title style={align=center}}]
\begin{axis}
     \addplot coordinates { (-1,-1) (1,0) (-2,3)};
\end{axis}
\draw[-,line width=0.25mm] (-1,-13.4) -- (21.25,-13.4);
\draw[-,line width=0.25mm] (-1,-13.4) -- (-1,3.7);
\node[below, yshift=-5mm] at (10.375,-13.4) {{\huge $Y$}};
\node[left, xshift=-1cm, rotate=90] at (-1,-3.9) {{\huge $X$}};
\draw[-,line width=0.25mm] (-0.75,1.81) -- (-1,1.81)     node[left]  {{\LARGE$5$}};
\draw[-,line width=0.25mm] (-0.75,-2.35) -- (-1,-2.35)   node[left]  {{\LARGE $3.4$}};
\draw[-,line width=0.25mm] (-0.75,-6.51) -- (-1,-6.51)   node[left]  {{\LARGE $1.7$}};
\draw[-,line width=0.25mm] (-0.75,-10.67) -- (-1,-10.67) node[left]  {{\LARGE $0.1$}};
\draw[-,line width=0.25mm] (2.19, -13.15) -- (2.19,-13.4) node[below]     {{\LARGE $0$}};
\draw[-,line width=0.25mm] (7.79, -13.15) -- (7.79,-13.4) node[below]   {{\LARGE $1$}};
\draw[-,line width=0.25mm] (13.34,-13.15) -- (13.34,-13.4) node[below]   {{\LARGE $2$}};
\draw[-,line width=0.25mm] (18.89,-13.15) -- (18.89,-13.4) node[below] {{\LARGE $3$}};
\node[] at (10.375,4.5) {{\Huge Title \#2}};
\end{tikzpicture}

\end{document}
%%%%%%% test3.tex %%%%%%%
\documentclass[margin=10pt,tikz]{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}

\usetikzlibrary{positioning}
\pgfplotsset{compat=newest} 

\begin{document}

\begin{tikzpicture}[every axis/.append style={width=0.5\linewidth,title style={align=center}}]
\begin{axis}
     \addplot coordinates { (1,1) (2,4) (-3,6)};
\end{axis}
\draw[-,line width=0.25mm] (-1,-13.4) -- (21.25,-13.4);
\draw[-,line width=0.25mm] (-1,-13.4) -- (-1,3.7);
\node[below, yshift=-5mm] at (10.375,-13.4) {{\huge $Y$}};
\node[left, xshift=-1cm, rotate=90] at (-1,-3.9) {{\huge $X$}};
\draw[-,line width=0.25mm] (-0.75,1.81) -- (-1,1.81)     node[left]  {{\LARGE$5$}};
\draw[-,line width=0.25mm] (-0.75,-2.35) -- (-1,-2.35)   node[left]  {{\LARGE $3.4$}};
\draw[-,line width=0.25mm] (-0.75,-6.51) -- (-1,-6.51)   node[left]  {{\LARGE $1.7$}};
\draw[-,line width=0.25mm] (-0.75,-10.67) -- (-1,-10.67) node[left]  {{\LARGE $0.1$}};
\draw[-,line width=0.25mm] (2.19, -13.15) -- (2.19,-13.4) node[below]     {{\LARGE $0$}};
\draw[-,line width=0.25mm] (7.79, -13.15) -- (7.79,-13.4) node[below]   {{\LARGE $1$}};
\draw[-,line width=0.25mm] (13.34,-13.15) -- (13.34,-13.4) node[below]   {{\LARGE $2$}};
\draw[-,line width=0.25mm] (18.89,-13.15) -- (18.89,-13.4) node[below] {{\LARGE $3$}};
\node[] at (10.375,4.5) {{\Huge Title \#3}};
\end{tikzpicture}

\end{document}

test0.tex最初から 実行すると、次のようになります:ここに画像の説明を入力してください

ここで、 の行をからtest0.texに変更すると(他の 2 つも同様)、画像が読み込まれます。 \includegraphics[trim={0pt 0pt 0pt 0pt},clip,width=0.55\textwidth]{test1.pdf}\includestandalone[trim={0pt 0pt 0pt 0pt},clip,width=0.55\textwidth]{test1}ここに画像の説明を入力してください

ただし、読み込みが遅くなります (少なくとも、私が使用している実際のプロジェクトでは、かなり大きな数値があるため)。ただし、呼び出す元の行に戻すと、同じ結果がはるかに高速になります。最終的に私が知りたいのは、最初からコンパイルするたびにファイルを再編集しなくても、\includegraphicsを使用するよりも (少なくとも再コンパイル時に) イメージを高速に読み込む方法はあるかということです。\includestandalone

関連情報