From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: changing \href to \myhref in LaTex export Date: Wed, 20 Jan 2010 10:28:52 +0100 Message-ID: <20BB6756-7513-43F2-A457-717F30D54FF7@gmail.com> References: <4B55D04B.7050305@ifi.uio.no> <87ockpdv93.fsf@mundaneum.com> <4B56CAB8.7080706@ifi.uio.no> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXWs0-00086l-Lm for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 04:29:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXWrw-00086N-5e for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 04:29:00 -0500 Received: from [199.232.76.173] (port=57459 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXWrv-00086K-U9 for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 04:28:55 -0500 Received: from mail-fx0-f228.google.com ([209.85.220.228]:48411) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXWrv-0007en-Hx for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 04:28:55 -0500 Received: by fxm28 with SMTP id 28so2998770fxm.26 for ; Wed, 20 Jan 2010 01:28:54 -0800 (PST) In-Reply-To: <4B56CAB8.7080706@ifi.uio.no> 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: "=?ISO-8859-1?Q?=22Martin_G._Skj=E6veland=22?=" Cc: =?ISO-8859-1?Q?S=E9bastien_Vauban?= , emacs-orgmode@gnu.org Hi Martin, OK, please pull and then use the variable `org-export-latex-hyperref-=20 format'. - Carsten On Jan 20, 2010, at 10:19 AM, Martin G. Skj=E6veland wrote: > S=E9bastien Vauban wrote: >> Hi Martin, >> "Martin G. Skj=E6veland" wrote: >>> is it possible to change how hyperlinks are exported to LaTex =20 >>> without going >>> into to org-latex.el, but setting by a variable or similar in =20 >>> my .emacs >>> file? >>> >>> I would like to export hyperlinks in Latex as \myhref (or =20 >>> something else) >>> instead of \href, so that I can redefine \myhref using \href, like =20= >>> 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 =20 >> works) is to >> redefine \href either in your private class (if you use one) or in =20= >> your TeX >> file. >> In the latter case, put the `renewcommand' in your Org source, so =20 >> that it gets >> exported every time. >> Example (with a `newcommand' here): >> --8<---------------cut here---------------start------------->8--- >> #+LaTeX_HEADER: \newcommand{\figtext}[2]{\begin{tikzpicture} \draw =20= >> (-#1/2,-#1/2) rectangle (#1/2,#1/2); \node[text width=3D#1] at (0,0) =20= >> {\color{blue}\scriptsize{#2}}; \end{tikzpicture}} >> --8<---------------cut here---------------end--------------->8--- >> I think, for this case, this offers more flexibility and allows you =20= >> to get >> what you want. > > Hi Seb, > > yes, this looks like the flexibility I'm after, but my problem with =20= > your solution is that by using \renewcommand I would be defining a =20 > recursive command, which does not work. (I should have mentioned =20 > that in my first email, sorry.) This is the reason for renaming the =20= > \href command in the export, so I can define my own href command =20 > using the standard href. > > The reason I want to do this in the first place is to make URLs =20 > available when the latex pdf is printed. > > Martin > > > _______________________________________________ > 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 - Carsten