From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [patch] overprotective begin/end during latex export Date: Sun, 13 Jun 2010 09:25:37 -0700 Message-ID: <87y6eidhmm.fsf@gmail.com> References: <87pqzvqzbg.fsf@gmail.com> <87ocffszx8.wl%n.goaziou@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=47744 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONq0F-0003xZ-O0 for emacs-orgmode@gnu.org; Sun, 13 Jun 2010 12:25:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONq0E-0003rw-Cl for emacs-orgmode@gnu.org; Sun, 13 Jun 2010 12:25:43 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:43623) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONq0E-0003rj-7d for emacs-orgmode@gnu.org; Sun, 13 Jun 2010 12:25:42 -0400 Received: by pxi1 with SMTP id 1so4543271pxi.0 for ; Sun, 13 Jun 2010 09:25:40 -0700 (PDT) In-Reply-To: <87ocffszx8.wl%n.goaziou@gmail.com> (Nicolas Goaziou's message of "Sun, 13 Jun 2010 17:41:23 +0200") 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: Nicolas Goaziou Cc: Org Mode Hi Nicolas, Your patch has been applied, many thanks. I looked at your previous email, and it's not immediately clear to me where the problem is either. Thanks for the quick solution on this issue however -- Eric Nicolas Goaziou writes: >>>>>> Eric Schulte writes: > > Hello, > >> I've run across the following bug a couple of times before, but have >> finally had a chance to really distill it. When exporting the following > >> --8<---------------cut here---------------start------------->8--- >> #+TITLE: latex environments bug > >> there is markup /out here/ > >> #+LaTeX: \begin{enumerate} > >> but *no markup* in here > >> #+LaTeX: \end{enumerate} > >> and markup _down here_ as well >> --8<---------------cut here---------------end--------------->8--- > >> everything works as expected, except that the > >> but *no markup* in here > >> line is *not* exported to LaTeX, but is rather copied verbatim into the >> final LaTeX file. > > It is because org-latex.el doesn't check if \begin{enumerate} is > already protected or not. Thus, it treats it as if it was some plain > LaTeX code inside the file. > > In other words, > > #+LaTeX: \begin{enumerate} > *bold* > #+LaTeX: \end{enumerate} > > is the same as > > \begin{enumerate} > *bold* > \end{enumerate} > > In this case, org-latex protects everything between \begin and \end, > making it impossible to apply modifications to the text in-between. > > With the following patch, org-latex will not protect an environment > coming from a #+LaTeX: instruction. > > Btw, a bug I described some day ago (about org-latex badly exporting > lists when an equation spans across two lines) is also about > over protection. I have a workaround, but I still don't understand > why protection is needed for lists. > > HTH,