From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ethan Ligon Subject: Re: Problem with org-export--delete-comments Date: Fri, 18 Dec 2015 00:59:06 +0000 Message-ID: References: <87h9jgrec8.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11433940027da7052721a6fb Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9jOD-00014F-8T for emacs-orgmode@gnu.org; Thu, 17 Dec 2015 19:59:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9jO9-00020t-3P for emacs-orgmode@gnu.org; Thu, 17 Dec 2015 19:59:21 -0500 Received: from mail-vk0-f51.google.com ([209.85.213.51]:33113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9jO8-00020j-UU for emacs-orgmode@gnu.org; Thu, 17 Dec 2015 19:59:17 -0500 Received: by mail-vk0-f51.google.com with SMTP id a188so57603193vkc.0 for ; Thu, 17 Dec 2015 16:59:16 -0800 (PST) In-Reply-To: <87h9jgrec8.fsf@nicolasgoaziou.fr> 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 Cc: mail@nicolasgoaziou.fr --001a11433940027da7052721a6fb Content-Type: text/plain; charset=UTF-8 On Thu, Dec 17, 2015 at 12:47 PM Nicolas Goaziou wrote: > Hello, > > Ethan Ligon writes: > > > I've long used the following construction for displayed equations in org > > # > > \[ > > u_i(c)=p_i\lambda > > \] > > # > > which (i) gives nice space for reading equations in the org-source, and > > (ii) nicely protects the display equation from (fill-paragraph) and > > friends. > > > > However, exporting with this construction *stopped* working after commit > > 53a4209; what happens now is that ox.el replaces the # with a blank line, > > breaking my single paragraph into three. > > I see only one paragraph above. Could you elaborate a bit? > Sure. If I export the above using ox-ascii, I obtain, in part: #+begin_example I've long used the following construction for displayed equations in org \[ u_i(c)=p_i\lambda \] which (i) gives nice space for reading equations in the org-source, and (ii) nicely protects the display equation from (fill-paragraph) and friends. #+end_example While if I export via ox-latex I obtain in the *.tex source: #+begin_example I've long used the following construction for displayed equations in org \[ u_i(c)=p_i\lambda \] which (i) gives nice space for reading equations in the org-source, and (ii) nicely protects the display equation from (fill-paragraph) and friends. #+end_example It's really this last case that's a serious problem, since when compiled with LaTeX we get three paragraphs (too much vertical space between the first line and the displayed equation, and excruciatingly an improper indentation of the bit following the displayed equation (i.e., "which (i)..." is indented). > > > A related problem: one can no longer have commented lines in (at least > > some) property drawers. > > This is not possible indeed, per property drawers syntax. Also, I'd > rather not introduce comments in property drawers (I don't think this > was ever officially supported anyway). > > > It seems to me that the correct solution would have org-export--delete- > > comments actually delete a single line comment, not replace it with \n, > as > > was the case prior to the indicated commit. > > > > I gather that the change was introduced to deal with a bug observed by > > Samuel Wales (http://article.gmane.org/gmane.emacs.orgmode/102860; see > also > > below). His problem example involved incorrectly truncated footnotes > > (these are deemed to end after two blank lines). But it seems to me that > > the correct solution to his example is to delete *both* the commented > > line and the following blank line. > > Been there, done that. Your solution is not correct in all cases. E.g., > with the following document > > Paragra1 > # comment > > Paragraph2 > > removing both the comment and the blank line above gives you a single > paragraph, which doesn't match expectations. > > Point taken, and I appreciate that you must have thought about this quite a lot. But I still wish for the old behavior, which would have simply deleted the # comment line. This would break SW's footnote example, but perhaps that (contrived? maybe I don't understand his use case) problem could be addressed by changing the documentation. Right now the docs say that a footnote "ends at the next footnote definition, headline, or after two consecutive empty lines." Why not just change to "ends at the next footnote definition, headline, or two empty lines (consecutive, or with a comment)." Thanks for your work on this! -Ethan --001a11433940027da7052721a6fb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, Dec 17= , 2015 at 12:47 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Hello,

Ethan Ligon <lig= on@berkeley.edu> writes:

> I've long used the following construction for displayed equations = in org
> #
> \[
>=C2=A0 =C2=A0 =C2=A0u_i(c)=3Dp_i\lambda
> \]
> #
> which (i) gives nice space for reading equations in the org-source, an= d
> (ii) nicely protects the display equation from (fill-paragraph) and > friends.
>
> However, exporting with this construction *stopped* working after comm= it
> 53a4209; what happens now is that ox.el replaces the # with a blank li= ne,
> breaking my single paragraph into=C2=A0 three.

I see only one paragraph above. Could you elaborate a bit?
=

Sure.=C2=A0 If I export the above using ox-ascii, I obt= ain, in part:

#+begin_example
I'= ;ve long used the following construction for displayed equations in org

\[ u_i(c)=3Dp_i\lambda \]

wh= ich (i) gives nice space for reading equations in the org-source, and
=
(ii) nicely protects the display equation from (fill-paragraph) and
friends.
#+end_example

Whi= le if =C2=A0I export via ox-latex I obtain in the *.tex source:
<= br>
#+begin_example
I've long used the followi= ng construction for displayed equations in org

\[<= /div>
=C2=A0 =C2=A0 u_i(c)=3Dp_i\lambda
\]

which (i) gives nice space for reading equations in the org-source, = and
(ii) nicely protects the display equation from (fill-paragrap= h) and
friends.
#+end_example

It's really this last case that's a serious problem, since wh= en compiled with =C2=A0LaTeX we get three paragraphs (too much vertical spa= ce between =C2=A0the =C2=A0first line and the displayed equation, and excru= ciatingly an improper indentation of the bit following the =C2=A0displayed = equation (i.e., "which (i)..." is indented).

=


=C2=A0

> A related problem: one can no longer have commented lines in (at least=
> some) property drawers.

This is not possible indeed, per property drawers syntax. Also, I'd
rather not introduce comments in property drawers (I don't think this was ever officially supported anyway).

> It seems to me that the correct solution would have org-export--delete= -
> comments actually delete a single line comment, not replace it with=C2= =A0 \n, as
> was the case prior to=C2=A0 the=C2=A0 indicated commit.
>
> I gather that the change was introduced to deal with a bug observed by=
> Samuel Wales (http://article.gmane.org/gmane= .emacs.orgmode/102860; see also
> below).=C2=A0 His problem example involved incorrectly truncated footn= otes
> (these are deemed to end after two blank lines).=C2=A0 But it seems to= me that
> the correct solution to his example is to=C2=A0 delete *both* the=C2= =A0 commented
> line and the=C2=A0 following blank line.

Been there, done that. Your solution is not correct in all cases. E.g.,
with the following document

=C2=A0 Paragra1
=C2=A0 # comment

=C2=A0 Paragraph2

removing both the comment and the blank line above gives you a single
paragraph, which doesn't match expectations.

Point taken, =C2=A0and I appreciate that you must hav= e thought about this quite a lot. =C2=A0 But I still wish for the old behav= ior, which =C2=A0would have simply deleted the # comment line.
This would break SW's footnote example, but perhaps that (= contrived? maybe I don't understand his =C2=A0use case) problem could b= e addressed by changing the documentation.=C2=A0 Right now the docs say tha= t a footnote=C2=A0

"ends at the next footnote d= efinition, headline, or after two consecutive empty lines."

=C2=A0Why not just change to=C2=A0
"ends at the next footnote definition, headline, or two em= pty lines (consecutive, or with a comment)."

= Thanks for your work on this!
-Ethan
=C2=A0
=
--001a11433940027da7052721a6fb--