TikZ 森林忽略 tikzsetnextfilename

TikZ 森林忽略 tikzsetnextfilename

我有下一个结构

主文本

\documentclass[12pt]{report}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Draws & diagrams

\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows.meta, shadows}
\usetikzlibrary{external}

% Compile with --shell-escape
\usepackage[edges, external]{forest}
\tikzexternalize[prefix=externalization/]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NewDocumentCommand{\inputdiagram}{m}{
    \tikzsetnextfilename{#1}
    \input{diagrams/#1.tex}
}

\begin{document}
    \inputdiagram{FirstDiagram}
\end{document}

FirstDiagram.tex

\begin{forest}
    forked edges,
    for tree = {
        anchor = center,
        rectangle,
        if = {level == 0}{
            l sep = 10mm,
            outer color= lilac,
            text width = 0.25\linewidth,
            for tree = {
                for children = {
                    grow'=0,
                    folder
                }
            }
        }{},
    },
    [Nivel 0
        [Nivel 1.1
            [Nivel 2.1.1]
            [Nivel 2.1.2]
            [Nivel 2.1.3]
        ]
        [Nivel 1.2
            [Nivel 2.2.1]
            [Nivel 2.2.2]
        ]
        [Nivel 1.3
            [Nivel 2.3.1]
            [Nivel 2.3.2]
        ]
        [Nivel 1.4
            [Nivel 2.4.1]
            [Nivel 2.4.2]
            [Nivel 2.4.3]
        ]
    ]
\end{forest}

我正在创建一个简单的图表,但是当我尝试将其外部化时,森林只是忽略\tikzsetnextfilename并创建Main-forest-1Main-forest-2等。

Z 它运行得很好,创建了具有指定名称的文件。是否可以为林外部化设置名称?

相关内容