Giter Club home page Giter Club logo

Comments (7)

jgm avatar jgm commented on June 18, 2024 1

The problem is almost certainly that your custom template needs to be updated, if it's one designed for pandoc < 2.11. For one thing, the latex environment used for CSLReferences now takes a different number of arguments. I'm sure the 1 and 0 are the values pandoc is supplying for these parameters. Here's a diff from pandoc 2.10.1 to the current version:

diff --git a/data/templates/default.latex b/data/templates/default.latex
index d6cca9c98..169661582 100644
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -89,6 +89,7 @@ $endif$
 $if(beamerarticle)$
 \usepackage{beamerarticle} % needs to be loaded first
 $endif$
+\usepackage{amsmath,amssymb}
 $if(fontfamily)$
 \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
 $else$
@@ -97,7 +98,6 @@ $endif$
 $if(linestretch)$
 \usepackage{setspace}
 $endif$
-\usepackage{amssymb,amsmath}
 \usepackage{ifxetex,ifluatex}
 \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
   \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
@@ -254,7 +254,8 @@ $if(highlighting-macros)$
 $highlighting-macros$
 $endif$
 $if(tables)$
-\usepackage{longtable,booktabs}
+\usepackage{longtable,booktabs,array}
+\usepackage{calc} % for calculating minipage widths
 $if(beamer)$
 \usepackage{caption}
 % Make caption package work with longtable
@@ -333,7 +334,10 @@ $for(polyglossia-otherlangs)$
   \setotherlanguage[$for(polyglossia-otherlangs.options)$$polyglossia-otherlangs.options$$sep$,$endfor$]{$polyglossia-otherlangs.name$}
 $endfor$
 \else
-  \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
+  \usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
+% get rid of language-specific shorthands (see #6817):
+\let\LanguageShortHands\languageshorthands
+\def\languageshorthands#1{}
 $if(babel-newcommands)$
   $babel-newcommands$
 $endif$
@@ -368,10 +372,27 @@ $endif$
 $if(csl-refs)$
 \newlength{\cslhangindent}
 \setlength{\cslhangindent}{1.5em}
-\newenvironment{cslreferences}%
-  {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
-  \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
-  {\par}
+\newlength{\csllabelwidth}
+\setlength{\csllabelwidth}{3em}
+\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
+ {% don't indent paragraphs
+  \setlength{\parindent}{0pt}
+  % turn on hanging indent if param 1 is 1
+  \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
+  % set entry spacing
+  \ifnum #2 > 0
+  \setlength{\parskip}{#2\baselineskip}
+  \fi
+ }%
+ {}
+\usepackage{calc}
+\newcommand{\CSLBlock}[1]{#1\hfill\break}
+\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
+\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
+\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
+$endif$
+$if(csquotes)$
+\usepackage{csquotes}
 $endif$
 
 $if(title)$

from citeproc.

jgm avatar jgm commented on June 18, 2024

On 2: your bibtex entry has both a doi and a url. If you remove the empty doi, the URL will render. The default chicago-author-date.csl has

          <choose>
            <if variable="DOI">
              <text variable="DOI" prefix="https://doi.org/"/>
            </if>
            <else>
              <text variable="URL"/>
            </else>
          </choose>

I think this is a bug; the doi variable shouldn't match if its content is empty, so this needs looking into.

On 1: I don't see the 10 when I try this. What pandoc version are you using, and what exact command did you use to produce this output?

from citeproc.

jgm avatar jgm commented on June 18, 2024

Note: I don't think the "if" clause is being triggered here. If it were, we'd get the prefix. Also, I confirmed that doi is parsed as TextVal "" which should be considered empty. Correction: it is being triggered, as we can see by inserting <text value="BLAH"/> there. Not sure why though!

from citeproc.

jgm avatar jgm commented on June 18, 2024

Aha. Putting a trace in before we call citeproc from pandoc, I see:

(Variable "doi",FancyVal (Many {unMany = fromList [Link ("",[],[]) [Str ""] ("https://doi.org/","")]}))

Culprit then is linkifyVariables, which should do nothing when the variable is empty.

from citeproc.

jgm avatar jgm commented on June 18, 2024

I've fixed 2 in pandoc. Can't reproduce 1.

from citeproc.

whrose avatar whrose commented on June 18, 2024

Thank you very much for fixing #2, that is very much appreciated.
With respect to #1: I use pandoc version 2.11.3.1, and in vim I call for this command:
!pandoc -t latex % --bibliography=/Users/whrose/pandocworkshop/masterwiki.bib --template=eisvowhr --top-level-division=part -F pandoc-crossref --citeproc --pdf-engine=xelatex -s -o /Users/whrose/pandocworkshop/pandoc_output.pdf

from citeproc.

whrose avatar whrose commented on June 18, 2024

from citeproc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.