Graphics, Figures & TablesFigure in LaTeX

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Tempowo
Posts: 7
Joined: Tue Nov 15, 2016 4:18 pm

Figure in LaTeX

Post by Tempowo »

Hello, :D

I am new to this forum. :-)

I have a question. Can you help me to create this figue in LaTeX (see below)? I want to do this since I have to fill insted of the "#" numbers. ;-)
Unbenannt.JPG
Unbenannt.JPG (36.25 KiB) Viewed 3330 times
The source is: Moher et al. (2009); article was published at http://www.annals.org on 21 July 2009

Here is the text so that you do not have to write it by your own:

# of records identified through database searches
# of additional records identified through other sources
# of records after duplicates removed
# of records screened
# of records excluded
# of full-text articles assessed for eligibility
# of full-text articles excluded, with reasons
# of studies included in qualitative synthesis
# of studies included in quantitative synthesis (meta-analysis)

I hope that you can help me :)

Thanks! :)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10316
Joined: Mon Mar 10, 2008 9:44 pm

Figure in LaTeX

Post by Stefan Kottwitz »

Welcome to the forum!

Should not be a problem, just a time issue... perhaps later today or tomorrow I can post a suggestion.

Stefan
LaTeX.org admin
Tempowo
Posts: 7
Joined: Tue Nov 15, 2016 4:18 pm

Figure in LaTeX

Post by Tempowo »

@ Stefan: That would be great! :-)
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Figure in LaTeX

Post by rais »

just so Stefan doesn't need to start from scratch ;)

Code: Select all

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[>=latex, inner sep=0pt, node distance=2.8cm,
  rec/.style={rectangle, draw=black, fill=blue!20, minimum height=1cm,
    text width=5cm, align=center},
  side ways/.style={rectangle, rotate=90},
  dummy/.style={}
  ]

\node (d1) [dummy] at (0,0) {};
\node (r1l) [rec, left of=d1] {\# of records identified through database searches};
\node (r1r) [rec, right of=d1]{\# of additional records identified through other sources};
\node (r2) [rec, text width=8cm, below of=d1]{\# of records after duplicates removed};
\node (r3l) [rec, text width=3cm, below of=r2]{\# of records screened};
\node (r3r) [rec, text width=3cm, right of=r3l, xshift=1cm]{\# of records excluded};
\node (r4l) [rec, text width=3cm, below of=r3l]{\# of full-text articles assessed for eligibility};
\node (r4r) [rec, text width=3cm, below of=r3r]{\# of full-text articles excluded, with reasons};
\node (r5) [rec, text width=4cm, below of=r4l]{\# of studies included in qualitative synthesis};
\node (r6) [rec, text width=4cm, below of=r5]{\# of studies included in quantitative synthesis (meta-analysis)};
\node (t1) [side ways, above of=r1l]{Identification};
\node (t2) [side ways, left of=t1, xshift=-1.4cm]{Screening};% shifted by half the node distance
\node (t3) [side ways, left of=t2, xshift=-1.4cm]{Eligibility};
\node (t4) [side ways, left of=t3]{Included};
\draw[->] (r1l) -- (r2);
\draw[->] (r1r) -- (r2);
\draw[->] (r2) -- (r3l);
\draw[->] (r3l) -- (r3r);
\draw[->] (r3l) -- (r4l);
\draw[->] (r4l) -- (r4r);
\draw[->] (r4l) -- (r5);
\draw[->] (r5) -- (r6);
\end{tikzpicture}
\end{document}
KR
Rainer
Tempowo
Posts: 7
Joined: Tue Nov 15, 2016 4:18 pm

Figure in LaTeX

Post by Tempowo »

@ Rainer. Many many thanks! :-) You are my hero! =)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10316
Joined: Mon Mar 10, 2008 9:44 pm

Figure in LaTeX

Post by Stefan Kottwitz »

Rainer's solution looks very good, so I did not need to draw. :-)

Btw. for flowcharts I often use a matrix, since most of the time it's a rectangular structure of nodes, and positioning them in a matrix of nodes is easy and readable. Here is an example: Flowchart of math environments. It's a bit compressed using foreach loops, but that shows how to draw many arrows in few lines of code.

Btw. perhaps set inner sep=2pt or so, in the style, to not let rectangle borders touch the node text.

Rainer showed the usual steps in a straightforward way:
  • Defining styles
  • Positioning nodes
  • Drawing lines/arrows
Equipped with that example and the TikZ manual you are ready for complex diagrams. ;-)

Stefan
LaTeX.org admin
Post Reply