emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: changing \href to \myhref in LaTex export
Date: Wed, 20 Jan 2010 09:40:40 +0100	[thread overview]
Message-ID: <87ockpdv93.fsf@mundaneum.com> (raw)
In-Reply-To: 4B55D04B.7050305@ifi.uio.no

Hi Martin,

"Martin G. Skjæveland" wrote:
>
> is it possible to change how hyperlinks are exported to LaTex without going
> into to org-latex.el, but setting by a variable or similar in my .emacs
> file?
>
> I would like to export hyperlinks in Latex as \myhref (or something else)
> instead of \href, so that I can redefine \myhref using \href, like this
>
>    \usepackage{ifthen}
>    \newcommand{\myhref}[2]{
>      \ifthenelse{\equal{#1}{#2}}
>        {\href{#1}{#2}}
>        {\href{#1}{#2}\footnote{\url{#1}}}
>      }
>
> and thus include the URLs of the links as footnotes.

Not answering clearly your question, but an alternative (that works) is to
redefine \href either in your private class (if you use one) or in your TeX
file.

In the latter case, put the `renewcommand' in your Org source, so that it gets
exported every time.

Example (with a `newcommand' here):

--8<---------------cut here---------------start------------->8---
#+LaTeX_HEADER: \newcommand{\figtext}[2]{\begin{tikzpicture} \draw (-#1/2,-#1/2) rectangle (#1/2,#1/2); \node[text width=#1] at (0,0) {\color{blue}\scriptsize{#2}}; \end{tikzpicture}}
--8<---------------cut here---------------end--------------->8---

I think, for this case, this offers more flexibility and allows you to get
what you want.

Best regards,
  Seb

-- 
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-01-20  8:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-19 15:31 changing \href to \myhref in LaTex export "Martin G. Skjæveland"
2010-01-20  8:40 ` Sébastien Vauban [this message]
2010-01-20  9:19   ` "Martin G. Skjæveland"
2010-01-20  9:28     ` Carsten Dominik
2010-01-20 10:00       ` "Martin G. Skjæveland"
2010-01-20 11:10     ` Sébastien Vauban
2010-01-20 12:08       ` Carsten Dominik
2010-01-20 13:00       ` "Martin G. Skjæveland"

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=87ockpdv93.fsf@mundaneum.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).