From: Bastien <bastien.guerry@wikimedia.fr>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: Org Mode <emacs-orgmode@gnu.org>, mail@christianmoe.com
Subject: Re: org-add-link-type
Date: Mon, 17 Jan 2011 19:35:05 +0100 [thread overview]
Message-ID: <87fwsr1iqu.fsf@altern.org> (raw)
In-Reply-To: <348CF591-80F3-414A-BDD4-895410F5DEA6@tsdye.com> (Thomas S. Dye's message of "Sun, 26 Dec 2010 21:06:31 -1000")
Hi Thomas,
"Thomas S. Dye" <tsd@tsdye.com> writes:
> (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}
This is because "_" chars are usually protected from conversion in
links, but the LaTeX exporter might be confused by links it doesn't
know.
What about this :
(org-add-link-type
"citet" 'ebib
(lambda (path desc format)
(cond
((eq format 'latex)
(if (and desc)
(org-export-latex-protect-string
(format "\\citet[%s]{%s}" desc path))
(org-export-latex-protect-string
(format "\\citet{%s}" path)))))))
Check for other uses of `org-export-latex-protect-string' in
org-latex.el to better understand in what contexts this function
is useful.
HTH,
--
Bastien
next prev parent reply other threads:[~2011-01-17 18:36 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 ` org-add-link-type Christian Moe
2011-01-17 18:35 ` Bastien [this message]
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=87fwsr1iqu.fsf@altern.org \
--to=bastien.guerry@wikimedia.fr \
--cc=emacs-orgmode@gnu.org \
--cc=mail@christianmoe.com \
--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).