emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] org-add-link-type


From: Thomas S. Dye
Subject: Re: [Orgmode] org-add-link-type
Date: Sun, 26 Dec 2010 21:06:31 -1000

Hi Christian,

Thanks, I've put away my copy of ANSI Common Lisp.

The results surprise me.

  (org-add-link-type
   "citet" 'ebib
   (lambda (path desc format)
     (cond
      ((eq format 'latex)
       (if (and desc)
             (format "\\citet[%s]{%s}" desc path)
             (format "\\citet{%s}" path))))))

[[citet:green84:_settl_patter_studies_ocean]]

yields this:

\citet[citet:green84:_settl\_patter\_studies\_ocean] {green84:_settl_patter_studies_ocean}

All the best,
Tom

On Dec 26, 2010, at 8:10 PM, Christian Moe wrote:

Hi, Thomas,

Try it with "if" rather than "when".

Yours,
Christian


On 12/27/10 1:29 AM, Thomas S. Dye wrote:
Aloha all,

Sorry in advance for coming to the list with a beginner type question,
but I'm stumped.

I'm trying to use the extended link syntax to export citations to
LaTeX. If the link lacks a description, then I don't want the \citep
command to have an optional argument. As I understand the
documentation, if the description is absent, then the variable desc is
nil, so the following looks good to my untrained eye. But, it doesn't
add the optional argument when the description is present.

(org-add-link-type
"citep" 'ebib
(lambda (path desc format)
(cond
((eq format 'latex)
(when (and desc)
(format "\\citep[%s]{%s}" desc path)
(format "\\citep{%s}" path))))))

All the best,
Tom

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

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