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

Failure to render PDF in rstudio with R4.3.1 #19

Closed spider-z3r0 closed 1 year ago

spider-z3r0 commented 1 year ago

Hello,

Thanks a million for the extention, I was playing around with it in vscode and couldn't make it work, switching to Rstudio has allowed me to render docx format smoothly, which is great but when I try to render pdf (following this tutorial) I get some errors that I can't seem to track down.

processing file: manuscript.qmd

output file: manuscript.knit.md

pandoc 
  to: latex
  output-file: manuscript.tex
  template: _extensions/wjschne/apaquarto/template.tex
  standalone: true
  pdf-engine: xelatex
  variables:
    graphics: true
    tables: true
  default-image-extension: pdf
  citeproc: false
  toc: false

metadata
  block-headings: false
  fig-cap-location: top
  tbl-cap-location: top
  cap-location: top
  knitr:
    opts_chunk:
      apa-figtab: true
  csl: _extensions/wjschne/apaquarto/apa.csl
  documentclass: apa7
  link-ciations: false
  suppress-bibliography: false
  hyperrefoptions:
    - linktoc=none
  classoption: 'colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue'
  bibliography:
    - references.bib

running xelatex - 1
  This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode

updating tlmgr

updating existing packages

compilation failed- error
Paragraph ended before \\authorsnames was complete.
<to be read again> 
                   \par 
l.70 

see C:\Users\path\to\my project\manuscript.log for more information.

The above happens when I try to render any kind of PDF.

I've tried to see what's going on in the .log file but I'm just not skilled enough at reading them.

I can just render to .docx and export that to a pdf but I thought it might be best to raise an issue and see if there is something to skip the extra step.

Thanks again for the work.

wjschne commented 1 year ago

Thanks for the link to the tutorial. I followed the instructions there and could not reproduce the error you are getting. If you would like to email me your .qmd file, perhaps I can identify what is happening. I am at schneider@temple.edu

spider-z3r0 commented 1 year ago

Hi, Thanks so much for the offer, I'll put send on a version with the yaml and maybe the first paragraph and maybe this will make more sense to you.

schneiderpy commented 1 year ago

Hi @wjschne I am trying to use your extension and template, but it rendered and error: processing file: lince.qmd |........................... | 59% [apafg-importedgraphic] Quitting from lines 245-249 [apafg-importedgraphic] (lince.qmd) Error in knitr::include_graphics(): ! Cannot find the file(s): "orcid.png" Backtrace:

  1. knitr::include_graphics("orcid.png")

Execution halted

Breaking down the extension folder I could not find and "orcid.png" file either, just and "Orcid-id vector file" Another question: How can I change the main font (to STIX)?

Thank you

wjschne commented 1 year ago

Breaking down the extension folder I could not find and "orcid.png" file either, just and "Orcid-id vector file"

When you create a new file (i.e., quarto use template wjschne/apaquarto), the orcid.png file is downloaded automatically. If you want to use any other image file, that should be fine.

Another question: How can I change the main font (to STIX)? If you are creating a pdf file, use the mainfont option in your yaml. See https://stackoverflow.com/questions/73603709/change-fonts-in-quarto-pdf-document

If you are creating a .docx file, you would need to have the STIX font installed on your machine and then change the body and heading font in the template file (i.e., apaquarto.docx) in the extension folder. See here for instructions: https://support.microsoft.com/en-au/office/change-the-default-font-in-word-2f50603b-9886-47e4-a483-48ac5ab80163