[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Citations, continued
From: |
Thomas S. Dye |
Subject: |
Re: [O] Citations, continued |
Date: |
Mon, 02 Feb 2015 14:54:40 -1000 |
Hi John,
Wow. It's inspiring to see Samuel's idea in action.
Presumably, something like this would also be possible?
;; follow function
(lambda (path)
(let* ((data (read (concat "(" path ")")))
(head (car data))
(plist (cadr data)))
(funcall (plist-get plist :follow) head)))
[[slink:kitchin-2010 (:pre "See for example" :post "page 47" :type
cite :follow #'ebib-open-org-link)]]
All the best,
Tom
John Kitchin <address@hidden> writes:
>> I'm glad you like Samuel's idea about extensible syntax for links. I
>> don't know if it is practical or not, but it was one of those ideas that
>> seemed right on when I first read it.
>
> I am glad you mentioned, it was an inspiration! Although this is sure to
> move away from a standard new syntax, it is straightforward to subvert a
> link like the following example to get more readable pre/post text
> example. The quotes are necessary to get the list read
> correctly. Whether this is useful remains to be seen, but it was fun to
> work it out.
>
> #+BEGIN_SRC emacs-lisp :results silent
> (org-add-link-type
> "slink"
> ;; follow function
> (lambda (path)
> (let* ((data (read (concat "(" path ")")))
> (head (car data))
> (plist (cadr data)))
> (message-box "%s\n%s\n%s" head plist (plist-get plist :type))))
> ;; format function
> (lambda (path description backend)
> (let* ((data (read (concat "(" path ")")))
> (head (car data))
> (plist (cadr data)))
> (format "\\%s[%s][%s]{%s}"
> (plist-get plist :type)
> (plist-get plist :pre)
> (plist-get plist :post)
> head))))
> #+END_SRC
>
>
>
> Exports to:
>
> #+BEGIN_EXAMPLE
> \cite[See for example][page 47]{kitchin-2010}
> #+END_EXAMPLE
>
>
>
>
>>
>> All the best,
>> Tom
>
> --
> 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
>
>
--
Thomas S. Dye
http://www.tsdye.com
- Re: [O] Citations, continued, John Kitchin, 2015/02/01
- Re: [O] Citations, continued, Richard Lawrence, 2015/02/01
- Re: [O] Citations, continued, Thomas S. Dye, 2015/02/01
- Re: [O] Citations, continued, John Kitchin, 2015/02/02
- Re: [O] Citations, continued, Thomas S. Dye, 2015/02/02
- Re: [O] Citations, continued, John Kitchin, 2015/02/02
- Re: [O] Citations, continued, John Kitchin, 2015/02/02
- Re: [O] Citations, continued, Rasmus, 2015/02/02
- Re: [O] Citations, continued,
Thomas S. Dye <=
- Re: [O] Citations, continued, John Kitchin, 2015/02/02
- Re: [O] Citations, continued, Rasmus, 2015/02/02
- Re: [O] Citations, continued, Richard Lawrence, 2015/02/02
Re: [O] Citations, continued, Rasmus, 2015/02/02
Re: [O] Citations, continued, Rasmus, 2015/02/02