From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Gerald Wildgruber <Gerald.Wildgruber@unibas.ch>
Cc: org mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Org-mode and/or org-ref citation formats
Date: Thu, 5 Jan 2017 12:41:15 -0500 [thread overview]
Message-ID: <CAJ51ETomnCkY1T4C+NdJMXnuBVssKUyS6VUrh8wr5oDv9Wr29w@mail.gmail.com> (raw)
In-Reply-To: <m2fukxbf0c.fsf@Sxedia.local>
[-- Attachment #1: Type: text/plain, Size: 2570 bytes --]
I don't know if it is possible to get helm-bibtex to insert links with
pre/post text in a way that doesn't get in the (i.e. my) way. I never use
pre/post text, so I want to select entries, and press enter to insert them.
There would have to be some prompt for pre and post text I think, and I
wouldn't want to press enter two more times to get empty ones.
You could write your own function for that like this:
#+BEGIN_SRC emacs-lisp
(defun my-insert (candidate)
(insert (format "[[cite:%s]%s]"
candidate
(let ((pre (read-input "pre-text: "))
(post (read-input "post text: ")))
(cond
;; both pre and post
((and (not (string= pre ""))
(not (string= post "")))
(format "[%s::%s]" pre post))
;; only pre
((and (not (string= pre ""))
(string= post ""))
(format "[%s]" pre))
((and (not (string= post ""))
(string= pre ""))
(format "[::%s]" post)))))))
(helm-add-action-to-source "pre/post insert cite" 'my-insert
helm-source-bibtex)
#+END_SRC
we already use C-u to insert a ref link, and C-u C-u to insert a label link
on C-c ] (which inserts a citation).
John
-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
On Thu, Jan 5, 2017 at 12:20 PM, Gerald Wildgruber <
Gerald.Wildgruber@unibas.ch> wrote:
>
> On Mi, Jan 04 2017, John Kitchin <jkitchin@andrew.cmu.edu> wrote:
>
>
> >> A simple link would be of the form "cite:MYREF" or "citep:MYREF"; but if
> >> I want to add a page number to this reference, the syntax of the link
> >> seems to be very different, like so: "[[citep:MYREF][PAGENUM]]" or
> >> [[citep:MYREF][::PAGENUM]].
> >
> > That is correct. Basically it is [[cite:key][pre text::post text]]
> >
> > You can type C-c C-l, select the link type, then the bibtex key, then
> > type in the description. There is no way to do it through helm-bibtex
> though.
>
> Thanks! Is there a reason why refs with pre- and post-text use the
> general Org-mode link syntax and insert mechanisms and not org-ref's own
> more powerful format and interface (helm-bibtex); why are they handled
> differently?
>
> Gerald.
>
>
> --
> Dr.Gerald Wildgruber
> eikones NFS Bildkritik
> NCCR Iconic Criticism
> Universität Basel
> Rheinsprung 11
> CH-4051 Basel
> www.eikones.ch
> T. +41 (0)61 267 18 02
> F. +41 (0)61 267 18 11
> ---------------------
> Sent with mu4e
>
[-- Attachment #2: Type: text/html, Size: 5120 bytes --]
prev parent reply other threads:[~2017-01-05 17:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 13:49 Org-mode and/or org-ref citation formats Gerald Wildgruber
2017-01-04 14:28 ` John Kitchin
2017-01-05 17:20 ` Gerald Wildgruber
2017-01-05 17:41 ` John Kitchin [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=CAJ51ETomnCkY1T4C+NdJMXnuBVssKUyS6VUrh8wr5oDv9Wr29w@mail.gmail.com \
--to=jkitchin@andrew.cmu.edu \
--cc=Gerald.Wildgruber@unibas.ch \
--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).