From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: org-add-link-type Date: Mon, 27 Dec 2010 07:10:06 +0100 Message-ID: <4D182DBE.8030504@christianmoe.com> References: Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=46507 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PX6F7-0004I0-8h for emacs-orgmode@gnu.org; Mon, 27 Dec 2010 01:07:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PX6F6-0006NX-4q for emacs-orgmode@gnu.org; Mon, 27 Dec 2010 01:07:37 -0500 Received: from mars.hitrost.net ([91.185.211.18]:30342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PX6F5-0006NT-T7 for emacs-orgmode@gnu.org; Mon, 27 Dec 2010 01:07:36 -0500 Received: from lk.92.63.17.213.dc.cable.static.lj-kabel.net ([92.63.17.213] helo=Celebrian.local) by mars.hitrost.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1PX6F3-00030C-JC for emacs-orgmode@gnu.org; Mon, 27 Dec 2010 07:07:33 +0100 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode 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 >