From mboxrd@z Thu Jan 1 00:00:00 1970 From: azw@fastmail.fm (Albert Z. Wang) Subject: Re: fill-paragraph: wrong behaviour after latex-environments Date: Thu, 03 May 2012 11:05:10 -0400 Message-ID: <87zk9pe255.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPxaw-00007o-JD for emacs-orgmode@gnu.org; Thu, 03 May 2012 11:05:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPxau-0000Rw-GS for emacs-orgmode@gnu.org; Thu, 03 May 2012 11:05:26 -0400 Received: from plane.gmane.org ([80.91.229.3]:42844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPxau-0000RZ-9N for emacs-orgmode@gnu.org; Thu, 03 May 2012 11:05:24 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SPxar-0007GT-1U for emacs-orgmode@gnu.org; Thu, 03 May 2012 17:05:21 +0200 Received: from c-24-61-131-59.hsd1.nh.comcast.net ([24.61.131.59]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 May 2012 17:05:21 +0200 Received: from azw by c-24-61-131-59.hsd1.nh.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 May 2012 17:05:21 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Benjamin Motz writes: > Hi, > > invoking fill-paragraph on the following org-code will delete the > newline after \end{equation}: > > The relation > \begin{equation} > E=mc^2 > \end{equation} > won't be further discussed here. > > This behaviour is undesirable because it makes the org-text less > readable. Also, when adding '%' after \end{equation}, newline is still > being deleted by fill-paragraph (and the text after '%' won't be > exported e.g. by latex-export). > > Is there a workaround or can someone point me to the location where I > can fix/change this behaviour? > > Thanks, Benjamin I had the same issue; fixed it by adding the following org-mode-hook: (add-hook 'org-mode-hook (lambda () ;; don't rewrap display equations into paragraphs (setq paragraph-separate (concat "[\\f \\t]*\\(\\\\begin{\\|\\\\end{\\|\\\\\\[\\|\\\\\\]\\)\\|" paragraph-separate)) )))) This sets several new paragraph boundary markers to prevent wrapping them into paragraphs: \begin{, \end{, and the unnumbered display equation shortcut \[, \].