auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] adding datestamp to reftex-set-cite-format


From: Karl Voit
Subject: Re: [AUCTeX] adding datestamp to reftex-set-cite-format
Date: Wed, 8 Jun 2011 15:22:41 +0200
User-agent: slrn/0.9.9 (Linux)

* Karl Voit <address@hidden> wrote:
>
> Although there is one small issue with the solution above: it
> results in a so called »inactive timestamp« which is surrounded by
> square brackets »[...]«. See also [1].
>
> My world would be perfect if there would be an »active timestamp«
> surrounded by inequality signs »<...>«

I found the solution with a little help of a friend and want to post
it for reference:

,----[ the whole part ]
| (defadvice reftex-format-citation (before eval-citation-format)
|   (setq format (eval format)))
|
| (defun org-mode-reftex-setup ()
|   (load-library "reftex")
|   (and (buffer-file-name) (file-exists-p (buffer-file-name))
|        (progn
|      ;enable auto-revert-mode to update reftex when bibtex file changes on 
disk
|      (global-auto-revert-mode t)
|      (reftex-parse-all)
|      ;add a custom reftex cite format to insert links
|      (reftex-set-cite-format
|       '((?b . "[[bib:%l][%l-bib]]")
|         (?n . "[[notes:%l][%l-notes]]")
|         (?p . "[[papers:%l][%l-pdf]]")
|         (?t . "%t")
|         (?h . (concat "* %l - %t\n:PROPERTIES:\n:Created: "
|               "<" (substring (format-time-string (org-time-stamp-format t t)) 
1 -1) ">"
|               "\n:Custom_ID: %l\n:END:\n[[papers:%l][%l-pdf]] 
[[bib:%l][%l-bib]]"))
|         ))))
|   (define-key org-mode-map (kbd "C-c )") 'reftex-citation)
|   (define-key org-mode-map (kbd "C-c (") 'org-mode-reftex-search))
`----

-- 
Karl Voit




reply via email to

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