Wie zentriert man Text in einer Schemabox?

Wie zentriert man Text in einer Schemabox?

Ich möchte, dass der Text in den Knoten zwischen den Pfeilen zentriert und nicht linksbündig ausgerichtet ist. Die Verwendung \centeringoder \begin{center} ... \end{center}Umgehung der Minipage oder der Einstellung text align=centerin den Tikzpicture-Optionen hilft nicht. Ich kann keine weiteren Hinweise in derSchemataPaket. (Ich bin offen für Lösungen, die dieses Paket nicht beinhalten.)

\documentclass{article}
\usepackage{tikz,xcolor, fontspec, schemata}
\usetikzlibrary{shapes,arrows,positioning, decorations.pathreplacing}
\setmainfont{Arial}
\begin{document}
\tikzstyle{block}=[align=center]
\tikzstyle{line} = [draw,-latex',ultra thick]
\begin{tikzpicture}[node distance = 5em,auto,block]

    \node (prior-lit) {Prior literature};
    \node [below of=prior-lit] (aims-12) 
    {
        \begin{minipage}{\columnwidth}
            \let\SB\schemabox
            \schema{\SB{Aims 1 \& 2}}{\SB{\textbf{Identify} Risk and protective factors for \\ nonmedical poly- and monosubstance use\\  location, position in social network, age, gender}}
        \end{minipage}
       };
    \node [below of=aims-12, below=0em] (mock-intervention) 
    {
        \begin{minipage}{\columnwidth}
            \let\SB\schemabox
            \schema{\SB{Aim 3}}{\SB{\textbf{Simulate} responses of users with various \\ combinations  of risk and protective factors\\ to interventions on social networking sites}}
        \end{minipage}
       };


    \node [below of=mock-intervention] (real-intervention) {Real intervention};
    \node [below of=real-intervention] (outcomes) {Asses outcomes};

    \path[line] (prior-lit) -- (aims-12);
    \path[line] (aims-12) -- (mock-intervention); 
    \path[line, dashed] (mock-intervention) -- (real-intervention);
    \path[line, dashed] (real-intervention) -- (outcomes);

    \draw [decorate,decoration={brace,amplitude=1em,mirror,raise=4pt},yshift=-10] (5.5,-5) -- (5.5,0) node [right,black,midway,xshift=2em] {\textbf{Current grant}};

    \draw [decorate,decoration={brace,amplitude=1em,mirror,raise=4pt},yshift=-10] (5.5,-8) -- (5.5,-5.1) node [right,black,midway,xshift=2em] {\textbf{Future grants}};
\end{tikzpicture}

\end{document}

Antwort1

So was?

Bildbeschreibung hier eingeben

Die Pfeile sind auf den gesamten Knoten zentriert. Ich habe ein tabularinside verwendet \SB:

\documentclass{article}
\usepackage{tikz,xcolor, fontspec, schemata}
\usetikzlibrary{shapes,arrows,positioning, decorations.pathreplacing}
\setmainfont{Arial}
\begin{document}
\tikzset{block/.style={align=center},
         line/.style = {draw,-latex',ultra thick}}
\begin{tikzpicture}[node distance = 5em,auto,block]

    \node (prior-lit) {Prior literature};
    \node [below of=prior-lit] (aims-12)
    {
     %   \begin{minipage}{\columnwidth}
            \let\SB\schemabox
            \schema{\SB{Aims 1 \& 2}}{\SB{\begin{tabular}{@{}c@{}}\textbf{Identify} Risk and protective factors for \\ nonmedical poly- and monosubstance use\\  location, position in social network, age, gender\end{tabular}}}
     %   \end{minipage}
       };
    \node [below of=aims-12, below=0em] (mock-intervention)
    {
       % \begin{minipage}{\columnwidth}
            \let\SB\schemabox
            \schema{\SB{Aim 3}}{\SB{\begin{tabular}{@{}c@{}}\textbf{Simulate} responses of users with various \\ combinations  of risk and protective factors\\ to interventions on social networking sites\end{tabular}}}
    %    \end{minipage}
       };


    \node [below of=mock-intervention] (real-intervention) {Real intervention};
    \node [below of=real-intervention] (outcomes) {Asses outcomes};

    \path[line] (prior-lit) -- (aims-12);
    \path[line] (aims-12) -- (mock-intervention);
    \path[line, dashed] (mock-intervention) -- (real-intervention);
    \path[line, dashed] (real-intervention) -- (outcomes);

    \draw [decorate,decoration={brace,amplitude=1em,mirror,raise=4pt},yshift=-10] (5.5,-5) -- (5.5,0) node [right,black,midway,xshift=2em] {\textbf{Current grant}};

    \draw [decorate,decoration={brace,amplitude=1em,mirror,raise=4pt},yshift=-10] (5.5,-8) -- (5.5,-5.1) node [right,black,midway,xshift=2em] {\textbf{Future grants}};
\end{tikzpicture}

\end{document}

verwandte Informationen