emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Julien Barnier <julien@no-log.org>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix regexp error for protecting final } when exporting emphasis elements to latex
Date: Wed, 09 Dec 2009 15:35:20 +0100	[thread overview]
Message-ID: <87ocm843mf.fsf@z.nozav.org> (raw)

Hi,

I recntly noticed that in some specific cases, the final '}' was
esacped when exproting an emphasis element to LaTeX.

For example, the following element :

/éaa/

Is exported to :

\emph{éaa\}

This does not append if the string begins with a space or if it
is ASCII-only. For example, the followig strings are exported
correctly :

/aaa/
 /ééé/

I don't understand why the problem only occurs with non-ASCII chars,
but I think that the regexp to protect added special chars in the
org-export-latex-fontify function is missing a '?' in the
beginning. Tha attached patch corrects it.

Thanks for all,

Julien

---
 lisp/org-latex.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index ce697a3..3d25139 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1508,7 +1508,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
        (if (caddr emph)
            (setq rpl (org-export-latex-protect-string rpl))
          (save-match-data
-           (if (string-match "\\`.\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
+           (if (string-match "\\`.?\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
                (progn
                  (add-text-properties (match-beginning 1) (match-end 1)
                                       '(org-protected t) rpl)
-- 
1.6.5.3

             reply	other threads:[~2009-12-09 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 14:35 Julien Barnier [this message]
2009-12-09 21:35 ` [PATCH] Fix regexp error for protecting final } when exporting emphasis elements to latex Carsten Dominik

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=87ocm843mf.fsf@z.nozav.org \
    --to=julien@no-log.org \
    --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).