Debian Codegraph @

texmf-dist/doc/latex/prisma-flow-diagram/README.md

raw
1
2 # prisma-flow-diagram Package
3
4 This package provides an abstraction for creating PRISMA 2009 flow diagrams in LaTeX. It simplifies the process of building these diagrams by providing intuitive commands while maintaining full compatibility with TikZ.
5
6 ![Example](/example.png)
7
8 ## Installation
9 1. Copy `prisma-flow-diagram.sty` into the same folder as your `.tex` document.
10 2. Include the package in your LaTeX document preamble:
11 ```latex
12 \usepackage{prisma-flow-diagram}
13 ```
14
15 ## Usage
16 The package provides the following commands:
17
18 ### Commands
19 1. **`\prismaflowstart`**
20 Starts the PRISMA flow diagram. Must be called before defining any nodes or labels.
21
22 2. **`\prismaflownode{<id>}{<position>}{<text>}{<arrow source>}`**
23 Adds a node to the diagram.
24 - `<id>`: A unique identifier for the node.
25 - `<position>`: Specifies the node's position relative to another node. For example, `below=of tc`.
26 - `<text>`: The text content of the node.
27 - `<arrow source>`: The ID of the source node for an arrow. Leave blank (`{}`) for no arrow.
28
29 3. **`\prismalabel{<size>}{<position>}{<text>}`**
30 Adds a vertical label to the left of the diagram.
31 - `<size>`: Size of the label box, typically `1.3*\mh`.
32 - `<position>`: Position relative to a node. For example, `n1a.west`.
33 - `<text>`: Text content of the label.
34
35 4. **`\prismaflowarrow{<source>}{<destination>}`**
36 Manually connects two nodes with an arrow.
37 - `<source>`: The ID of the source node.
38 - `<destination>`: The ID of the destination node.
39
40 5. **`\prismaflowend`**
41 Ends the PRISMA flow diagram.
42
43 ### Example
44 Below is a full example of how to use the package:
45
46 ```latex
47 \documentclass{article}
48 \usepackage{prisma-flow-diagram}
49
50 \begin{document}
51
52 \begin{figure}[H]
53 \resizebox{\textwidth}{!}{
54 \prismaflowstart
55
56 % Nodes at the top
57 \prismaflownode{n1a}{left=of tc}{Records identified through database searching (n = 251)}{};
58 \prismaflownode{n1b}{right=of tc}{Additional records identified through other sources (n = 0)}{};
59 \prismaflownode{n2}{below=of tc |- n1a.south}{Records after duplicates removed (n = 41)}{n1a};
60 \prismaflowarrow{n1b}{n2};
61
62 % Screening Phase
63 \prismaflownode{n3}{below=of n2}{Records screened (n = 210)}{n2};
64 \prismaflownode{n3r}{right=of n3}{Records excluded (n = 175)}{};
65 \prismaflowarrow{n3}{n3r};
66
67 % Eligibility Phase
68 \prismaflownode{n4}{below=of n3}{Full-text articles assessed for eligibility (n = 35)}{n3};
69 \prismaflownode{n4r}{right=of n4}{Full-text articles excluded, with reasons (n = 4) \\ - Not Relevant (n = 3) \\ - Not Open/Available paper (n = 2)}{};
70 \prismaflowarrow{n4}{n4r};
71
72 % Inclusion Phase
73 \prismaflownode{n5}{below=of n4}{Studies included in qualitative synthesis (n = 30)}{n4};
74 \prismaflownode{n6}{below=of n5}{Studies included in quantitative synthesis (meta-analysis)}{n5};
75
76 % Labels
77 \prismalabel{1.3*\mh}{n1a.west}{Identification};
78 \prismalabel{1.3*\mh}{n1a.west |- {$(n2)!0.6!(n3)$}}{Screening};
79 \prismalabel{1.3*\mh}{n1a.west |- {$(n4)!0.2!(n5)$}}{Eligibility};
80 \prismalabel{1.3*\mh}{n1a.west |- n6}{Included};
81
82 \prismaflowend
83 }
84 \caption{PRISMA 2009 Flow Diagram}
85 \label{fig:prisma}
86 \end{figure}
87
88 \end{document}
89 ```
90
91 ## License
92 This package is licensed under the [LPPL 1.3c](https://www.latex-project.org/lppl/).
93
94 ## Contribution
95 Contributions are welcome! Feel free to open issues or submit pull requests to improve the package.