将 tikz-figure 作为文本宽度的子文件进行调整(svjour3 模板)?

将 tikz-figure 作为文本宽度的子文件进行调整(svjour3 模板)?

我必须使用 svjour3 文档样式。在我的文档中,我需要包含我在不同文件/章节中创建的故障树。我的问题:不幸的是,树没有调整到文档/文本宽度的正常宽度(见图)

在此处输入图片描述

这是我当前的代码:

\documentclass[smallextended]{svjour3}       

\usepackage{tikz}
\usetikzlibrary{matrix,calc,circuits,calc,arrows,positioning}
\usetikzlibrary{circuits.logic.US} 
\usepackage{tikz-timing}
\def\degr{${}^\circ$}

\usepackage{subfiles}
\usepackage{blindtext}

\begin{document}

\blindtext  
\subfile{Chapters/extension fault tree}
\blindtext
    
\end{document}

我尝试了类似的东西\subfile[width=\textwitdh]{...},但没用……有人能帮助我吗?我将非常感激!:) 干杯!

编辑:树的代码:

\documentclass[../template.tex]{subfiles}

\begin{document}

\begin{tikzpicture}
 [
% Gates and symbols style
    and/.style={and gate US,thick,draw,fill=orange!60,rotate=90,
        anchor=east,xshift=-1mm},
    or/.style={or gate US,thick,draw,fill=blue!60,rotate=90,
        anchor=east,xshift=-1mm},
    be/.style={circle,thick,draw,fill=green!60,anchor=north,
        minimum width=0.7cm},
    tr/.style={buffer gate US,thick,draw,fill=purple!80,rotate=90,
        anchor=east,minimum width=0.8cm},
% Label style
    label distance=3mm,  every label/.style={blue},
% Event style
    event/.style={rectangle,thick,draw,fill=yellow!20,text width=2cm, text centered,font=\sffamily,anchor=north},
% Children and edges style
    edge from parent/.style={very thick,draw=black!70},
    edge from parent path={(\tikzparentnode.south) -- ++(0,-1.05cm)-| (\tikzchildnode.north)},
    level 1/.style={sibling distance=4cm,level distance=1.5cm, growth parent anchor=south,nodes=event},
    level 2/.style={sibling distance=3cm, level distance=1.5cm},
    level 3/.style={sibling distance=2.5cm, level distance=1.5cm},
    level 4/.style={sibling distance=3cm}
    ]
%% Draw events and edges
 \node (g1) [event] {Extension failure \\ E0}
        child{node (e1) {Locks \\(Le)} 
            child {node (e11) {Door Lock \\ (DL)}
                    %child {node (e111) {Door Lock \\ (E11)}}
                    %child {node (e112) {Door Lock \\ (E11)}}
                   % child {node (e113) {Shuttle Valve \\ (E11)}}
            }
            child {node (e12) {Uplock \\ (UL)}
                    %child {node (e121) {Leak \\ (E11)}}
                    %child {node (e122) {Fail to close \\ (E11)}}
                   %child {node (e123) {Shuttle Valve \\ (E11)}}
            }
        } 
        child [level distance=50mm] {node (e2) {Pressure Supply\\ (PSe)}
            child [sibling distance=8cm] {node (e21) {Main System\\ (PSMe)}
                child {node (e211) {Lose of pressure\\ (HPe1)}}
                child {node (e212) {Valve fails to open\\ (IVe)}}
                child {node (e213) {Wrong position\\ (SVe)}}
            }
            child [sibling distance=8cm] {node (e22) {Emergency System\\ (PSEe)}
                child {node (e221) {Lose of pressure\\ (HPe2)}}
                child {node (e222) {Shuttle Valves\\ (SHUV)}
                     child {node (e2221) {SHUVe1a}}
                     child {node (e2222) {SHUVe1b}}
                     child {node (e2223) {SHUVe1c}}
                     child {node (e2224) {SHUVe1d}}
                }
                child {node (e223) {Valve fails to open\\ (EVe)}}
            }    
        }
        child{node (e3) {Actuators \\(A)} 
            child {node (e31) {Door  \\ (DA)}}
            child {node (e32) {MLG \\ (RA)}}
        }
        child {node (e4) {Pipe Blockage \\ (HPe)}
        };
       
%  Remove what follows if no gates are required
   \node [or]   at (g1.south)   []  {};
   \node [or]   at (e1.south)   []  {};
   \node [and]  at (e2.south)   []  {};
   \node [or]   at (e3.south)   []  {};
   \node [be]   at (e4.south)   []  {};
   \node [tr]   at (e11.south)  []  {};
   \node [tr]   at (e12.south)  []  {};
   \node [or]   at (e21.south)  []  {};
   \node [or]   at (e22.south)  []  {};
   \node [tr]   at (e31.south)  []  {};
   \node [tr]   at (e32.south)  []  {};
   \node [be]   at (e211.south)  []  {};
   \node [be]   at (e212.south)  []  {};
   \node [be]   at (e213.south)  []  {};   
   \node [be]   at (e221.south)  []  {};
   \node [or]   at (e222.south)  []  {};
   \node [be]   at (e223.south)  []  {};
   \node [be]   at (e2221.south)  []  {};
   \node [be]   at (e2222.south)  []  {};
   \node [be]   at (e2223.south)  []  {};
   \node [be]   at (e2224.south)  []  {};
\end{tikzpicture}
\begin{tikzpicture} 
    [
    tr/.style={buffer gate US,
        thick,
        draw,
        fill=purple!80,
        rotate=90,
        inner sep=0pt,
        outer sep=0pt,
        minimum width=0.8cm},
    event/.style={rectangle,
        thick,
        draw,
        fill=yellow!20,
        text width=2cm, 
        text centered,
        font=\sffamily,
        anchor=north
    },
        be/.style={circle,thick,draw,fill=green!60,anchor=north,
        minimum width=0.7cm},
        or/.style={or gate US,thick,draw,fill=blue!60,rotate=90,
        anchor=east,xshift=-1mm},
    ]
    \node (g1) [tr] {};
    \draw[line width=1pt] ($(g1.south)+(-3pt,6pt)$) --++(0.5cm,0pt) --+(0,-2cm)
    node[below,event] (b){DLe1/ULe1 \\ DAe1/Rae2};

    \node[event, left=of b] (c){DLe2/ULe2 \\ Dae2/Rae1};
    \node[event, right=of b] (d){SHUVe2 a/b/c/d};
    \draw[line width=1pt] ($(b.north)+(0pt,6pt)$) -|(c);
    \draw[line width=1pt] ($(b.north)+(0pt,6pt)$) -|(d);
    
    \node [or]   at (g1.west)   [above=of b, yshift=-0.3cm]  {};
    \node [be]   at (b.south)   []  {};
    \node [be]   at (c.south)   []  {};
    \node [be]   at (d.south)   []  {};
\end{tikzpicture}

\end{document}

相关内容