RMarkdown placement of in_header code and package imports (citation)


I am writing a seminar paper for a course at my university using R Markdown.
For citation I use biblatex and the authoryear-icomp citation style.
The (shortened) YAML header of my .Rmd file looks like this:

      in_header: "tex/preamble.tex"
      before_body: "tex/before_body.tex"
    citation_package: biblatex
    toc: false
    keep_tex: true
bibliography: ["bib/references.bib", "bib/packages.bib"]
biblio-style: authoryear-icomp
documentclass: scrartcl

I would like to increase the space between the single entries in the bibliography, for which I have found possible solutions here.
The issue is that I cannot simply paste the code in the preamble.tex file because of the way RMarkdown or Pandoc create the .tex file.

The following is a snippet from the resulting .tex file:

% --- other stuff --- %
% preamble.tex ends here

  \usepackage{selnolig}  % disable illegal ligatures
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same} % disable monospaced font for URLs
  pdfcreator={LaTeX via pandoc}}



Thus, if I added e.g. \setlength\bibitemsep{1.5\itemsep} to preamble.tex, this line of code would be added before the import of the biblatex package.
But the command needs to be placed after the import and before \begin{document}.

Does anyone have an idea of how to deal with this problem?


This topic was automatically closed 21 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.