emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: azw@fastmail.fm (Albert Z. Wang)
To: emacs-orgmode@gnu.org
Subject: Re: fill-paragraph: wrong behaviour after latex-environments
Date: Thu, 03 May 2012 11:05:10 -0400	[thread overview]
Message-ID: <87zk9pe255.fsf@gmail.com> (raw)
In-Reply-To: u13bkr4v1ifr3.fsf@majorana.uni-muenster.de

Benjamin Motz <b.motz@uni-muenster.de> 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 \[, \].

  reply	other threads:[~2012-05-03 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03 12:57 fill-paragraph: wrong behaviour after latex-environments Benjamin Motz
2012-05-03 15:05 ` Albert Z. Wang [this message]
2012-05-03 15:23   ` Benjamin Motz
2012-05-05  6:39 ` Bastien
2012-05-05 16:13   ` Nicolas Goaziou

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=87zk9pe255.fsf@gmail.com \
    --to=azw@fastmail.fm \
    --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).