* fill paragraph: math and latex environments
@ 2012-09-17 16:14 Albert Z. Wang
2012-09-17 19:16 ` Nicolas Goaziou
0 siblings, 1 reply; 8+ messages in thread
From: Albert Z. Wang @ 2012-09-17 16:14 UTC (permalink / raw)
To: emacs-orgmode
Hello,
First off, thanks for this great piece of software! It's made
document/markup management so much easier since I've discovered it.
I've just recently been having an issue I was wondering if anybody could
help with, namely, that fill-paragraph does not seem to work as
expected.
For display math equations delimited as
\[
a^2 + b^2 = c^2
\]
the equation gets folded inline -- seems to work fine with explicit
environments though ( \begin{equation*}...\end{equation*} ). Has
anybody else experienced this? Tweaking paragraph-start and
paragraph-separate do not seem to be doing the trick...
I just recently did a big update of the emacs system after a few months,
so it's possible there've been some relevant changes I'm unaware of, but
I wasn't able to find a solution by searching.
Thanks for any help!
--Albert
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fill paragraph: math and latex environments
2012-09-17 16:14 fill paragraph: math and latex environments Albert Z. Wang
@ 2012-09-17 19:16 ` Nicolas Goaziou
2012-09-18 0:37 ` Albert Z. Wang
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2012-09-17 19:16 UTC (permalink / raw)
To: Albert Z. Wang; +Cc: emacs-orgmode
Hello,
azw@fastmail.fm (Albert Z. Wang) writes:
> I've just recently been having an issue I was wondering if anybody
> could help with, namely, that fill-paragraph does not seem to work as
> expected.
>
> For display math equations delimited as
> \[
> a^2 + b^2 = c^2
> \]
> the equation gets folded inline -- seems to work fine with explicit
> environments though ( \begin{equation*}...\end{equation*} ). Has
> anybody else experienced this? Tweaking paragraph-start and
> paragraph-separate do not seem to be doing the trick...
Yes, \[...\] constructs are considered as inline objects (they belong to
a paragraph, so they will be filled along with the paragraph). On the
other hand, \begin{equation*} environments are full-fledged elements:
they do not belong to a paragraph and are not filled.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fill paragraph: math and latex environments
2012-09-17 19:16 ` Nicolas Goaziou
@ 2012-09-18 0:37 ` Albert Z. Wang
2012-09-19 13:03 ` Nicolas Goaziou
0 siblings, 1 reply; 8+ messages in thread
From: Albert Z. Wang @ 2012-09-18 0:37 UTC (permalink / raw)
To: emacs-orgmode
Nicolas Goaziou <n.goaziou@gmail.com> writes:
> Hello,
>
> azw@fastmail.fm (Albert Z. Wang) writes:
>
>> I've just recently been having an issue I was wondering if anybody
>> could help with, namely, that fill-paragraph does not seem to work as
>> expected.
>>
>> For display math equations delimited as
>> \[
>> a^2 + b^2 = c^2
>> \]
>> the equation gets folded inline -- seems to work fine with explicit
>> environments though ( \begin{equation*}...\end{equation*} ). Has
>> anybody else experienced this? Tweaking paragraph-start and
>> paragraph-separate do not seem to be doing the trick...
>
> Yes, \[...\] constructs are considered as inline objects (they belong to
> a paragraph, so they will be filled along with the paragraph). On the
> other hand, \begin{equation*} environments are full-fledged elements:
> they do not belong to a paragraph and are not filled.
Thanks for the clarification! Is there an easy way to have them be
treated as full-fledged environments? I usually prefer to use the above
for unnumbered display equations since it reduces visual clutter and
looks closer to the intent.
I've noticed that adding "\\\\\\[" and "\\\\\\]" to
org-element-paragraph-separate will prevent complete inlining, but that
the newline after the mark will be removed, which makes the formatting a
little less clear. Is it possible to treat \[ ... \] as full-fledged
unnumbered equation environments? My own understanding of how the
parser works is insufficient to the task of changing its behavior
here...
It's not a very big deal, but if there's an easy way to accomplish this
I'd appreciate any help.
Thanks,
--Albert
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fill paragraph: math and latex environments
2012-09-18 0:37 ` Albert Z. Wang
@ 2012-09-19 13:03 ` Nicolas Goaziou
2013-07-01 21:45 ` Paul Stansell
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2012-09-19 13:03 UTC (permalink / raw)
To: Albert Z. Wang; +Cc: emacs-orgmode
Hello,
azw@fastmail.fm (Albert Z. Wang) writes:
> Thanks for the clarification! Is there an easy way to have them be
> treated as full-fledged environments? I usually prefer to use the above
> for unnumbered display equations since it reduces visual clutter and
> looks closer to the intent.
No, there's no easy way.
Making \[...\] an element would mean that \[...\] cannot exist anymore
within a paragraph. I'm not sure it's worth it.
Also, I think it's good, in this case, to have both an inlined and
a non-inlined version for the same thing.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fill paragraph: math and latex environments
2012-09-19 13:03 ` Nicolas Goaziou
@ 2013-07-01 21:45 ` Paul Stansell
2013-07-02 17:16 ` Nicolas Goaziou
0 siblings, 1 reply; 8+ messages in thread
From: Paul Stansell @ 2013-07-01 21:45 UTC (permalink / raw)
To: emacs-orgmode
Nicolas Goaziou <n.goaziou <at> gmail.com> writes:
>
> Hello,
>
> azw <at> fastmail.fm (Albert Z. Wang) writes:
>
> > Thanks for the clarification! Is there an easy way to have them be
> > treated as full-fledged environments? I usually prefer to use the above
> > for unnumbered display equations since it reduces visual clutter and
> > looks closer to the intent.
>
> No, there's no easy way.
>
> Making \[...\] an element would mean that \[...\] cannot exist anymore
> within a paragraph. I'm not sure it's worth it.
>
> Also, I think it's good, in this case, to have both an inlined and
> a non-inlined version for the same thing.
>
> Regards,
>
Hi Nicolas,
I hope you don't mind me giving my view on this so long after the initial
posts, but I been trying, without success, to get fill-paragraph to
recognise \[...\] as boundaries to it's function.
You say in your post
> Making \[...\] an element would mean that \[...\] cannot exist anymore
> within a paragraph. I'm not sure it's worth it.
>
> Also, I think it's good, in this case, to have both an inlined and
> a non-inlined version for the same thing.
In Lamport's book on Latex he explains that \[...\] is for display style
maths, that is, for maths that is not inside a paragraph but presented on
it's own line. Inside a paragraph one should use $...$ or \(...\) as they
are for inline equations (and Latex treats them the same). For display
style maths Latex uses
\begin{displaymath}
...
\end{displaymath}
and, for less typing,
\[
...
\]
and both are treated the same, ie., both produce the exact same output in
the processed latex document.
This being the case, my wish would be to see org mode treat
\[
...
\]
the same as
\begin{displaymath}
...
\end{displaymath}
and not fill past it's boundaries.
Kind regards,
Paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fill paragraph: math and latex environments
2013-07-01 21:45 ` Paul Stansell
@ 2013-07-02 17:16 ` Nicolas Goaziou
2013-07-03 14:38 ` Paul Stansell
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-07-02 17:16 UTC (permalink / raw)
To: Paul Stansell; +Cc: emacs-orgmode
Hello,
Paul Stansell <paulstansell@gmail.com> writes:
> Nicolas Goaziou <n.goaziou <at> gmail.com> writes:
>> Making \[...\] an element would mean that \[...\] cannot exist anymore
>> within a paragraph. I'm not sure it's worth it.
>>
>> Also, I think it's good, in this case, to have both an inlined and
>> a non-inlined version for the same thing.
>
> In Lamport's book on Latex he explains that \[...\] is for display style
> maths, that is, for maths that is not inside a paragraph but presented on
> it's own line. Inside a paragraph one should use $...$ or \(...\) as they
> are for inline equations (and Latex treats them the same). For display
> style maths Latex uses
>
> \begin{displaymath}
> ...
> \end{displaymath}
>
> and, for less typing,
>
> \[
> ...
> \]
>
> and both are treated the same, ie., both produce the exact same output in
> the processed latex document.
>
> This being the case, my wish would be to see org mode treat
>
> \[
> ...
> \]
>
> the same as
>
> \begin{displaymath}
> ...
> \end{displaymath}
>
> and not fill past it's boundaries.
If we allow \[...\] constructs to be an element, they cannot be
recognized as such within paragraphs. So
Some text \[1+1\] and some other text
will not be recognized anymore, even though any latex editing mode
supports it. Again, I think it's not worth loosing it.
Also, using \begin{...}...\end{...} environments is not really an issue
with editing facilities in Emacs (e.g., yasnippets).
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fill paragraph: math and latex environments
2013-07-02 17:16 ` Nicolas Goaziou
@ 2013-07-03 14:38 ` Paul Stansell
2013-07-03 19:50 ` Nicolas Goaziou
0 siblings, 1 reply; 8+ messages in thread
From: Paul Stansell @ 2013-07-03 14:38 UTC (permalink / raw)
To: Nicolas Goaziou; +Cc: emacs-orgmode
Nicolas,
Thanks for your reply.
> If we allow \[...\] constructs to be an element, they cannot be
> recognized as such within paragraphs. So
>
> Some text \[1+1\] and some other text
>
> will not be recognized anymore, even though any latex editing mode
> supports it. Again, I think it's not worth loosing it.
>
> Also, using \begin{...}...\end{...} environments is not really an issue
> with editing facilities in Emacs (e.g., yasnippets).
I'm sorry, but I don't fully understand your explanation as I don't
know what you mean by an "element" in this context?
Also, am I missing something about the latex? Do you want to be able
to use display style maths inside a sentence (ie. avoid placing the
maths on a new line but have it formatted in display style)? That
would seem strange as that's not what it's for. I don't, therefore,
see why anyone would want to write
Some text \[1+1\] and some other text
as in the resulting processed document it will look like
Some text
1+1
and some other text
I think one should instead write
Some text \(1+1\) and some other text
or
Some text $1+1$ and some other text
which, in the processed document, will look like
Some text 1+1 and some other text
If someone wants a display maths equation they could write it in their
org file as
Some text
\[
1+1
\]
and some other text
so that the look of the org file resembles more closely that of the
processed document.
> Also, using \begin{...}...\end{...} environments is not really an issue
> with editing facilities in Emacs (e.g., yasnippets).
I agree with you there. It's not a big deal type, but I do think
\[
1+1
\[
looks a lot nicer and cleaner in the org file than
\begin{displaymath}
1+1
\end{displaymath}
Kind regards,
Paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fill paragraph: math and latex environments
2013-07-03 14:38 ` Paul Stansell
@ 2013-07-03 19:50 ` Nicolas Goaziou
0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2013-07-03 19:50 UTC (permalink / raw)
To: Paul Stansell; +Cc: emacs-orgmode
Hello,
Paul Stansell <paulstansell@gmail.com> writes:
> I'm sorry, but I don't fully understand your explanation as I don't
> know what you mean by an "element" in this context?
See: http://orgmode.org/worg/dev/org-syntax.html
> Also, am I missing something about the latex? Do you want to be able
> to use display style maths inside a sentence (ie. avoid placing the
> maths on a new line but have it formatted in display style)? That
> would seem strange as that's not what it's for. I don't, therefore,
> see why anyone would want to write
>
> Some text \[1+1\] and some other text
I do sometimes. I like compact text in my Org file, even though I know
the output will be different (and intend it to) when exported.
Let me try again with another example:
Some text...
\[1+1\]
Some other text...
will not be possible anymore either. I like to use \[...\] for one
liners and \begin{equation*} ... \end{equation*} for more complicated
formulas.
> I agree with you there. It's not a big deal type, but I do think
>
> \[
> 1+1
> \[
>
> looks a lot nicer and cleaner in the org file than
>
> \begin{displaymath}
> 1+1
> \end{displaymath}
Of course but
\[1+1\]
is a lot nicer than
\[
1+1
\]
and
\begin{equation*}
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1 & \text{if } x < 0
\end{cases}
\end{equation*}
is (arguably) nicer than
\[
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1 & \text{if } x < 0
\end{cases}
\]
Anyway, it's a matter of taste. And currently, we can have both. We
won't anymore if we want to treat \[...\] as an element.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-07-03 19:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 16:14 fill paragraph: math and latex environments Albert Z. Wang
2012-09-17 19:16 ` Nicolas Goaziou
2012-09-18 0:37 ` Albert Z. Wang
2012-09-19 13:03 ` Nicolas Goaziou
2013-07-01 21:45 ` Paul Stansell
2013-07-02 17:16 ` Nicolas Goaziou
2013-07-03 14:38 ` Paul Stansell
2013-07-03 19:50 ` Nicolas Goaziou
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).