Closed seananderson closed 5 months ago
Hit the Blame button on this file: https://github.com/jgm/pandoc-templates/blame/master/default.latex
and start at line 338 % definitions for citeproc citations
. That's what needs to change (keeping in mind we need formatting to match CSAS requirements).
This is all done (except resdoc-b). Note, however, that for some document types I had to change the default rendering back to bookdown::render_book()
for the French version to build. You can see which ones in the 2 commits linked above in this issue with their TODO
. I couldn't quickly figure out what was going wrong with the csasdown::render()
versions.
On the server we have Pandoc version:
pandoc 2.9.2.1
Compiled with pandoc-types 1.20, texmath 0.12.0.2, skylighting 0.8.5
With this, the English techreport fails for me as it is now using either csasdown::render()
or bookdown::render_book()
. I can fix it (maybe the indents etc are wrong though) by changing the code starting here https://github.com/pbs-assess/csasdown/blob/92f7f6429fd0844f1f952a2e2b26b03f738e2dd9/inst/csas-style/tech-report.sty#L436 to this:
\usepackage{enumitem}
\newenvironment{CSLReferences}%
{}%
{\par}
% \newlist{CSLReferences}{itemize}{1}
% \setlist[CSLReferences]{label={},
% leftmargin=\cslhangindent,
% itemindent=-1\cslhangindent,
% parsep=\parskip,
% itemsep=\cslentryspacing}
\usepackage{calc}
Appears it cannot be a list the way it is now...
This should now be working with pandoc < 3.1.7 and with pandoc >= 3.1.8. Pandoc 3.1.7 requires its own template, so csasdown checks for it and stops. I check the pandoc version on the fly and uncomment/comment sections of the .sty file as needed. https://github.com/pbs-assess/csasdown/commit/417f88c274099184c16470a5ec04a7759fec6598
The latest Pandoc has changed how references are handled by the default 'citeproc' method. Argh!
You can verify this is an issue by trying to build the unit tests. I tried with the tech report.
See https://tex.stackexchange.com/questions/695228/undefined-control-sequence-using-citeproc-to-convert-md-to-pdf-with-a-template And an example of extra code now needed in the preamble here: https://github.com/jgm/pandoc/issues/9031#issuecomment-1694744040
However, it's more complicated than this for us and I'm out of time to try fixing this right now. So, I'm documenting where I left off. Working on the tech report, here is what I've found:
% \RequirePackage[authoryear]{natbib} % Citations
% \bibpunct{(}{)}{;}{a}{}{,} % Punctuation for citations
Then in reference list, need to stop injecting
CSLReferences
at beginning and end of bibliography. I forget if we're doing that or pandoc was. Replace with biblist?e.g.
\begin{CSLReferences}
becomes\begin{biblist}
@jdunic first flagged this