[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] User-customizable RefTeX citations

From: Tassilo Horn
Subject: Re: [AUCTeX-devel] User-customizable RefTeX citations
Date: Tue, 16 Oct 2012 08:36:48 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux)

Mark Edgington <address@hidden> writes:

Hi Mark,

> There is already the reftex-get-bib-field command defined within
> reftex-cite.el that will get the contents of an arbitrary field of an
> entry.

Ah, indeed, but you need to have the entry at hand.

> But I guess this isn't globally accessible, so it would need to be
> passed to a "reftex-cite-formatter" function (in addition to passing
> which entry was selected).
> It seems better to have a user-defined formatter function like this
> because then one can modify reftex-set-cite-format so that inserting a
> reference that depends on a nonstandard field having a nonstandard
> format will work by simply choosing your custom citation format, and
> then choosing which bibtex entry you want to use from your
> bibtex-file.  Adding a separate command that you need to manually
> execute after creating the reference feels like a hack that doesn't
> integrate smoothly into the standard RefTeX workflow.

I can envision something like Gnus has in its format specs for group and
summary line format.  There you can have format specs like %u1, %u2, etc
which will be formatted according to user-defined functions
gnus-user-format-function-1, gnus-user-format-function-2, etc.

> As a side note, a nice example of where user-definable citation
> formatter functions would be useful is with the workflow / system
> described in
> .  If your bibtex file contains the PDF file paths in nonstandard
> fields/formats, as mine does, having such formatter functions allow
> the field's data to be extracted and manipulated before inserting it
> in a citation.

Hm, ok.  So you'd define a reftex-user-format-1 function or so that
picks out the file from the entry, and then you could do

  (reftex-set-cite-format '((?x . "\cite{%l}%% file: %u1\n"))

to insert

  \cite{SomeEntry} % file: /home/me/docs/SomeDoc.pdf

which you could quickly open with `ffap'...

Looks doable.  Currently, I don't have much spare time, so don't hold
your breath.  Patches welcome if you're willing to sign a CA, of course.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]