emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Serge Cohen <serge.cohen@synchrotron-soleil.fr>
To: emacs-orgmode@gnu.org
Subject: LaTeX export and org-add-link-type
Date: Mon, 21 Jul 2014 15:28:11 +0200	[thread overview]
Message-ID: <31BC1F66-F059-4BD6-8AFA-B9992166CB05@synchrotron-soleil.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 1610 bytes --]

Hello list,

When using hte org to LaTeX exporter, I would like to use the link-type capabilities described here :
http://orgmode.org/worg/org-contrib/babel/examples/article-class.html#sec-3

To follow the instruction, I have added the lines to my ~/.emacs.el

(org-add-link-type
 "ltx" nil
 (lambda (path desc format)
   (cond
    ((eq format 'html)
     (format "<span style=\"color:grey;\" class=\"%s\">%s</span>" path desc))
    ((eq format 'latex)
     (format "\\%s{%s}" path desc)))))

I have even added the following call just after that (but I have the feeling this is un-necessary, since should already be done within org-add-link-type function).

(org-make-link-regexps)

Then adding a [[ltx:foo][albert]] to an org file, and exporting to a HTML buffer, I get what I am expecting :
<span style="color:grey;" class="foo">bar</span>

But when I export to a LaTeX buffer, irrelevant to what I use as link/path I get :
\texttt{bar}

To me this means that the org-link-type mechanism is bypassed when exporting to LaTeX (indeed from org-latex.el , I have the feeling that the function org-export-latex-link is taking care of the link parsing, without carrign for the content of org-link-types nor org-link-types-re).

Is this normal, if so is there another way to obtain the same results as what is proposed in the documentation ?

To complete the post : I am using Aquamacs (MacOSX gui-version), based on GNU emacs 23.4.1
The included version of org.el is Version: 6.33x

Hoping someone will be able to point me to the right direction. Thanks in advance,

Serge.



[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

             reply	other threads:[~2014-07-21 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 13:28 Serge Cohen [this message]
2014-07-21 14:19 ` LaTeX export and org-add-link-type Leonard Avery Randall
2014-07-29 14:38   ` Fabrice Niessen

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=31BC1F66-F059-4BD6-8AFA-B9992166CB05@synchrotron-soleil.fr \
    --to=serge.cohen@synchrotron-soleil.fr \
    --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).