emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <dominik@science.uva.nl>
To: Christian Egli <christian.egli@sbszh.ch>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Fix the export of underscores in links in the LaTeX export
Date: Thu, 8 Jan 2009 14:25:38 +0100	[thread overview]
Message-ID: <2889E437-8904-4F48-A2FE-DA8650A1F04F@uva.nl> (raw)
In-Reply-To: <j2vdsqhs3n.fsf@sbszh.ch>

Thanks for the patch, I am fixing this problem
on a more fundamental level, already during preprocessing.

- Carsten

On Jan 8, 2009, at 1:58 PM, Christian Egli wrote:

> Hi
>
> I have the attached org file which I export to LaTeX. With the current
> version of git the export produces the link as follows:
>
> \href{http://wiki.dspace.org/index.php/Configure\_media\_{}filters} 
> {media filters}
>
> Notice the spurious '{}' before filters. Needless to say this link
> doesn't work.
>
> I tried to understand the source of the problem and came up with the
> following patch which seems to work. However since I don't quite
> understand this code you should take my change with a grain of salt.
> With my patch I now get the following link.
>
> \href{http://wiki.dspace.org/index.php/Configure\_media\_filters} 
> {media filters}
>
> #+OPTIONS:   ^:nil TeX:nil toc:nil
>
> * Title
> ** Subtitle
> [[http://wiki.dspace.org/index.php/Configure_media_filters][media  
> filters]]
>
> Thanks
> Christian
> ---
> lisp/org-export-latex.el |    7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/org-export-latex.el b/lisp/org-export-latex.el
> index daa75dc..eeb8199 100644
> --- a/lisp/org-export-latex.el
> +++ b/lisp/org-export-latex.el
> @@ -958,12 +958,13 @@ SUBSUP corresponds to the ^: option in the # 
> +OPTIONS line.
> Convert CHAR depending on STRING-BEFORE and STRING-AFTER."
>   (cond ((equal string-before "\\")
> 	 (concat string-before char string-after))
> +	; deal with links
> +	((eq 'org-link (get-text-property 0 'face char))
> +	 (concat string-before "\\" char string-after))
> 	;; this is part of a math formula
> 	((and (string-match "\\S-+" string-before)
> 	      (string-match "\\S-+" string-after))
> -	 (cond ((eq 'org-link (get-text-property 0 'face char))
> -		(concat string-before "\\" char string-after))
> -	       ((save-match-data (org-inside-latex-math-p))
> +	 (cond ((save-match-data (org-inside-latex-math-p))
> 		(if subsup
> 		    (cond ((eq 1 (length string-after))
> 			   (concat string-before char string-after))
> -- 
> 1.5.6.3
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

      reply	other threads:[~2009-01-08 13:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 12:58 [PATCH] Fix the export of underscores in links in the LaTeX export Christian Egli
2009-01-08 13:25 ` Carsten Dominik [this message]

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=2889E437-8904-4F48-A2FE-DA8650A1F04F@uva.nl \
    --to=dominik@science.uva.nl \
    --cc=christian.egli@sbszh.ch \
    --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).