jgm / pandoc-citeproc

Library and executable for using citeproc with pandoc
BSD 3-Clause "New" or "Revised" License
291 stars 61 forks source link

pandoc-citeproc drops the ‘dimensions’ variable #213

Closed njbart closed 4 years ago

njbart commented 8 years ago

pandoc-citeproc seems to silently ignore the CSL variable dimensions.

Example (using harvard-university-of-kent.csl as one of the official styles that supports dimensions):

pandoc -s -F pandoc-citeproc -t markdown-citations << EOT

Foo [@doe1].  

# References {-}

---
csl: https://raw.githubusercontent.com/citation-style-language/styles/master/harvard-university-of-kent.csl
references:
- id: doe1
  type: book
  author:
  - family: Doe
    given: Ann
  issued:
  - year: '1999'
  title: Title
  collection-title: The collection title
  publisher: The publisher
  dimensions: '789 pp.'
...
EOT

Actual:

Foo (Doe 1999).

References {#references .unnumbered}
==========

<div id="refs" class="references">

<div id="ref-doe1">

Doe, A. (1999). *Title*. The collection title. The publisher.

</div>

</div>

Expected:

Foo (Doe 1999).

References {#references .unnumbered}
==========

<div id="refs" class="references">

<div id="ref-doe1">

Doe, A. (1999). *Title*. The collection title. The publisher. 789 pp.

</div>

</div>

Relevant section from harvard-university-of-kent.csl:

<if type="book broadcast graphic legal_case motion_picture report song" match="any">
  <group prefix=" " delimiter=". " suffix=".">
    <text macro="title"/>
    <text macro="broadcast-info"/>
    <text macro="online"/>
    <group delimiter=" ">
      <text term="volume" form="short" text-case="capitalize-first"/>
      <text variable="volume"/>
    </group>
    <text macro="edition"/>
    <text macro="editor"/>
    <text variable="collection-title"/>
    <text variable="collection-number" prefix="Number "/>
    <text macro="publisher"/>
    <text variable="dimensions"/>
  </group>
</if>

Note that pandoc-citeproc renders collection-title, but not dimensions.

jgm commented 8 years ago

I've confirmed that dimensions is parsed properly in the Reference data structure.

alex-ball commented 5 years ago

This issue has reappeared in recent versions: Literals without special handling in Eval.hs (such as call-number, dimensions, scale, language) are dropped.

This is possible to verify by adapting the test case for #338, since books in din-1505-2.csl (should) display dimensions and scale. I'm afraid the code is a mystery to me, but looks like the fix for #338 (4f46f46) overwrote part of the fix for this one.

jgm commented 5 years ago

@alex-ball have you tried to confirm that rolling back 4f46f46 makes these literals work again?

alex-ball commented 5 years ago

No, my machine isn't up to it. (By which I mean, I tried compiling with stack test and it basically locked up my computer, and judging by the rate of progress it was making would not complete for about 5 hours.) :-(

alex-ball commented 5 years ago

However, I have just tested against the versions bundled with the pandoc deb releases, and can confirm that these fields were working in version 0.14.4 and earlier, and have not worked since version 0.14.8.

jgm commented 5 years ago

I confirmed that rolling that commit back fixes things. Now, why??

jgm commented 4 years ago

Fixed in citeproc branch of pandoc.