[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] State of the art in citations
From: |
Thomas S. Dye |
Subject: |
Re: [O] State of the art in citations |
Date: |
Sun, 27 Apr 2014 06:01:21 -1000 |
Clément B. <address@hidden> writes:
> Hi Leonard,
>
>> I am in the process of writing a new package for inserting
>> citations into org buffers using RefTeX.
>
> I'd be interested to know what you have in mind. I use something
> of the sort, by customising `reftex-cite-format`, e.g:
>
> (setq reftex-cite-format
> '((?\C-m . "\\cite[]{%l}")
> (?b . "[[ref:%l][%A (%y)]]")))
>
> This makes inserting custom links ("ref") easier with the usual
> `reftex-citation` bound to C-c [.
>
>
>> On the other hand, it will work with multicite commands,
>> whereas Clement's does not look like it will.
>
> It does not, and that's a big limitation. That being said, I don't
> know how to go about mixing multiple citations and links to the
> bib file. This is definitely something I care about, being able
> to quickly jump from the text to the bibliographic entry, PDF
> file, or whatever source I am using to write is one of the main
> reasons I use org instead of plain LaTeX.
One approach for muliticites is to drop a placeholder and then replace
it with an export filter. I've been using these two for a while and
they seem to work fine.
** Filters for multicites
*** Filter for parencites
Add the placeholder with alt-p
#+name: tsd-parencites
#+BEGIN_SRC emacs-lisp
(defun tsd-latex-filter-parencites (text backend info)
"Replace parencites placeholders in Beamer/LaTeX export."
(when (memq backend '(beamer latex))
(replace-regexp-in-string "π" "\\parencites" text nil t)))
(add-to-list 'org-export-filter-plain-text-functions
'tsd-latex-filter-parencites)
#+END_SRC
*** Filter for textcites
Add the placeholder with alt-t
#+name: tsd-textcites
#+BEGIN_SRC emacs-lisp
(defun tsd-latex-filter-textcites (text backend info)
"Replace textcites placeholders in Beamer/LaTeX export."
(when (memq backend '(beamer latex))
(replace-regexp-in-string "†" "\\textcites" text nil t)))
(add-to-list 'org-export-filter-plain-text-functions
'tsd-latex-filter-textcites)
#+END_SRC
It looks like this in the text:
A recent replication experiment that used stone tools in
the manufacture of an outrigger canoe identified six functional types
of stone adze that correspond generally with the six types established
by Duff
π[[multicite:turner00:_funct_desig_distr_new_zealan_adzes][;;turner
diss]] [[multicite:turner05:_funct_and_techn_explan_for][;;turner
nzja]].
My link syntax is a bit different, but the same basic idea:
(org-add-link-type
"multicite" 'ebib-open-org-link
(lambda (path desc format)
(cond
((eq format 'latex)
(if (not desc) (format "{%s}" path)
(format "[%s][%s]{%s}"
(cadr (split-string desc ";"))
(car (split-string desc ";")) path))))))
hth,
Tom
--
Thomas S. Dye
http://www.tsdye.com
- [O] State of the art in citations, Julian M. Burgos, 2014/04/25
- Re: [O] State of the art in citations, Clément B ., 2014/04/26
- Re: [O] State of the art in citations, Clément B ., 2014/04/26
- Re: [O] State of the art in citations, Leonard Randall, 2014/04/27
- Re: [O] State of the art in citations, Clément B ., 2014/04/27
- Re: [O] State of the art in citations, Ken Mankoff, 2014/04/27
- Re: [O] State of the art in citations,
Thomas S. Dye <=
- Re: [O] State of the art in citations, Ken Mankoff, 2014/04/27
- Re: [O] State of the art in citations, Clément B ., 2014/04/27
- Re: [O] State of the art in citations, John Kitchin, 2014/04/27
- Re: [O] State of the art in citations, Clément B ., 2014/04/27
- Re: [O] State of the art in citations, Julian M. Burgos, 2014/04/28
- Re: [O] State of the art in citations, Julian M. Burgos, 2014/04/28
Re: [O] State of the art in citations, Vikas Rawal Lists, 2014/04/29
Re: [O] State of the art in citations, Vikas Rawal Lists, 2014/04/29
Re: [O] State of the art in citations, Clément B ., 2014/04/27