emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [PATCH] org-e-latex: Tables get correct amount of vertical space
Date: Tue, 13 Nov 2012 17:15:17 +0100	[thread overview]
Message-ID: <801ufxscmi.fsf@somewhere.org> (raw)
In-Reply-To: 11825.1352822198@alphaville

Hi Myles and Nick,

Nick Dokos wrote:
> Myles English <mylesenglish-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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	other threads:[~2012-11-13 16:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13 14:29 [PATCH] org-e-latex: Tables get correct amount of vertical space Myles English
2012-11-13 14:54 ` Sebastien Vauban
2012-11-13 15:05   ` Myles English
2012-11-13 15:56     ` Nick Dokos
2012-11-13 16:15       ` Sebastien Vauban [this message]
2012-11-13 16:20         ` Nick Dokos
2012-11-13 16:32           ` Nick Dokos
2012-11-14  8:44             ` Sebastien Vauban
2012-11-14  9:40               ` Myles English
2012-11-13 21:31         ` Myles English
2012-11-14 14:03           ` Nicolas Goaziou

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=801ufxscmi.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).