jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.44k stars 3.37k forks source link

citeproc and docx output: Number the items in the bibliography #10326

Closed terris-peer closed 1 day ago

terris-peer commented 2 days ago

Describe your proposed improvement and the problem it solves.

I would like the items in the bibliography created by citeproc to be numbered.

The programmer who works on this issue can pick the solution they like better or choose a new one:

  1. citeproc numbers them
  2. citeproc adds a Word style to each item. The style can be customized by providing a reference doc.

Describe alternatives you've considered.

Open the docx file and number the bibliography items manually.

njbart commented 2 days ago

What about trying one of the 5000+ numeric CSL styles?

terris-peer commented 1 day ago

Thanks for the pointer @njbart !

I actually want to use author-date style citations but number (just "dumb numbering", has nothing to do with citations, really) the items in the bibliography. Perhaps it's not possible.

Also, I tried academic-medication.csl . The items in the "references" list were indeed numbered but the citation format used superscripted hyperlinked links, which is very cool but unfortunately is not what I want.

I will ask chatgpt for help. Thanks again.

terris-peer commented 1 day ago

I was able to get further with my own custom csl file. The references are numbered sequentially but they are not styled by Word as numbered items (long text is not properly indented). I might be able to achieve this with :::{custom-style=}.

terris-peer commented 1 day ago

Nesting as in the following doesn't work:

:::{custom-style="Numbered"}
:::{#refs}
:::
:::

It looks like I need to request a feature which I am willing to sponsor.

jgm commented 1 day ago

You could create a Lua filter that puts the bibliography entries into an ordered list.

terris-peer commented 1 day ago

@jgm thanks! I know how to do that.