[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 818bec5 1/2: oc-csl: Define \citeprocitem for LaTeX
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 818bec5 1/2: oc-csl: Define \citeprocitem for LaTeX export |
Date: |
Thu, 26 Aug 2021 04:57:15 -0400 (EDT) |
branch: externals/org
commit 818bec57eb97fd9f65cf380f32a2639d9647ed3d
Author: TEC <tec@tecosaur.com>
Commit: TEC <tec@tecosaur.com>
oc-csl: Define \citeprocitem for LaTeX export
* lisp/oc-csl.el (org-cite-csl-finalizer): In order for
citeproc-generated references to be treated the same as bib(la)tex
references by hyperref, we need to make use of \hyper@linkstart.
However, this requires \makeatletter and \makeatother, which can only be
used in the preamble. To allow citeproc-el to use \hyper@linkstart, we
add a command definition in the preamble, \citeprocitem.
---
lisp/oc-csl.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el
index 0a05703..617bddb 100644
--- a/lisp/oc-csl.el
+++ b/lisp/oc-csl.el
@@ -589,6 +589,8 @@ property list."
(with-temp-buffer
(save-excursion (insert output))
(when (search-forward "\\begin{document}" nil t)
+ ;; Ensure that \citeprocitem is defined for citeproc-el
+ (insert
"\\makeatletter\n\\newcommand{\\citeprocitem}[2]{\\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\\hyper@linkend}\n\\makeatother\n\n")
;; Ensure there is a \usepackage{hanging} somewhere or add one.
(goto-char (match-beginning 0))
(let ((re (rx "\\usepackage" (opt "[" (*? nonl) "]") "{hanging}")))