wjschne / apaquarto

A quarto extension for creating APA7 documents in .docx, .html, and .pdf formats
https://wjschne.github.io/apaquarto/
Creative Commons Zero v1.0 Universal
170 stars 15 forks source link

Wrong margins in .pdf output when a4paper: true #69

Closed mwarb closed 6 months ago

mwarb commented 6 months ago

Thanks for this great extension. An issue I've noticed is that the margins are wrong in the generated .pdf output (any document mode) when a4paper is set to true. See the attached .pdf for an example - the left margin is larger than the right margin, and the bottom margin is much larger than the top margin.

test.pdf

wjschne commented 6 months ago

Thanks for alerting me. I reproduced your results. It seems the margins are set by the apa7 latex package. In version 4.3.0, I just enabled Quarto's geometry options in the template so that users can override the apa7 template's defaults:

geometry:
  - right=2.54cm

Do you think I should set new defaults for the a4paper option so that users do not need to fiddle with the margins? If so, what are the correct margins for a4?

mwarb commented 6 months ago

I don't have a copy of the actual APA 7 manual, but from what I can see online there isn't an explicit statement of whether margins are different depending on paper size, so I'd assume a common 1" margin for A4 paper size as well. The standard in the UK certainly seems to be 1" margins on A4 paper. The journal output mode appears to have smaller margins, however, so presumably the default would need to depend on the output format.

Unfortunately, setting the geometry options then leads to an error in the page number positioning. If I set each side to 2.54cm with A4 paper size and the doc output mode, the page number does not align with the right of the paragraph margins, instead slightly inset.

wjschne commented 6 months ago

I think I have it fixed. If the paper is document mode, the margins are now set to 1in. Geometry can be set separately, if desired.