emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.com>
To: mail@christianmoe.com
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-add-link-type
Date: Sun, 26 Dec 2010 21:06:31 -1000	[thread overview]
Message-ID: <348CF591-80F3-414A-BDD4-895410F5DEA6@tsdye.com> (raw)
In-Reply-To: <4D182DBE.8030504@christianmoe.com>

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.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-12-27  7:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-27  0:29 org-add-link-type Thomas S. Dye
2010-12-27  6:10 ` org-add-link-type Christian Moe
2010-12-27  7:06   ` Thomas S. Dye [this message]
2010-12-27 10:58     ` org-add-link-type Christian Moe
2011-01-17 18:35     ` org-add-link-type Bastien
2011-01-18 17:45       ` org-add-link-type Thomas S. Dye
2011-02-12 22:39         ` org-add-link-type Bastien
2011-02-12 23:16           ` org-add-link-type Thomas S. Dye
2011-02-12 23:32             ` org-add-link-type Bastien

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=348CF591-80F3-414A-BDD4-895410F5DEA6@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@christianmoe.com \
    /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).