emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-add-link-type
Date: Mon, 27 Dec 2010 11:58:46 +0100	[thread overview]
Message-ID: <4D187166.4020806@christianmoe.com> (raw)
In-Reply-To: <348CF591-80F3-414A-BDD4-895410F5DEA6@tsdye.com>

Hi again,

That is indeed surprising. It looks as if an empty desc is never 
passed, instead it is replaced with the full raw path. I don't think 
that's the right behavior, and I don't really see how it could result 
from org-export-latex-links.

Hadn't noticed this before because my own "cite" links all have a desc 
part, e.g. [[cite:green84][Green, 1984]], and then the problem doesn't 
come up.

Yours,
Christian


On 12/27/10 8:06 AM, Thomas S. Dye wrote:
> 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 10:56 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   ` org-add-link-type Thomas S. Dye
2010-12-27 10:58     ` Christian Moe [this message]
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=4D187166.4020806@christianmoe.com \
    --to=mail@christianmoe.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.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).