zepinglee / citeproc-lua

A Lua implementation of the Citation Style Language (CSL) for use with LaTeX
MIT License
66 stars 8 forks source link

Bug with cite position #51

Closed epireyn closed 3 months ago

epireyn commented 11 months ago

Describe the bug Two consecutive cites to the same reference are considered "subsequent" but not "Ibid (with locator)". This happens when name-as-sort-order="all" and that the reference only has one author. It doesn't happen if it has more than one author or if name-as-sort-order="first".

Additional information

To Reproduce

\documentclass{article}

\begin{filecontents}[overwrite, noheader]{\jobname.json}
[
    {
    "ISBN": "9782200632694",
    "author": [
      {
        "family": "Amossy",
        "given": "Ruth"
      },
      {
        "family": "Pierrot",
        "given": "Anne Herschberg"
      }
    ],
    "collection-title": "Cursus",
    "edition": "4",
    "id": "Amossy2021",
    "issued": {
      "date-parts": [
        [
          2021,
          6,
          9
        ]
      ]
    },
    "keyword": "General, Language Arts & Disciplines, Social Science",
    "publisher": "Armand Colin",
    "publisher-place": "Paris",
    "title": "Stéréotypes et clichés : Langue, discours, société",
    "title-short": "Stéréotypes et clichés ",
    "type": "book"
  },
  {
    "ISBN": "2871300658",
    "author": [
      {
        "family": "Lits",
        "given": "Marc"
      }
    ],
    "collection-number": "4",
    "collection-title": "Bibliothèque des paralittératures",
    "edition": "2",
    "id": "Lits1999",
    "issued": {
      "date-parts": [
        [
          1999
        ]
      ]
    },
    "number-of-pages": "208",
    "publisher": "Éd. du CÉFAL",
    "publisher-place": "Liège",
    "title": "Le roman policier: Introduction à la théorie et à l’histoire d’un genre littéraire",
    "title-short": "Le roman policier",
    "type": "book"
  },
]
\end{filecontents}

\usepackage[style = chicago-note-bibliography]{citation-style-language}
\addbibresource{\jobname.json}
\usepackage{hyperref}

\begin{document}
This is the first cite\cite[page = 103--200]{Amossy2021}

This is the second cite\cite[page = 103--104]{Amossy2021}

These should be working correctly. But if I cite those two:

First\cite[page = 105--130]{Lits1999}

Second\cite[page = 105--130]{Lits1999}

The page range doesn't matter. It can be null, different or identical.

\printbibliography
\end{document}

Screenshots image

zepinglee commented 9 months ago

Two consecutive cites to the same reference are considered "subsequent" but not "Ibid (with locator)".

I can't reproduce the results in the screenshot with the given TeX code. My output is as follows.

Screenshot 2024-02-22 at 13 48 41

Note 2 and 4 are exactly produced from the "ibid ibid-with-locator" branch of chicago-note-bibliography.csl. Note that title-short isn't outputted.

https://github.com/zepinglee/citeproc-lua/blob/e981bb38fcf6ed97d5f4030b4f04fade92ea5117/submodules/styles/chicago-note-bibliography.csl#L1361-L1381

Are you expecting the ibid. term? Perhaps you can use chicago-note-bibliography-with-ibid.csl or chicago-fullnote-bibliography-with-ibid.csl.

This happens when name-as-sort-order="all" and that the reference only has one author. It doesn't happen if it has more than one author or if name-as-sort-order="first".

This is not likely to happen. Can you provide the full CSL style?

epireyn commented 9 months ago

Hello, Thank you for your response.

I made it work by deleting the output folder before compiling again, so the issue probably comes from one of the compiled files. In other words, it only works when citeproc is run for the first time. All the other times, the described issue occured.

On Thu, 22 Feb 2024, 07:02 Zeping Lee, @.***> wrote:

Two consecutive cites to the same reference are considered "subsequent" but not "Ibid (with locator)".

I can't reproduce the results in the screenshot with the given TeX code. My output is as follows. Screenshot.2024-02-22.at.13.48.41.png (view on web) https://github.com/zepinglee/citeproc-lua/assets/12290822/7999efb4-a273-40ad-befe-20bbebb8ed73

Note 2 and 4 are exactly produced from the "ibid ibid-with-locator" branch of chicago-note-bibliography.csl. Note that title-short isn't outputted.

https://github.com/zepinglee/citeproc-lua/blob/e981bb38fcf6ed97d5f4030b4f04fade92ea5117/submodules/styles/chicago-note-bibliography.csl#L1361-L1381

Are you expecting the ibid. term? Perhaps you can use chicago-note-bibliography-with-ibid.csl https://github.com/citation-style-language/styles/blob/master/chicago-note-bibliography-with-ibid.csl or chicago-fullnote-bibliography-with-ibid.csl https://github.com/citation-style-language/styles/blob/master/chicago-fullnote-bibliography-with-ibid.csl .

This happens when name-as-sort-order="all" and that the reference only has one author. It doesn't happen if it has more than one author or if name-as-sort-order="first".

This is not likely to happen. Can you provide the full CSL style?

— Reply to this email directly, view it on GitHub https://github.com/zepinglee/citeproc-lua/issues/51#issuecomment-1958762072, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALP2YTCTBHQU4URUQA4YDM3YU3NPLAVCNFSM6AAAAABAOAATO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJYG43DEMBXGI . You are receiving this because you authored the thread.Message ID: @.***>

zepinglee commented 8 months ago

I made it work by deleting the output folder before compiling again, so the issue probably comes from one of the compiled files. In other words, it only works when citeproc is run for the first time. All the other times, the described issue occured.

Please provide a full example so that I can help.