emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-add-link-type
Date: Mon, 27 Dec 2010 07:10:06 +0100	[thread overview]
Message-ID: <4D182DBE.8030504@christianmoe.com> (raw)
In-Reply-To: <CA64C7FD-68A3-4120-B883-662A520470A4@tsdye.com>

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
>

  reply	other threads:[~2010-12-27  6:07 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 ` Christian Moe [this message]
2010-12-27  7:06   ` org-add-link-type Thomas S. Dye
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=4D182DBE.8030504@christianmoe.com \
    --to=mail@christianmoe.com \
    --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).