3

Heavily edited question:

In the following code, how can I add an itemization to the title? What I write below does not work.

The code is taken from Zarko's answer here: Flowchart + Tikz

\documentclass[border=2mm,
               tikz,
               preview]{standalone}
\usetikzlibrary{positioning,chains}

\begin{document}

\begin{tikzpicture}[
    node distance=15mm and 10mm,
    start chain=going below,
 mynode/.style = {
        draw, rectangle, align=center, text width=5cm,
        font=\small, inner sep=3ex, outer sep=0pt,
        on chain},
mylabel/.style = {
        draw, rectangle, align=center, rounded corners, 
        font=\small\bfseries, inner sep=2ex, outer sep=0pt,
        fill=cyan!30, minimum height=38mm,
        on chain},
every join/.style = arrow,
     arrow/.style = {very thick,-stealth}
                    ] 
\coordinate (tc);
% the title
\node[above=of tc,font=\bfseries] {\begin{itemize} \item test \end{itemize}};
% the nodes at the top
\node (n1a) [mynode, left=of tc]    {\# of records is identified 
                                        through database searching};
\node (n1b) [mynode,right=of tc]    {\# of additional records indentified\\
                                        through other sources};
    % the chain in the center
\node (n2)  [mynode, below=of tc]   {\# of records after duplicates removed};
\node (n3)  [mynode,join]   {\# of additional records indentified\\
                                        through other sources};
\node (n4)  [mynode,join]   {\# of full-text articles accessed 
                                            for eligibility};
\node (n5)  [mynode,join]   {\# of studies included in qualitative synthesis};
\node (n6)  [mynode,join]   {\# of studies included in quantitative sysntesis\\
                                (meta-analysis)};
% the branches to the right
\node (n3r) [mynode,right=of n3]    {\# of records excluded};
\node (n4r) [mynode,right=of n4]    {\# of full-text articles excluded,
                                        with reasons};
% lines not included in join                                        
\draw[arrow] ([xshift=+22mm] n1a.south) coordinate (a)
                                       -- (a |- n2.north);
\draw[arrow] ([xshift=-22mm] n1b.south) coordinate (b)
                                       -- (b |- n2.north);
\draw[arrow] (n3) -- (n3r);
\draw[arrow] (n4) -- (n4r);
% the labels on the left
    \begin{scope}[node distance=7mm]
\node[mylabel,below left=-3mm and 11mm of n1a.north west]
                {\rotatebox{90}{Identification}};
\node[mylabel]  {\rotatebox{90}{Screening}};
\node[mylabel]  {\rotatebox{90}{Eligibility}};
\node[mylabel]  {\rotatebox{90}{Included}};
    \end{scope}
\end{tikzpicture}
\end{document}
15
  • 1
    You shouldn't have to do anything. However, can you show us the complete error? Which macro is undefined? Even better, add a complete non-working example to your post. Jul 4, 2016 at 9:46
  • 1
    \Bbb is undefined, what's supposed to represent?
    – alwaysask
    Jul 4, 2016 at 9:56
  • 1
    And why do you believe that \Bbb is a known command? Jul 4, 2016 at 9:56
  • 1
    for this symbols you need to load package amssymb.
    – Zarko
    Jul 4, 2016 at 10:02
  • 1
    Add \usepackage{amsfonts}. Edit: or what Zarko suggested above.
    – alwaysask
    Jul 4, 2016 at 10:03

1 Answer 1

3

See, if this is what you after:

\documentclass[border=2mm,
               tikz,
               preview]{standalone}
\usetikzlibrary{positioning,chains}

\begin{document}
    \begin{tikzpicture}[
    node distance=15mm and 10mm,
    start chain=going below,
 mynode/.style = {
        draw, rectangle, align=center, text width=5cm,
        font=\small, inner sep=3ex, outer sep=0pt,
        on chain},
mylabel/.style = {
        draw, rectangle, align=center, rounded corners,
        font=\small\bfseries, inner sep=2ex, outer sep=0pt,
        fill=cyan!30, minimum height=38mm,
        on chain},
every join/.style = arrow,
     arrow/.style = {very thick,-stealth}
                    ]
\coordinate (tc);
% the title
\node[font=\bfseries,
      text width=8cm, align=left,% <-- added
      above=of tc]           {\begin{itemize} \item test \end{itemize}};
    \begin{scope}[every node/.style={mynode}]
% the nodes at the top
\node (n1a) [ left=of tc]    {\# of records is identified
                                        through database searching};
\node (n1b) [right=of tc]    {\# of additional records indentified\\
                                        through other sources};
    % the chain in the center
\node (n2)  [ below=of tc]   {\# of records after duplicates removed};
\node (n3)  [join]   {\# of additional records indentified\\
                                        through other sources};
\node (n4)  [join]   {\# of full-text articles accessed
                                            for eligibility};
\node (n5)  [join]   {\# of studies included in qualitative synthesis};
\node (n6)  [join]   {\# of studies included in quantitative sysntesis\\
                                (meta-analysis)};
% the branches to the right
\node (n3r) [right=of n3]    {\# of records excluded};
\node (n4r) [right=of n4]    {\# of full-text articles excluded,
                                        with reasons};
    \end{scope}
% lines not included in join
\draw[arrow] ([xshift=+22mm] n1a.south) coordinate (a)
                                       -- (a |- n2.north);
\draw[arrow] ([xshift=-22mm] n1b.south) coordinate (b)
                                       -- (b |- n2.north);
\draw[arrow] (n3) -- (n3r);
\draw[arrow] (n4) -- (n4r);
% the labels on the left
    \begin{scope}[node distance=7mm]
\node[mylabel,below left=-3mm and 11mm of n1a.north west]
                {\rotatebox{90}{Identification}};
\node[mylabel]  {\rotatebox{90}{Screening}};
\node[mylabel]  {\rotatebox{90}{Eligibility}};
\node[mylabel]  {\rotatebox{90}{Included}};
    \end{scope}
    \end{tikzpicture}
\end{document}

enter image description here

4
  • I would like to give each box a number. What I did right now is the following: Jul 4, 2016 at 11:21
  • \node (n1b) [mynode,right=of tc] {\textbf {(1) } test}; Jul 4, 2016 at 11:21
  • But that's quite ugly. Is there a nice way to write a bold 1 with a circle around it, @Zarko ? Jul 4, 2016 at 11:22
  • @iwriteonbananas, sorry, but where you like to have this numbers? right of each nodes in scope? This is simple to achieve by \node[..., label=right:\textbf{(1)}] {...};
    – Zarko
    Jul 4, 2016 at 11:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .