forked from wjschne/apaquarto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.qmd
343 lines (254 loc) · 12.2 KB
/
template.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
---
title: "Using Quarto to Generate MS Word Documents in APA Style (7th Edition)"
# Lines above title in .docx format
blank-lines-above-title: 2
# If blank, the running header is the title in upper case.
shorttitle: Template for the APAquarto Format
# Set names and affiliations.
# It is nice to specify everyone's orcid, if possible.
# There can be only one corresponding author, but declaring one is optional.
author:
- name: Ana Fulana
corresponding: true
orcid: 0000-0000-0000-0000
email: [email protected]
url: https://example.org/
# Roles are optional
# Select from the CRediT: Contributor Roles Taxonomy https://credit.niso.org/
# Conceptualization, Data curation, Formal Analysis, Funding acquisition, Investigation,
# Methodology, Project administration, Resources, Software, Supervision, Validation,
# Visualization, Writing – original draft, Writing – review & editing
role:
- Conceptualization
- Writing - original draft
affiliations:
- id: id1
name: Ana and Blanca's University
department: Department of Psychology
address: 1234 Capital St.
city: Albany
region: NY
postal-code: 12084-1234
- name: Blanca Zutana
role:
- Project administration
affiliations:
- ref: id1
- name: Carina Mengana
orcid: 0000-0000-0000-0001
role:
- Formal Analysis
affiliations:
- name: Carina's Primary Affiliation
- name: Carina's Secondary Affiliation
# Because Dolorita is unaffiliated, specify her city instead
- name: Dolorita Perengana
orcid: 0000-0000-0000-0003
role:
- Writing - review & editing
- Methodology
- Formal Analysis
affiliations:
- name: ~
city: Buffalo
region: NY
author-note:
blank-lines-above-author-note: 1
status-changes:
# Example: [Author name] is now at [affiliation].
affiliation-change: Ana Fulana is now at X University.
# Example: [Author name] is deceased.
deceased: Carina Mengana is deceased.
# Disclosures condensed to one paragraph, but you can start a field with two line breaks to break them up: \n\nNew Paragraph
disclosures:
# Example: This study was registered at ClinicalTrials.gov (Identifier NTC998877).
study-registration: ~
# Acknowledge and cite data/materials to be shared.
data-sharing: ~
# Example: This article is based on data published in Pulaski (2017).
# Example: This article is based on the dissertation completed by Graham (2018).
related-report: This article is based on data published in Pulaski (2017).
# Example: Sally Jones earns royalties from the sale of Test X.
conflict-of-interest: ~
# Example: This study was supported by Grant A123 from the National Science Foundation.
financial-support: ~
# Example: The authors are grateful for the technical assistance of Dr. X during the initial design and setup of our lab equipment.
gratitude: ~
# Example. Because the authors are equal contributors, order of authorship was determined by a fair coin toss.
authorship-agreements: ~
abstract: "This document is a template demonstrating the apaquarto format."
keywords: [keyword1, keyword2, keyword3]
# I like using Zotero with BetterBibTeX to output a continuously updated "Better CSL JSON" file. But BibTeX works, too.
bibliography: bibliography.bib
format:
apaquarto-docx: default
apaquarto-html: default
apaquarto-pdf:
# can be jou (journal), man (manuscript), stu (student), or doc (document)
# for now, tables and figures do not render properly in jou mode.
documentmode: man
# can be 10pt, 11pt, or 12pt
fontsize: 12pt
# Integrate tables and figures in text
floatsintext: false
# a4 paper if true, letter size if false
a4paper: false
# suppresses loading of the lmodern font package
nolmodern: false
# Suppresses loading of the fontenc package
nofontenc: false
# Suppress the title above the introduction
donotrepeattitle: false
# In jou mode, use times or pslatex instead of txfonts
notxfonts: false
# In jou mode, use Computer Modern font instead of times
notimes: false
# In jou mode, cancels automatic stretching of tables to column width
notab: false
# Uses Helvetica font in stu and man mode
helv: false
# In man and stu mode, neutralizes the \helvetica command
nosf: false
# In man and stu mode, uses typewriter font
tt: false
# Puts draft watermark on first page
draftfirst: false
# Puts draft watermark on all pages
draftall: false
# Masks references that are marked as the author's own
mask: false
journal: ~
volume: ~
course: ~
professor: ~
duedate: ~
# Hides correspondence text
nocorrespondence: false
---
{{< include _extensions/wjschne/apaquarto/_apa_title.qmd >}}
```{r}
#| label: setup
library(conflicted)
library(tidyverse)
library(flextable)
library(ftExtra)
library(officer)
library(knitr)
conflicts_prefer(dplyr::filter, .quiet = TRUE)
conflicts_prefer(flextable::separate_header, .quiet = TRUE)
```
This is my introductory paragraph. The title will be placed above it automatically. *Do not start with an introductory heading* (e.g., "Introduction"). The title acts as your Level 1 heading for the introduction.
Readers are better able to follow your ideas if you differentiate sections in your introduction with headings. Mostly stick to level 2 headers. Sometimes level 3 headings are needed, though. Be sparing to the point of stinginess with levels 4 and 5.
## Level 2 Heading: Flush Left, Bold, Title Case
Subsections of the introduction have level 2 headings. A paragraph after a level 2 Heading is on a new line. Regular paragraphs are indented, flush left, and double-spaced.
You do not need to put text after a heading. You can put a higher-level heading directly underneath if you want.
## A Level 2 Heading Without Text Below It
### Level 3 Heading: Flush Left, Bold Italic, Title Case
Subsections of a level 2 heading are placed under level 3 headings.
### Another Level 3 Heading
#### Level 4 Heading.
A level 4 heading should be indented, flush left, bold, title case, and end with a period. A paragraph after a level 4 or 5 heading is on a new line in this markdown document but will appear as if it were in the same paragraph when rendered. You need at least one paragraph after a level 4 or 5 heading. If you forget the period at the end of the level 4 or 5 heading, it will be added automatically. A period will not be added if the heading ends with a question mark or an exclamation point.
Subsequent paragraphs go on their own lines.
##### Level 5 Heading
A level 5 heading should be indented, flush left, bold italic, title case, and end with a period. Notice that there was no period after this level 5 heading in the markdown document, but it does appear in the rendered document.
Subsequent paragraphs go on their own lines.
## How to Cite References
I am going to cite a reference here in square brackets [@CameronTrivedi2013]. This reference was in my bibliography file. Here are some variations on parenthetical citations:
- Page references (or any other suffixes are placed after the reference. If you want a comma, you'll need to insert it yourself: [@CameronTrivedi2013, pp. 35--41]
- Prefixes (with or without a comma) are placed before the reference: [e.g., @CameronTrivedi2013]
- 2 or more citations separated by a semicolon [@CameronTrivedi2013; @cohen2003applied]
- Any prefixes or suffixes needing a literal semicolon will confuse Quarto (actually Pandoc). To make it clear that you need to print a semicolon, put a backslash before the semicolon: [FOIL\; @CameronTrivedi2013]
Text references are possible, too.
- @CameronTrivedi2013 said some interesting things.
- @cohen2003applied [pp. 101--103] said specific things on specific pages.
- Place the reference's year by itself with a minus sign: [-@CameronTrivedi2013]
## Hypotheses, Aims, and Objectives
The last paragraph of the introduction usually states the specific hypotheses of the study, often in a way that links them to the research design.
# Method
General remarks on method. This paragraph is optional.
Not all papers require each of these sections. Edit them as needed. Consult the [Journal Article Reporting Standards](https://apastyle.apa.org/jars) for what is needed for your type of article.
## Participants
Who are they? How were they recruited? Report criteria for participant inclusion and exclusion. Perhaps some basic demographic stats are in order. A table is a great way to avoid repetition in statistical reporting.
## Measures
This section can also be titled **Materials** or **Apparatus**. Whatever tools, equipment, or measurement devices used in the study should be described.
### Measure A
Describe Measure A.
### Measure B
Describe Measure B.
## Procedure
What did participants do?
How are the data going to be analyzed?
# Results
## Descriptive Statistics
Here we describe the basic characteristics of our primary variables.
Let's make a figure. A reference label for a figure in APA format must have the prefix `apafg-`. This is different from the usual Quarto prefix `fig-`.
```{r}
#| label: apafg-myplot
#| apa-cap: This is the figure caption.
#| apa-note: This is a note below the figure.
plot(1:10)
```
To refer to any figure or table, put the chunk label in curly braces. For example, see {apafg-myplot}. In {apafg-importedgraphic}, we import an image.
```{r}
#| label: apafg-importedgraphic
#| apa-cap: This is an imported graphic.
#| apa-note: My note.
knitr::include_graphics("orcid.png")
```
We can make a table the same way as a figure except that the label prefix is `apatb-`. Again, this is different from the usual quarto prefix `tbl-`, which will put the table table caption in the wrong place and with non-APA formatting.
```{r apatb-mytable}
#| apa-cap: Here is the table caption.
#| apa-note: Here is the note below the table.
#| ft.align: left
tibble(Numbers = seq(1,4), Letters = LETTERS[seq(Numbers)]) %>%
flextable() %>%
theme_apa() %>%
line_spacing(part = "all") %>%
padding(padding.top = 5, padding.bottom = 5)
```
To refer to this table in text, put the table's reference label in curly braces like so: As seen in {apatb-mytable}, there is not much information.
{apatb-withoutnote} is an example of a table without a note beneath.
```{r apatb-withoutnote}
#| apa-cap: This is a table without a note.
#| ft.align: left
tibble(Numbers = seq(1,4), Letters = LETTERS[seq(Numbers)]) %>%
flextable() %>%
theme_apa() %>%
line_spacing(part = "all") %>%
padding(padding.top = 5, padding.bottom = 5)
```
In {apatb-mymarkdowntable}, there is an example of using a plain markdown table via the `asis` engine.
```{asis}
#| label: apatb-mymarkdowntable
#| apa-cap: Table caption of a markdown table
#| apa-note: This is a note below the markdown table.
#| echo: true
| Default | Left | Right | Center |
|---------|:-----|------:|:------:|
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
```
What if you want the tables and figures to be at the end of the document? In the .pdf format, you can set the `floatsintext` option to false. For .html and .docx documents, there is not yet an automatic way to put tables and figures at the end. You can, of course, just put them all at the end, in order. The reference labels will work no matter where they are in the text.
<!-- Add Additional Sections as Needed -->
# Discussion
Describe results in non-statistical terms. <!-- Add sections as needed. -->
## Limitations and Future Directions
Every study has limitations. Based on this study, some additional steps might include...
## Conclusion
Let's sum this up.
{{< pagebreak >}}
# References
<!-- References will auto-populate in the refs div below -->
::: {#refs}
:::
<!-- Delete any unnecessary sections or pagebreaks. -->
{{< pagebreak >}}
# Appendix
If there are multiple appendices, label them with level 1 headings as Appendix A, Appendix B, and so forth.
<!-- I like my tables and figures intermingled with the text, -->
<!-- but all tables can go here. -->
<!-- Uncomment the pagebreaks as needed-->
<!-- {{< pagebreak >}} -->
<!-- Figures can go here. -->
<!-- {{< pagebreak >}} -->