papaja
papaja copied to clipboard
Full-fledged Word-support
As it currently stands, apa6_docx
produces a decent document that is reasonably close to APA-style (with some manual labor involved), but it lacks several features available in PDF documents. It would be great to offer support for the most important ones. Since I first wrote the function there has been a lot of improvements on the pandoc
-side and new R packages, such as officedown
that could be leveraged to make apa6_word
more powerful. I'll try to collect some of the things I would like to improve here for later reference.
For all of the below, we should do some research on officedown
. I'd prefer to use native pandoc
features and Lua-filters where possible, but this package adds a lot of functionality that may be indispensible or laborous to reimplement.
- [ ] Make use of available reference styles, e.g. captions, and define custom styles, where necessary.
- [ ] Use caption bookmarks
- [ ] Consider using the
native_numbering
extension - [ ] Explore using
gt
,flextable
,huxtable
, andkableExtra
as a backend to extend the functionality ofapa_table()
(https://github.com/crsh/papaja/issues/466) - [ ] Explore postprocessing of docx-file to enable line numbering
- [ ] Can we use manual reference section placement to simplify the inclusion of appendices and the associated post-processing?
- [ ] Experiment with a Lua-filter to move tables and figures to the back of the manuscript. This is low priority as APA 7th edition no longer requires this.
- [ ] Experiment with Lua-filters to support
figurelist
etc.
This sounds great, I would also love the ability to make page layouts landscape for wide apa_tables in docx (related to point 7).
Indeed, thanks for mentioning this. It seems that this would require either an additional Lua-filter (also see here) or using the officedown package.
The Lua-filter list-table
seems a promising alternative to power a cross-format apa_table()
!
Flagging that with pandoc 2.19 col/row spanners are supported via the grid table layout. Could help in getting the col_spanners argument to work with docx.
An example that should work out of the box in papaja::apa6_docx
rmarkdown::pandoc_version()
#> [1] '2.19'
: A table caption
+---------------+---------------+--------------------+
| | col_spanner |
+ +---------------+--------------------+
| | Var1 | Var2 |
+===============+:=============:+:==================:+
| Row 1 | 1.32 | 1.54 |
+---------------+---------------+--------------------+
| Row 2 | 2.89 | 3.21 |
+===============+===============+====================+
<div custom-style='Compact'>
*Note.* a note
</div>