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.
This commit is contained in:
parent
3664447eb2
commit
818bec57eb
|
@ -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}")))
|
||||
|
|
Loading…
Reference in New Issue