Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug for textual citations? Extra author reference #139

Closed
jkitchin opened this issue May 10, 2023 · 1 comment
Closed

Possible bug for textual citations? Extra author reference #139

jkitchin opened this issue May 10, 2023 · 1 comment

Comments

@jkitchin
Copy link

In this code:


#+BEGIN_SRC bibtex :tangle test.bib
@article{kitchin-2015-examp,
  author =	 {Kitchin, John R.},
  title =	 {Examples of Effective Data Sharing in Scientific Publishing},
  journal =	 {ACS Catalysis},
  volume =	 {5},
  number =	 {6},
  pages =	 {3894-3899},
  year =	 2015,
  doi =		 {10.1021/acscatal.5b00538},
  url =		 { http://dx.doi.org/10.1021/acscatal.5b00538 },
  keywords =	 {DESC0004031, early-career, orgmode, Data sharing },
  eprint =	 { http://dx.doi.org/10.1021/acscatal.5b00538 },
}
#+END_SRC

#+BEGIN_SRC emacs-lisp :results code
(org-babel-tangle)

(defun render (csl-style data sentcase)
  (let* ((proc (citeproc-create csl-style
				(citeproc-hash-itemgetter-from-any "test.bib" sentcase)
				(citeproc-locale-getter-from-dir "../../../../org-ref/citeproc/csl-locales/")
				"en-US"))
	 (cites (list (citeproc-citation-create :cites data
						:mode 'textual
                                                  :suppress-affixes t
						:capitalize-first nil
						:suppress-affixes nil)))
	 (rendered-citations (progn (citeproc-append-citations cites proc)
				    (citeproc-render-citations proc 'org nil))))
    rendered-citations))


;; https://raw.githubusercontent.com/citation-style-language/styles/master/elsevier-harvard.csl
(render "elsevier-harvard.csl" '(((id . "kitchin-2015-examp")
				  (prefix . "See ")
				  (suffix . "")
				  (locator . "2")
				  (label . "page")
				  (suppress-author)))
	nil)
#+END_SRC

#+RESULTS:
#+begin_src emacs-lisp
("Kitchin See [[citeproc_bib_item_1][Kitchin, 2015, p. 2]]")
#+end_src

It appears there is an extra author (Kitchin) at the beginning of the output. I would have thought it should just be "See [[citeproc_bib_item_1][Kitchin, 2015, p. 2]]"

Is this a bug?

@andras-simonyi
Copy link
Owner

Not a bug, the problem's cause is that the current API doesn't support using `suppress-author' in cite alists, it is only allowed as a citation mode -- see the explanation given in the duplicate issue #151. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants