emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: vertical space
Date: Fri, 31 Jan 2014 00:48:48 -0500	[thread overview]
Message-ID: <87d2j866rj.fsf@gmail.com> (raw)
In-Reply-To: CAJ+TeofKwoJ09_TvMPz+YDDyjH2+9Dze30Suaiw=FtcOLUajpg@mail.gmail.com

Rustom Mody <rustompmody@gmail.com> writes:

> Im having an issue with inconsistent vertical space
>
> If I do latex export \\es at eol produce blank lines
> However with html export they appear in output but not consistently
> org version 8.2.5e
> emacs version 24.3.1
>
> Below a cut-down version from a file I see it happening
> ------------
> #+TITLE: Equational Reasoning in Logic
> #+AUTHOR: Rusi
> #+OPTIONS: toc:nil
> * Object and Meta language
> Look at the following proof
>
> #+ATTR_LATEX: :mode math :environment flalign
> P \wedge (Q \vee P)\\
> " \wedge distributes over \vee " \\
> = (P \wedge Q) \vee (P \wedge Q) \\
> " Idempotence of \vee " \\
> = P \wedge Q \\
> \\
> \\
>

This case is easy: just delete the last two \\ and you are done.  I take
it that your real case is more complicated.

Running org-element-parse-buffer on your buffer might be illuminating:
the "internal" \\ get parsed as

 (line-break (:begin 267 :end 270 :post-blank 0 :parent #3))

but the last one (I used a buffer with just one trailing \\, not two)
gets parsed as

#("\\\\
" 0 3 (:parent #3))

i.e. a string, so it gets copied to the output. When the output is
latex:

,----
| " Idempotence of \(\vee\) " \\
| = P \(\wedge\) Q \\
| \\
| % Emacs 24.3.50.2 (Org mode 8.2.5g)
| \end{document}
`----

the \\ are processed by pdflatex and become empty lines. When the output
is html:

,----
| " Idempotence of &or; " <br  />
| = P &and; Q <br  />
| \\
| </p>
`----

they are processed by the browser which does nothing special with them,
so they are shown in the output.

Why exactly the last one is parsed as a literal string and not as a line
break, I don't know. Nicolas will probably explain all. The only thing I
can say is that if there is something other than whitespace on the line
before the \\, it gets parsed as a line break; if there is only
whitespace (or nothing), it gets parsed as a string. That's probably a
rough description and not quite right in all particulars, but I hope
it's close enough.

-- 
Nick

  reply	other threads:[~2014-01-31  5:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31  4:17 vertical space Rustom Mody
2014-01-31  5:48 ` Nick Dokos [this message]
2014-01-31  8:35   ` Nicolas Goaziou
2014-01-31  6:44 ` Rustom Mody
2014-01-31  8:16   ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2016-03-04 14:19 Vertical space Johann Spies
2016-03-04 14:25 ` Marcin Borkowski
2016-03-04 15:06   ` Johann Spies
2016-03-04 15:41     ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d2j866rj.fsf@gmail.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).