[-- Attachment #1.1: Type: text/plain, Size: 439 bytes --] Hi all, having only used latex before: is there a way to prevent emacs/org-mode---upon pressing M-q---to wrap a paragraph bla bla \begin{equation} 1+1=2 \end{equation} into bla bla \begin{equation} 1+1=2 \end{equation} Can I make org-mode more aware of latex constructs? A different font-face would also be really nice! I just like the M-q command. It's like the C-j of Pine. (I know, there's auto-fill-mode in emacs). cheers, josef [-- Attachment #1.2: Type: text/html, Size: 515 bytes --] [-- Attachment #2: Type: text/plain, Size: 204 bytes --] _______________________________________________ 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
On Jun 26, 2009, at 11:13 PM, hello world wrote: > Hi all, > > having only used latex before: is there a way to prevent > emacs/org-mode---upon pressing M-q---to wrap a paragraph > > bla bla > \begin{equation} > 1+1=2 > \end{equation} > > into > > bla bla \begin{equation} 1+1=2 \end{equation} Why would you press M-q in such a location? > > Can I make org-mode more aware of latex constructs? A different font- > face > would also be really nice! Turn on both org-export-with-LaTeX-fragments and org-highlight-latex-fragments-and-specials > I just like the M-q command. It's like the C-j of Pine. > (I know, there's auto-fill-mode in emacs). > > cheers, > josef > _______________________________________________ > 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
Carsten Dominik <carsten.dominik <at> gmail.com> writes: Hi Carsten, > > having only used latex before: is there a way to prevent > > emacs/org-mode---upon pressing M-q---to wrap a paragraph > > > > bla bla > > \begin{equation} > > 1+1=2 > > \end{equation} > > > > into > > > > bla bla \begin{equation} 1+1=2 \end{equation} > > Why would you press M-q in such a location? Because using org-mode as a note-taking program you may fiddle around on a paragraph and when done press M-q to reformat it nicely on the screen. (At least with auctex) it is nice that M-q is respecting also long \cite lists or % comments which can help to increase readability of the tex-document. > > Can I make org-mode more aware of latex constructs? A different font- > > face > > would also be really nice! > > Turn on both org-export-with-LaTeX-fragments and > org-highlight-latex-fragments-and-specials that's great! thank you. josef
Hi Carsten,
On 27.06.2009 09:00 Carsten Dominik wrote:
>
> On Jun 26, 2009, at 11:13 PM, hello world wrote:
>
>> bla bla
>> \begin{equation}
>> 1+1=2
>> \end{equation}
>>
>> into
>>
>> bla bla \begin{equation} 1+1=2 \end{equation}
>
> Why would you press M-q in such a location?
This behaviour is also bothering me. The example may not illustrate the problem
explicitly enough. Here is a more elaborate one:
I often find myself writing a paragraph that includes an equation like in this
example:
-----------------------------------------------------------------------
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
rebum.
\[
a^2 + b^ = c^2
\]
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
justo duo dolores et ea rebum.
-----------------------------------------------------------------------
When writing such a paragraph you need to use M-q. In AUCTeX this is no problem.
You easily get the above paragraph using M-q. In org-mode, however, you get this:
-----------------------------------------------------------------------
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
rebum. \[ a^2 + b^ = c^2 \] Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
-----------------------------------------------------------------------
This is quite confusing. A possible workaround to this problem is to insert
newlines around the equation like this:
-----------------------------------------------------------------------
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
rebum.
\[
a^2 + b^ = c^2
\]
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
justo duo dolores et ea rebum.
-----------------------------------------------------------------------+
However, the equation is then put into a new paragraph which is not intended
here: The resulting PDF contains additional spacing around the equations. The
intention that this should be a single paragraph is not achieved.
It would be very nice to have the same behaviour in this setting as AUCTeX.
Cheers,
Patrick
Hello Carsten,
On 01.07.2009 08:56 Carsten Dominik wrote:
> Another work-around would be
>
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
> nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
> sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
> rebum.
> #
> \[
> a^2 + b^ = c^2
> \]
> #
> Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
> dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
> magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
> justo duo dolores et ea rebum.
Nice idea. This kind of works. Unfortunately, if the paragraph is indented the
hashes still have to be at column zero:
-------------------------------------------------------------------------
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et
justo duo dolores et ea rebum.
#
\[
a^2 + b^ = c^2
\]
#
Stet clita kasd gubergren, no sea takimata sanctus est Lorem
ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
labore et dolore magna aliquyam erat, sed diam voluptua. At vero
eos et accusam et justo duo dolores et ea rebum.
-------------------------------------------------------------------------
This is still OK and for the upper part of the paragraph M-q works well.
However, hitting M-q in the lower part yields:
-------------------------------------------------------------------------
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et
justo duo dolores et ea rebum.
#
\[
a^2 + b^ = c^2
\]
# Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
dolor sit amet. Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
labore et dolore magna aliquyam erat, sed diam voluptua. At vero
eos et accusam et justo duo dolores et ea rebum.
-------------------------------------------------------------------------
This is a problem itself. Text sneaking into a comment line upon hitting M-q is
not an expected behaviour -- at least not for me.
So the only acceptable workaround I know is to insert blank lines before using
M-q and to remove them afterwards.
Cheers,
Patrick
As I said,
the only fix is then rewriting the paragraph and wrapping code.
I have put it on my list, but this is not going to happen soon.
- Carsten
On Jul 1, 2009, at 10:20 AM, Patrick Bahr wrote:
> Hello Carsten,
>
> On 01.07.2009 08:56 Carsten Dominik wrote:
>
>> Another work-around would be
>>
>> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
>> nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
>> erat,
>> sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
>> rebum.
>> #
>> \[
>> a^2 + b^ = c^2
>> \]
>> #
>> Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
>> dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
>> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
>> magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
>> justo duo dolores et ea rebum.
>
>
> Nice idea. This kind of works. Unfortunately, if the paragraph is
> indented the
> hashes still have to be at column zero:
>
> -------------------------------------------------------------------------
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
> diam nonumy eirmod tempor invidunt ut labore et dolore magna
> aliquyam erat, sed diam voluptua. At vero eos et accusam et
> justo duo dolores et ea rebum.
> #
> \[
> a^2 + b^ = c^2
> \]
> #
> Stet clita kasd gubergren, no sea takimata sanctus est Lorem
> ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
> sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
> labore et dolore magna aliquyam erat, sed diam voluptua. At vero
> eos et accusam et justo duo dolores et ea rebum.
> -------------------------------------------------------------------------
>
> This is still OK and for the upper part of the paragraph M-q works
> well.
> However, hitting M-q in the lower part yields:
>
> -------------------------------------------------------------------------
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
> diam nonumy eirmod tempor invidunt ut labore et dolore magna
> aliquyam erat, sed diam voluptua. At vero eos et accusam et
> justo duo dolores et ea rebum.
> #
> \[
> a^2 + b^ = c^2
> \]
> # Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
> dolor sit amet. Lorem ipsum dolor sit amet, consetetur
> sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
> labore et dolore magna aliquyam erat, sed diam voluptua. At vero
> eos et accusam et justo duo dolores et ea rebum.
> -------------------------------------------------------------------------
>
> This is a problem itself. Text sneaking into a comment line upon
> hitting M-q is
> not an expected behaviour -- at least not for me.
>
> So the only acceptable workaround I know is to insert blank lines
> before using
> M-q and to remove them afterwards.
>
> Cheers,
> Patrick
>
Hi Patrick,
unfortunately, I don't have a good solution for this, the filling
code in Emacs remains a mystery for me. I am closing this task for now.
- Carsten
On Jul 1, 2009, at 10:20 AM, Patrick Bahr wrote:
> Hello Carsten,
>
> On 01.07.2009 08:56 Carsten Dominik wrote:
>
>> Another work-around would be
>>
>> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
>> nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
>> erat,
>> sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
>> rebum.
>> #
>> \[
>> a^2 + b^ = c^2
>> \]
>> #
>> Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
>> dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing
>> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
>> magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
>> justo duo dolores et ea rebum.
>
>
> Nice idea. This kind of works. Unfortunately, if the paragraph is
> indented the
> hashes still have to be at column zero:
>
> -------------------------------------------------------------------------
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
> diam nonumy eirmod tempor invidunt ut labore et dolore magna
> aliquyam erat, sed diam voluptua. At vero eos et accusam et
> justo duo dolores et ea rebum.
> #
> \[
> a^2 + b^ = c^2
> \]
> #
> Stet clita kasd gubergren, no sea takimata sanctus est Lorem
> ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
> sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
> labore et dolore magna aliquyam erat, sed diam voluptua. At vero
> eos et accusam et justo duo dolores et ea rebum.
> -------------------------------------------------------------------------
>
> This is still OK and for the upper part of the paragraph M-q works
> well.
> However, hitting M-q in the lower part yields:
>
> -------------------------------------------------------------------------
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
> diam nonumy eirmod tempor invidunt ut labore et dolore magna
> aliquyam erat, sed diam voluptua. At vero eos et accusam et
> justo duo dolores et ea rebum.
> #
> \[
> a^2 + b^ = c^2
> \]
> # Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
> dolor sit amet. Lorem ipsum dolor sit amet, consetetur
> sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
> labore et dolore magna aliquyam erat, sed diam voluptua. At vero
> eos et accusam et justo duo dolores et ea rebum.
> -------------------------------------------------------------------------
>
> This is a problem itself. Text sneaking into a comment line upon
> hitting M-q is
> not an expected behaviour -- at least not for me.
>
> So the only acceptable workaround I know is to insert blank lines
> before using
> M-q and to remove them afterwards.
>
> Cheers,
> Patrick
>
Hi Patrick, I use filladapt. I just tried your example and it works. It also works if you indent the comment lines to the same depth as the text. See the thread, "Comments in org-mode" and this: http://article.gmane.org/gmane.emacs.orgmode/13312 Let us know if it doesn't work for you. -- Myalgic encephalomyelitis causes death (Jason et al. 2006) and severe suffering. Conflicts of interest are destroying research. What people "know" is wrong. Silence = death. http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm
I guess Samuel is right, filladapt really is the solution here..
- Carsten
On Aug 28, 2009, at 6:29 PM, Samuel Wales wrote:
> Hi Patrick,
>
> I use filladapt.
>
> I just tried your example and it works. It also works if you indent
> the comment lines to the same depth as the text.
>
> See the thread, "Comments in org-mode" and this:
>
> http://article.gmane.org/gmane.emacs.orgmode/13312
>
> Let us know if it doesn't work for you.
>
> --
> Myalgic encephalomyelitis causes death (Jason et al. 2006)
> and severe suffering. Conflicts of interest are destroying
> research. What people "know" is wrong. Silence = death.
> http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm