Csl option in the YAML is not working with proxy

Hi Rstudio Community,

I am trying to make a paper in Rmarkdown. It is mandatory for me to do it with the diagnostic and interventional imaging. I am doing like this:

---
title: "reserach document"
author: "Mister and miss X"
date: '`r format(Sys.time(), "%d %B, %Y")`'
#header-includes:
output:
  #word_document:
     # fig_caption: yes
     # toc: true
  pdf_document:
    fig_caption: yes
    keep_tex: no
    number_sections: yes
    toc: false
bibliography: biblio.bib
csl: diagnostic-and-interventional-imaging.csl 
---

here's my option to knit:

library(thesisdown)
require("knitr")
knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
knitr::opts_chunk$set(echo = FALSE)

when I knit the document I have the following error in the terminal (I anonymized intentionally the user/password/server/port) :

/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS dose_study_FG.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output dose_study_FG.tex --lua-filter /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --number-sections --highlight-style tango --pdf-engine pdflatex --variable graphics --variable 'geometry:margin=1in' --citeproc 
output file: dose_study_FG.knit.md

pandoc: HttpExceptionContentWrapper {unHttpExceptionContentWrapper = InvalidProxyEnvironmentVariable "https_proxy" "https://user:passwork@server:port"}
Erreur : pandoc document conversion failed with error 1

If I comment the csl line in the YAML section it works but without the right format (this behavior is OK).
If I knit the document with my home network (so without institutional proxy) it works.

So,I have a conflict with proxy parameters.
I work on macOS system and I configure the ~/.Renviron file with the right proxy parameters as I can upload and install package on CRAN.

Could you please help me to solve this problem.
Thanks a lot.

I think you are encountering this issue reporting in Pandoc

It seems using a http for proxy solves it. Maybe setting http_proxy would also be an option.

I think it is because the CSL file must try to fetch resources on the web during its processing

Hope it helps

Heh, I was wondering what the heck pandoc has with proxy :). Wasn't aware CSL can relay on remote stuff.

If that's the case, the solution might be to fetch the content and store it locally, then rewrite the CSL rules.

Regards,
Grzegorz

Thanks a lot @cderv for your clues. It would be very difficult to find it myself.
To help the community, here's my new workflow:
I only use http_proxy variable in the ~/.Renviron file and it works.
https_proxy variable have been commented / deactivated.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.