emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* latex wrap
@ 2009-06-26 21:13 hello world
  2009-06-27  7:00 ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: hello world @ 2009-06-26 21:13 UTC (permalink / raw)
  To: emacs-orgmode


[-- 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: latex wrap
  2009-06-26 21:13 latex wrap hello world
@ 2009-06-27  7:00 ` Carsten Dominik
  2009-06-27  7:25   ` Josef
  2009-07-01  0:16   ` Patrick Bahr
  0 siblings, 2 replies; 9+ messages in thread
From: Carsten Dominik @ 2009-06-27  7:00 UTC (permalink / raw)
  To: hello world; +Cc: 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: latex wrap
  2009-06-27  7:00 ` Carsten Dominik
@ 2009-06-27  7:25   ` Josef
  2009-07-01  0:16   ` Patrick Bahr
  1 sibling, 0 replies; 9+ messages in thread
From: Josef @ 2009-06-27  7:25 UTC (permalink / raw)
  To: 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 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: latex wrap
  2009-06-27  7:00 ` Carsten Dominik
  2009-06-27  7:25   ` Josef
@ 2009-07-01  0:16   ` Patrick Bahr
       [not found]     ` <FA69965F-76E7-45D5-A3D3-5479C08A49C1@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread
From: Patrick Bahr @ 2009-07-01  0:16 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: hello world, emacs-orgmode

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: latex wrap
       [not found]     ` <FA69965F-76E7-45D5-A3D3-5479C08A49C1@gmail.com>
@ 2009-07-01  8:20       ` Patrick Bahr
  2009-07-01  9:46         ` Carsten Dominik
                           ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Patrick Bahr @ 2009-07-01  8:20 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: hello world, emacs-orgmode

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: latex wrap
  2009-07-01  8:20       ` Patrick Bahr
@ 2009-07-01  9:46         ` Carsten Dominik
  2009-08-28 13:21         ` Carsten Dominik
  2009-08-28 16:29         ` Samuel Wales
  2 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2009-07-01  9:46 UTC (permalink / raw)
  To: Patrick Bahr; +Cc: hello world, emacs-orgmode

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
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: latex wrap
  2009-07-01  8:20       ` Patrick Bahr
  2009-07-01  9:46         ` Carsten Dominik
@ 2009-08-28 13:21         ` Carsten Dominik
  2009-08-28 16:29         ` Samuel Wales
  2 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2009-08-28 13:21 UTC (permalink / raw)
  To: Patrick Bahr; +Cc: hello world, emacs-orgmode

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
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: latex wrap
  2009-07-01  8:20       ` Patrick Bahr
  2009-07-01  9:46         ` Carsten Dominik
  2009-08-28 13:21         ` Carsten Dominik
@ 2009-08-28 16:29         ` Samuel Wales
  2009-08-31  5:35           ` Carsten Dominik
  2 siblings, 1 reply; 9+ messages in thread
From: Samuel Wales @ 2009-08-28 16:29 UTC (permalink / raw)
  To: Patrick Bahr; +Cc: hello world, emacs-orgmode, Carsten Dominik

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: latex wrap
  2009-08-28 16:29         ` Samuel Wales
@ 2009-08-31  5:35           ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2009-08-31  5:35 UTC (permalink / raw)
  To: Samuel Wales; +Cc: hello world, emacs-orgmode

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-08-31  6:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-26 21:13 latex wrap hello world
2009-06-27  7:00 ` Carsten Dominik
2009-06-27  7:25   ` Josef
2009-07-01  0:16   ` Patrick Bahr
     [not found]     ` <FA69965F-76E7-45D5-A3D3-5479C08A49C1@gmail.com>
2009-07-01  8:20       ` Patrick Bahr
2009-07-01  9:46         ` Carsten Dominik
2009-08-28 13:21         ` Carsten Dominik
2009-08-28 16:29         ` Samuel Wales
2009-08-31  5:35           ` Carsten Dominik

Code repositories for project(s) associated with this 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).