[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] vertical space
From: |
Nick Dokos |
Subject: |
Re: [O] vertical space |
Date: |
Fri, 31 Jan 2014 00:48:48 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Rustom Mody <address@hidden> 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 ∨ " <br />
| = P ∧ 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