crsh / papaja

papaja (Preparing APA Journal Articles) is an R package that provides document formats to produce complete APA manuscripts from RMarkdown-files (PDF and Word documents) and helper functions that facilitate reporting statistics, tables, and plots.
https://frederikaust.com/papaja_man/
Other
651 stars 132 forks source link

Running head "DISTORTED PD ESTIMATES IN SEQUENCE LEARNING" #561

Closed LisaSpitzer closed 1 year ago

LisaSpitzer commented 1 year ago

Describe the bug I am using papaja version 0.1.1.9001, and have followed the online description to use the settings for APA7. When I'm knitting to Word, the running head is correctly displayed on the first page (Running head: my running head), but on the following pages, it is "DISTORTED PD ESTIMATES IN SEQUENCE LEARNING", which I have not defined in any part of my RMD. A quick Google search indicated it might be based on one of your papers. :D

To Reproduce This is my YAML header (I have removed personal info): `--- title : "My title" shorttitle : "My running head"

author:

affiliation:

authornote: | Lisa Spitzer, https://orcid.org/0000-0002-4925-7291

Enter author note here.

abstract: | (removed)

keywords : "preregistration, open science, meta-research, reproducibility, replicability" wordcount : "X"

bibliography : ["r-references_edited.bib", "rordof.bib"]

floatsintext : yes tables : yes linenumbers : yes draft : no mask : no

figurelist : no tablelist : no footnotelist : no

classoption : "man" header-includes:

csl : "r system.file('rmd', 'apa7.csl', package = 'papaja')" documentclass : "apa7" output : papaja::apa6_docx ---`

Expected behavior I expected the running head to be "my running head", but it's "DISTORTED PD ESTIMATES IN SEQUENCE LEARNING" starting on the second page when knitted to word.

Screenshots image

Thanks for looking into it! :)

mariusbarth commented 1 year ago

Hi @LisaSpitzer, that's funny! A quick repository-wide search for the words "distorted" or "sequence" did not yield any results, so it seems to me that the running head has to be coming from somewhere else than the papaja sources. Given that the problem only arises with pdf output, I was wondering if you also use a preamble tex file that might contain a line of code that overwrites the short title?

LisaSpitzer commented 1 year ago

Hi @mariusbarth, thanks for your quick reply! :) I don't have such a tex file, but I also noticed that the error has been only in the last few outputs (before, with the same RDM, I had correct running heads in the word files). I'm not sure when this error arose. If it's only a problem for me, I can live with that (I'll just adjust the running head in the word file). :) I just wanted to let you know in case it's a bigger issue.

mariusbarth commented 1 year ago

Hi @LisaSpitzer, I think it is definitely worth trying to find out what is going on! It would be super helpful if you could upload a minimal reproducible example with an rmd file that produces the error!

LisaSpitzer commented 1 year ago

Hi @mariusbarth, okay! I was able to reproduce the error with a completely unedited papaja template (i.e., I just opened the APA6 template). The error is present only in Word, not in the PDF output. I have attached the RMD, Word, and PDF files below.

RMD:

---
title             : "The title"
shorttitle        : "Title"

author: 
  - name          : "First Author"
    affiliation   : "1"
    corresponding : yes    # Define only one corresponding author
    address       : "Postal address"
    email         : "my@email.com"
    role: # Contributorship roles (e.g., CRediT, https://credit.niso.org/)
      - "Conceptualization"
      - "Writing - Original Draft Preparation"
      - "Writing - Review & Editing"
  - name          : "Ernst-August Doelle"
    affiliation   : "1,2"
    role:
      - "Writing - Review & Editing"
      - "Supervision"

affiliation:
  - id            : "1"
    institution   : "Wilhelm-Wundt-University"
  - id            : "2"
    institution   : "Konstanz Business School"

authornote: |
  Add complete departmental affiliations for each author here. Each new line herein must be indented, like this line.

  Enter author note here.

abstract: |
  One or two sentences providing a **basic introduction** to the field,  comprehensible to a scientist in any discipline.
  Two to three sentences of **more detailed background**, comprehensible  to scientists in related disciplines.
  One sentence clearly stating the **general problem** being addressed by  this particular study.
  One sentence summarizing the main result (with the words "**here we show**" or their equivalent).
  Two or three sentences explaining what the **main result** reveals in direct comparison to what was thought to be the case previously, or how the  main result adds to previous knowledge.
  One or two sentences to put the results into a more **general context**.
  Two or three sentences to provide a **broader perspective**, readily comprehensible to a scientist in any discipline.

  <!-- https://tinyurl.com/ybremelq -->

keywords          : "keywords"
wordcount         : "X"

bibliography      : "r-references.bib"

floatsintext      : no
linenumbers       : yes
draft             : no
mask              : no

figurelist        : no
tablelist         : no
footnotelist      : no

classoption       : "man"
output            : papaja::apa6_docx
---

```{r setup, include = FALSE}
library("papaja")
r_refs("r-references.bib")
# Seed for random number generation
set.seed(42)
knitr::opts_chunk$set(cache.extra = knitr::rand_seed)

Methods

We report how we determined our sample size, all data exclusions (if any), all manipulations, and all measures in the study.

Participants

Material

Procedure

Data analysis

We used r cite_r("r-references.bib") for all our analyses.

Results

Discussion

\newpage

References

::: {#refs custom-style="Bibliography"} :::



[papaja_test.docx](https://github.com/crsh/papaja/files/12229135/papaja_test.docx)
[papaja_test.pdf](https://github.com/crsh/papaja/files/12229136/papaja_test.pdf)
mariusbarth commented 1 year ago

Ah, great! I think this is a systematic error. @crsh, do you have a first gut feeling why this is happening? Maybe something got mixed up in the docx template or the pre/post processors do not patch the template correctly? Could this be a downstream issue?