public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Bibliography citation order
@ 2021-02-08 14:51 MV
       [not found] ` <7749912f-342c-4d50-8a3b-c1129cd42494n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: MV @ 2021-02-08 14:51 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 866 bytes --]

I am trying to use a numeric style (nature.csl) for citations. Everything 
works OK but for the sorting order of the citations. The sort order matches 
the order of the citation's appearance in the .bib file and not the order 
in which they are cited. How do I get the order to match the citation order?

I have attached all the files that I use to test this. The compilation 
command was:

pandoc --standalone --citeproc -o test.html test.md

Thank you!

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7749912f-342c-4d50-8a3b-c1129cd42494n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1319 bytes --]

[-- Attachment #2: refs.bib --]
[-- Type: text/x-bibtex, Size: 2428 bytes --]

@article{Mcmahon1973,
	author = {McMahon, Thomas},
	date-added = {2021-02-08 09:18:47 -0500},
	date-modified = {2021-02-08 09:18:47 -0500},
	journal = {Science},
	number = {4079},
	pages = {1201--1204},
	publisher = {American Association for the Advancement of Science},
	title = {Size and shape in biology: elastic criteria impose limits on biological proportions, and consequently on metabolic rates},
	volume = {179},
	year = {1973}}

@article{Alexander1979aa,
	author = {Alexander, R and Jayes, AS and Maloiy, GMO and Wathuta, EM},
	date-added = {2021-02-08 09:18:47 -0500},
	date-modified = {2021-02-08 09:18:47 -0500},
	journal = {Journal of Zoology},
	number = {3},
	pages = {305--314},
	publisher = {Wiley Online Library},
	title = {Allometry of the limb bones of mammals from shrews (Sorex) to elephant (Loxodonta)},
	volume = {189},
	year = {1979}}

@book{Mandelbrot:1983kx,
	author = {Mandelbrot, Benoit B},
	date-added = {2021-02-08 09:18:47 -0500},
	date-modified = {2021-02-08 09:18:47 -0500},
	publisher = {Macmillan},
	title = {The fractal geometry of nature},
	year = {1983}}

@article{Biewener1989aa,
	author = {Biewener, Andrew A},
	date-added = {2021-02-08 09:18:47 -0500},
	date-modified = {2021-02-08 09:18:47 -0500},
	journal = {Bioscience},
	number = {11},
	pages = {776--783},
	publisher = {JSTOR},
	title = {Mammalian terrestrial locomotion and size},
	volume = {39},
	year = {1989}}

@article{Niklas:1994eu,
	author = {Niklas, KJ},
	date-added = {2021-02-08 09:18:47 -0500},
	date-modified = {2021-02-08 09:18:47 -0500},
	journal = {Evolution},
	pages = {44--54},
	publisher = {JSTOR},
	title = {The scaling of plant and animal body mass, length, and diameter},
	year = {1994}}

@article{Coleman1998,
	author = {Coleman, Michael J and Ruina, Andy},
	date-added = {2021-02-08 09:18:47 -0500},
	date-modified = {2021-02-08 09:18:47 -0500},
	journal = {Physical Review Letters},
	number = {16},
	pages = {3658},
	publisher = {APS},
	title = {An uncontrolled walking toy that cannot stand still},
	volume = {80},
	year = {1998}}

@article{Virot2020,
	author = {Virot, E and Spandan, V and Niu, L and van Rees, WM and Mahadevan, L},
	date-added = {2021-02-08 09:18:47 -0500},
	date-modified = {2021-02-08 09:18:47 -0500},
	journal = {Physical Review Letters},
	number = {5},
	pages = {058102},
	publisher = {APS},
	title = {Elastohydrodynamic Scaling Law for Heart Rates},
	volume = {125},
	year = {2020}}

[-- Attachment #3: test.md --]
[-- Type: text/markdown, Size: 542 bytes --]

---
title: Citation sorting test
author:
    - Some Author
    - Some Coauthor
bibliography: [./refs.bib]
csl: [./nature.csl]
link-citations: true
---

# Main text

This is some text [@Mandelbrot:1983kx, @Virot2020].
There are many citations in this sample text [@Biewener1989aa], but none of them are related to the text [@Mcmahon1973].

There is some more text [@Coleman1998] that refers to more citations [@Biewener1989aa].
The problem [@Niklas:1994eu] is that the citations are not sorted by their order of appearance [@Alexander1979aa].

[-- Attachment #4: nature.csl --]
[-- Type: text/xml, Size: 4555 bytes --]

<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
  <info>
    <title>Nature</title>
    <id>http://www.zotero.org/styles/nature</id>
    <link href="http://www.zotero.org/styles/nature" rel="self"/>
    <link href="http://www.nature.com/nature/authors/gta/index.html#a5.4" rel="documentation"/>
    <link href="http://www.nature.com/srep/publish/guidelines#references" rel="documentation"/>
    <author>
      <name>Michael Berkowitz</name>
      <email>mberkowi-TfTJ4S5JLGs@public.gmane.org</email>
    </author>
    <category citation-format="numeric"/>
    <category field="science"/>
    <category field="generic-base"/>
    <issn>0028-0836</issn>
    <eissn>1476-4687</eissn>
    <updated>2019-10-08T13:18:12+00:00</updated>
    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
  </info>
  <macro name="title">
    <choose>
      <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
        <text variable="title" font-style="italic"/>
      </if>
      <else>
        <text variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="author">
    <names variable="author">
      <name sort-separator=", " delimiter=", " and="symbol" initialize-with=". " delimiter-precedes-last="never" name-as-sort-order="all"/>
      <label form="short" prefix=", "/>
      <et-al font-style="italic"/>
    </names>
  </macro>
  <macro name="access">
    <choose>
      <if variable="volume"/>
      <else-if variable="DOI">
        <text variable="DOI" prefix="doi:"/>
      </else-if>
    </choose>
  </macro>
  <macro name="issuance">
    <choose>
      <if type="bill book graphic legal_case legislation motion_picture song thesis chapter paper-conference" match="any">
        <group delimiter="; " suffix=".">
          <group delimiter=", " prefix="(" suffix=")">
            <text variable="publisher" form="long"/>
            <date variable="issued">
              <date-part name="year"/>
            </date>
          </group>
        </group>
      </if>
      <else-if type="report webpage post post-weblog" match="any">
        <group delimiter=" ">
          <text variable="URL"/>
          <date date-parts="year" form="text" variable="issued" prefix="(" suffix=")"/>
        </group>
      </else-if>
      <else>
        <date variable="issued" prefix="(" suffix=")">
          <date-part name="year"/>
        </date>
      </else>
    </choose>
  </macro>
  <macro name="container-title">
    <choose>
      <if type="article-journal">
        <text variable="container-title" font-style="italic" form="short"/>
      </if>
      <else>
        <text variable="container-title" font-style="italic"/>
      </else>
    </choose>
  </macro>
  <macro name="editor">
    <choose>
      <if type="chapter paper-conference" match="any">
        <names variable="editor" prefix="(" suffix=")">
          <label form="short" suffix=" "/>
          <name and="symbol" delimiter-precedes-last="never" initialize-with=". " name-as-sort-order="all"/>
        </names>
      </if>
    </choose>
  </macro>
  <macro name="volume">
    <choose>
      <if type="article-journal" match="any">
        <text variable="volume" font-weight="bold" suffix=","/>
      </if>
      <else>
        <group delimiter=" ">
          <label variable="volume" form="short"/>
          <text variable="volume"/>
        </group>
      </else>
    </choose>
  </macro>
  <citation collapse="citation-number">
    <sort>
      <key variable="citation-number"/>
    </sort>
    <layout vertical-align="sup" delimiter=",">
      <text variable="citation-number"/>
    </layout>
  </citation>
  <bibliography et-al-min="6" et-al-use-first="1" second-field-align="flush" entry-spacing="0" line-spacing="2">
    <layout suffix=".">
      <text variable="citation-number" suffix="."/>
      <group delimiter=" ">
        <text macro="author" suffix="."/>
        <text macro="title" suffix="."/>
        <choose>
          <if type="chapter paper-conference" match="any">
            <text term="in"/>
          </if>
        </choose>
        <text macro="container-title"/>
        <text macro="editor"/>
        <text macro="volume"/>
        <text variable="page"/>
        <text macro="issuance"/>
        <text macro="access"/>
      </group>
    </layout>
  </bibliography>
</style>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bibliography citation order
       [not found] ` <7749912f-342c-4d50-8a3b-c1129cd42494n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-02-08 15:41   ` MV
  0 siblings, 0 replies; 2+ messages in thread
From: MV @ 2021-02-08 15:41 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1089 bytes --]

Fixed by updating to pandoc version 2.11.4. My previous version installed 
by conda was 2.11, which had a bug with sorting numeric citations.

On Monday, February 8, 2021 at 9:51:07 AM UTC-5 MV wrote:

> I am trying to use a numeric style (nature.csl) for citations. Everything 
> works OK but for the sorting order of the citations. The sort order matches 
> the order of the citation's appearance in the .bib file and not the order 
> in which they are cited. How do I get the order to match the citation order?
>
> I have attached all the files that I use to test this. The compilation 
> command was:
>
> pandoc --standalone --citeproc -o test.html test.md
>
> Thank you!
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/a5892d09-8428-4365-8d44-9f48f0028357n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1741 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-08 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 14:51 Bibliography citation order MV
     [not found] ` <7749912f-342c-4d50-8a3b-c1129cd42494n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-02-08 15:41   ` MV

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).