emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Blank lines in LaTeX output due to org-mode comments
@ 2016-06-30 19:06 Mark Edgington
  2016-06-30 19:19 ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Edgington @ 2016-06-30 19:06 UTC (permalink / raw)
  To: emacs-orgmode

Assume we have the following sample org-mode document:

* Test Heading
test test test test test test test
test test test test test test test
test test test test test test test
# HERE IS A COMMENT
TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST

I would assume that in org-mode the comment line would be completely
ignored when exporting the document, however this seems not to be the
case -- notice the difference when exporting the following to LaTeX:

* Test Heading
test test test test test test test
test test test test test test test
test test test test test test test
TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST

In the first example, there is a blank line inserted at the location
of the comment, and in the second example, obviously there is not a
blank line at this location.  Let me know if there's a way to make it
so that org-mode doesn't insert the blank line.  Thanks!

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

* Re: Blank lines in LaTeX output due to org-mode comments
  2016-06-30 19:06 Blank lines in LaTeX output due to org-mode comments Mark Edgington
@ 2016-06-30 19:19 ` Nicolas Goaziou
  2016-06-30 19:30   ` Mark Edgington
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2016-06-30 19:19 UTC (permalink / raw)
  To: Mark Edgington; +Cc: emacs-orgmode

Hello,

Mark Edgington <edgimar@gmail.com> writes:

> Assume we have the following sample org-mode document:
>
> * Test Heading
> test test test test test test test
> test test test test test test test
> test test test test test test test
> # HERE IS A COMMENT
> TEST TEST TEST TEST TEST TEST TEST
> TEST TEST TEST TEST TEST TEST TEST
> TEST TEST TEST TEST TEST TEST TEST
>
> I would assume that in org-mode the comment line would be completely
> ignored when exporting the document, however this seems not to be the
> case -- notice the difference when exporting the following to LaTeX:
>
> * Test Heading
> test test test test test test test
> test test test test test test test
> test test test test test test test
> TEST TEST TEST TEST TEST TEST TEST
> TEST TEST TEST TEST TEST TEST TEST
> TEST TEST TEST TEST TEST TEST TEST
>
> In the first example, there is a blank line inserted at the location
> of the comment, and in the second example, obviously there is not a
> blank line at this location.  Let me know if there's a way to make it
> so that org-mode doesn't insert the blank line.  Thanks!

The behavior is correct. Actually, what you suggest was reported as
a bug a couple of years ago. Comments separate paragraphs, so you really
have two paragraphs in the first example, but only one in the second
example.

You can handle comments differently by adding a function in, e.g.
`org-export-before-processing-hook', that will take care of removing
commented lines. These are easy to recognize. See
`org-export--delete-comments' for an example.

Regards,

-- 
Nicolas Goaziou

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

* Re: Blank lines in LaTeX output due to org-mode comments
  2016-06-30 19:19 ` Nicolas Goaziou
@ 2016-06-30 19:30   ` Mark Edgington
  2016-06-30 19:54     ` Mark Edgington
  2016-06-30 21:23     ` Nicolas Goaziou
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Edgington @ 2016-06-30 19:30 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail <at> nicolasgoaziou.fr> writes:
> Mark Edgington <edgimar <at> gmail.com> writes:
> 
> > Assume we have the following sample org-mode document:
> >
> > * Test Heading
> > test test test test test test test
> > test test test test test test test
> > test test test test test test test
> > # HERE IS A COMMENT
> > TEST TEST TEST TEST TEST TEST TEST
> > TEST TEST TEST TEST TEST TEST TEST
> > TEST TEST TEST TEST TEST TEST TEST
> >
> > I would assume that in org-mode the comment line would be completely
> > ignored when exporting the document, however this seems not to be the
> > case -- notice the difference when exporting the following to LaTeX:
> 
> The behavior is correct. Actually, what you suggest was reported as
> a bug a couple of years ago. Comments separate paragraphs, so you really
> have two paragraphs in the first example, but only one in the second
> example.
> 
> You can handle comments differently by adding a function in, e.g.
> `org-export-before-processing-hook', that will take care of removing
> commented lines. These are easy to recognize. See
> `org-export--delete-comments' for an example.

I'm inclined to view it more as a bug, because it makes it impossible to
place comments within a paragraph.  Paragraphs consist of sentences, and
perhaps you'd like to make a note related to one of those sentences (in fact
I do).

On the other hand, if the behavior was to not create blank lines, it
wouldn't be difficult to add a blank line either before or after a comment
if desired.  Furthermore, the behavior is inconsistent with how LaTeX
comments behave (which may not matter, but it may be easier for people who
know both org-mode and LaTeX for the behavior to be consistent).

At the least, I think it would be helpful to have a built-in option that
allows one to select the preferred behavior.

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

* Re: Blank lines in LaTeX output due to org-mode comments
  2016-06-30 19:30   ` Mark Edgington
@ 2016-06-30 19:54     ` Mark Edgington
  2016-06-30 21:23     ` Nicolas Goaziou
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Edgington @ 2016-06-30 19:54 UTC (permalink / raw)
  To: emacs-orgmode

One other use case:  when you want to comment out a single line in a
paragraph, or have a few different lines within a paragraph that you wish to
be able to select among by leaving only only one of them uncommented.

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

* Re: Blank lines in LaTeX output due to org-mode comments
  2016-06-30 19:30   ` Mark Edgington
  2016-06-30 19:54     ` Mark Edgington
@ 2016-06-30 21:23     ` Nicolas Goaziou
  2016-06-30 21:34       ` Mark Edgington
  1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2016-06-30 21:23 UTC (permalink / raw)
  To: Mark Edgington; +Cc: emacs-orgmode

Mark Edgington <edgimar@gmail.com> writes:

> I'm inclined to view it more as a bug, because it makes it impossible to
> place comments within a paragraph.

This is per Org syntax. "# ..." is not meant as an inline paragraph. You
can comment inline with something like @@comment:...@@.

Regards,

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

* Re: Blank lines in LaTeX output due to org-mode comments
  2016-06-30 21:23     ` Nicolas Goaziou
@ 2016-06-30 21:34       ` Mark Edgington
  2016-06-30 21:57         ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Edgington @ 2016-06-30 21:34 UTC (permalink / raw)
  To: Mark Edgington, emacs-orgmode

On Thu, Jun 30, 2016 at 5:23 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Mark Edgington <edgimar@gmail.com> writes:
>
>> I'm inclined to view it more as a bug, because it makes it impossible to
>> place comments within a paragraph.
>
> This is per Org syntax. "# ..." is not meant as an inline paragraph. You
> can comment inline with something like @@comment:...@@.

For me, using the "@@comment:..@@" syntax gives exactly the same
results as using "# ..." (an extra blank line in the output).  Of
course I can do something like "#+LaTeX: % ..." which will work, but
then the convenience of being able to quickly comment and uncomment
lines is lost.

Regardless of what the current org syntax is defined as, I am trying
to argue that it is counter-intuitive, and also makes doing useful
things difficult.

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

* Re: Blank lines in LaTeX output due to org-mode comments
  2016-06-30 21:34       ` Mark Edgington
@ 2016-06-30 21:57         ` Nicolas Goaziou
  0 siblings, 0 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2016-06-30 21:57 UTC (permalink / raw)
  To: Mark Edgington; +Cc: emacs-orgmode

> For me, using the "@@comment:..@@" syntax gives exactly the same
> results as using "# ..." (an extra blank line in the output).

Only if you write them on a line on their own.

> Regardless of what the current org syntax is defined as, I am trying
> to argue that it is counter-intuitive, and also makes doing useful
> things difficult.

I already told you how to achieve what you want: simply remove every
line starting with "# " in a hook at the beginning of the export
process.

Regards,

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

end of thread, other threads:[~2016-06-30 21:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-30 19:06 Blank lines in LaTeX output due to org-mode comments Mark Edgington
2016-06-30 19:19 ` Nicolas Goaziou
2016-06-30 19:30   ` Mark Edgington
2016-06-30 19:54     ` Mark Edgington
2016-06-30 21:23     ` Nicolas Goaziou
2016-06-30 21:34       ` Mark Edgington
2016-06-30 21:57         ` 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).