Search code examples
rlatexr-markdownknitrpapaja

Avoiding Appendix-Specific Reference Section while using papaja


I am writing a report with R Markdown and papaja in which I add an appendix by including:

appendix:
   - "appendix.Rmd"

in the YAML header.

When I include citations in the appendix, an appendix-specific reference section is created following the appendix content. Is it possible to suppress this behavior and instead include citations in the appendix in the main reference section that is shown before the appendix?

Example:

Main Text

some text with a citation (Someone, 2021).

References

Someone, A. (2021). title. Journal.

Appendix

Some text in the appendix with a citation (Someone, 2021).

Someone, A. (2021). title. Journal.

"Someone, A. (2021). title. Journal." is printed twice, once in the main reference section and once after the appendix. I would like it to only be printed in the main reference section.


Solution

  • For PDF output, you can accomplish this by including the content of your appendix in the main document. The end of your file should look similar to the following:

    # References
    
    \begingroup
    \setlength{\parindent}{-0.5in}
    \setlength{\leftskip}{0.5in}
    
    <div id="refs" custom-style="Bibliography"></div>
    \endgroup
    
    \appendix
    
    # My first appendix's title
    
    As some other people said [@some_author]
    
    • The lines above \appendix include the biblography -- the code should already be included in your file because it is part of papaja's template .Rmd file.
    • \appendix then tells LaTeX to interpret all following sections as appendices.
    • The code below \appendix can be written like standard sections, where each section is interpreted as one appendix (e.g. Appendix A, Appendix B, etc.).