独立包:将多个 tikzpictures 转换为 png

独立包:将多个 tikzpictures 转换为 png

我想在 imagemagick 的帮助下直接在 latex 中将多个 tikzpictures 导出为 png。我在 mac 上使用 texifier。当前代码仅适用于一张图片,其余图片均未导出。我使用修改后的 standaloneconfig 文件:

\standaloneconfig{
  multi=tikzpicture,
  crop=true,
  convert={
    density=300,
    convertexe=convert,
    outext=.png,
    command={%
      \convertexe\space
      -density 300\space 
      \infile\space
      -quality 90\space 
      \outfile
    }
  }
}

乳胶代码本身如下所示:

\documentclass[tikz]{standalone}

\begin{document}

\begin{tikzpicture}
    % Define high-contrast colors
    \definecolor{brightyellow}{rgb}{1, 1, 0.6} % Bright yellow
    \definecolor{brightcyan}{rgb}{0.6, 1, 1} % Bright cyan
    \definecolor{brightmagenta}{rgb}{1, 0.6, 1} % Bright magenta

    % First ellipse
    \def\firstellipse{(-4,0) ellipse (8 and 3)}
    % Fill the first ellipse with bright yellow
    \fill[brightyellow] \firstellipse;
    % Draw the outline of the first ellipse with wider line
    \draw[line width=2pt] \firstellipse;
    % Label for the first ellipse
    \node[draw=none] at (-10,0) {\Huge $A$};
    
    \draw[line width=2pt] (-15,-8) rectangle ++(30,16);
    \node[draw=none] at (-14,7) {\Huge $\Omega$};
\end{tikzpicture}

\begin{tikzpicture}
    % Define high-contrast colors
    \definecolor{brightyellow}{rgb}{1, 1, 0.6} % Bright yellow
    \definecolor{brightcyan}{rgb}{0.6, 1, 1} % Bright cyan
    \definecolor{brightmagenta}{rgb}{1, 0.6, 1} % Bright magenta

    % Second ellipse
    \def\secondellipse{(4,0) ellipse (8 and 3)}
    % Fill the second ellipse with bright cyan
    \fill[brightcyan] \secondellipse;
    % Draw the outline of the second ellipse with wider line
    \draw[line width=2pt] \secondellipse;
    % Label for the second ellipse
    \node[draw=none] at (10,0) {\Huge $B$};

    % Optional: Draw a surrounding rectangle
    \draw[line width=2pt] (-15,-8) rectangle ++(30,16);
    \node[draw=none] at (-14,7) {\Huge $\Omega$};
\end{tikzpicture}
\end{document}

我怎样才能更改 standalone.cfg 文件或 latex 文件,以便获得多个

相关内容