From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: multi-line citation export issue
Date: Mon, 13 Jan 2014 22:56:22 +0100 [thread overview]
Message-ID: <87r48bzgu1.fsf@gmx.us> (raw)
In-Reply-To: alpine.OSX.2.00.1401131020260.11669@tbetbambyn.jubv.rqh
Ken Mankoff <mankoff@gmail.com> writes:
> Wow. I was going point out that citing for both formats is cumbersome
> and makes the document hard-to-read, but the MACRO solves this. I was
> not aware of MACRO's. I guess this is both the beauty and pain of Org
> and emacs, all this customization. And down the rabbit-hole I go,
> because now I need to redefine my RefTeX shortcut so that it inserts
> {{{cite(key)}}} instead of \cite{key}.
Another possibility is using links as suggested by Tom S. Dye. These
do not suffer from the newline problem you encountered. They do not
format nicely, though, if you have complicated cite-constructions.
Here's an example using biblatex syntax in LaTeX and a cite tag in
HTML:
(org-add-link-type
"textcite" 'ramus/find-lit
(lambda (path desc format)
(cond
((eq format 'html)
(format "(<cite>%s</cite>)" path))
((eq format 'odt)
(format "%s" path))
((eq format 'latex)
(if (or (not desc) (equal 0 (search "cite:" desc)))
(format "\\textcite{%s}" path)
(format "\\textcite[%s][%s]{%s}"
(cadr (split-string desc ";"))
(car (split-string desc ";")) path))))))
where rasmus/find-lit opens the correct pdf from my local archive, if
possible.
You can add reftex support in a manner similar to the following:
(with-eval-after-load 'org
(defun org-mode-reftex-setup ()
;; (load-library "reftex")
(require 'reftex)
(and (buffer-file-name)
(file-exists-p (buffer-file-name))
;; (reftex-parse-all)
)
(make-local-variable 'reftex-cite-format)
(setq reftex-cite-format 'org)
(define-key org-mode-map (kbd "C-c )") 'reftex-citation))
(add-hook 'org-mode-hook 'org-mode-reftex-setup))
(with-eval-after-load 'reftex
(add-to-list 'reftex-cite-format-builtin
'(org "Org-mode citation"
((?m . "[[cite:%l]]")
(?t . "[[textcite:%l]]")
(?p . "[[parencite:%l]]")
(?s . "[[citepos:%l]]")
(?a . "[[citeauthor:%l]]")
(?y . "[[citeyear:%l]]")
(?l . "%l")))))
–Rasmus
--
Send from my Emacs
prev parent reply other threads:[~2014-01-13 21:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-12 23:21 multi-line citation export issue Ken Mankoff
2014-01-12 23:23 ` Ken Mankoff
2014-01-13 0:02 ` Nicolas Goaziou
2014-01-13 2:04 ` Ken Mankoff
2014-01-13 11:07 ` Nicolas Goaziou
2014-01-13 15:23 ` Ken Mankoff
2014-01-13 21:56 ` Rasmus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r48bzgu1.fsf@gmx.us \
--to=rasmus@gmx.us \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).