From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: org-add-link-type Date: Sun, 26 Dec 2010 14:29:23 -1000 Message-ID: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=52206 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PX0xw-00030d-Te for emacs-orgmode@gnu.org; Sun, 26 Dec 2010 19:29:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PX0xw-0000nm-1x for emacs-orgmode@gnu.org; Sun, 26 Dec 2010 19:29:32 -0500 Received: from oproxy2-pub.bluehost.com ([67.222.39.60]:58025) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PX0xv-0000nR-Nr for emacs-orgmode@gnu.org; Sun, 26 Dec 2010 19:29:32 -0500 Received: from cpe-66-91-68-127.hawaii.res.rr.com ([66.91.68.127] helo=[192.168.1.2]) by box472.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1PX0xq-0003Sd-13 for emacs-orgmode@gnu.org; Sun, 26 Dec 2010 17:29:26 -0700 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: emacs-orgmode ml 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