emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] org-e-latex: Tables get correct amount of vertical space


From: Sebastien Vauban
Subject: Re: [O] [PATCH] org-e-latex: Tables get correct amount of vertical space
Date: Tue, 13 Nov 2012 17:15:17 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (windows-nt)

Hi Myles and Nick,

Nick Dokos wrote:
> Myles English <address@hidden> wrote:
>> Sebastien Vauban writes:
>> > Myles English wrote:
>> >> This patch replaces every occurence of the \begin{center} environment
>> >> with \centering in the file contrib/lisp/org-e-latex.el.
>> >> ...
>> >> -   (format "\\begin{center}\n%s\\end{center}" contents)))
>> >> +   (format "\\centering\n%s" contents)))
>> >
>> > Wouldn't you have to replace
>> >
>> >   \begin{center}
>> >     ...
>> >   \end{center}
>> >
>> > by
>> >
>> >   {\centering
>> >     ...
>> >   }
>> >
>> > ?  That is, add a group around?
>> 
>> I don't think so, at least I have not come across that usage, and it
>> seems to work without.  Do you know different?
>
> If a \centering occurs at top-level in a latex document,
> then *everything* after it will be centered: it's a declaration that
> remains in force for the current group (which is the rest of the
> document if it occurs at top-level).

As confirmed by Nick, \centering just changes the layout for ever... up to the
end of the document.

Why does it work?  I guess because there are grouping commands inserted by Org
at other places, that stop the propagation of the centering that far... But
it's dangerous to count on them, IMHO.

> \begin{center}...\end{center} is essentially {\centering ...} except
> that it also starts a new paragraph.
>
> It's not clear to me at least, that wholesale replacement is the correct
> thing to do: it needs to be looked at on a case-by-case basis I think.

I think that's a safe replacement (_with_ the grouping), and with something I
forgot about (well seen Nick!): the \par.

See, for example,
https://groups.google.com/forum/?fromgroups=#!topic/fr.comp.text.tex/0s4WfsIfmy8
for the answer of Manuel Pégourié-Gonnard, one reference wrt LaTeX questions:

  "replace the environment by {\centering ... \par}"

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]