From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Passing font size to exported LaTeX table Date: Tue, 24 May 2011 14:31:43 -0500 Message-ID: References: <80oc2s3v6k.fsf@somewhere.org> <5180.1306265114@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0003255593be4f7f8204a40aa32c Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOxKT-0003Tu-PX for emacs-orgmode@gnu.org; Tue, 24 May 2011 15:31:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOxKS-0003wC-OJ for emacs-orgmode@gnu.org; Tue, 24 May 2011 15:31:45 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:36690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOxKS-0003w6-Do for emacs-orgmode@gnu.org; Tue, 24 May 2011 15:31:44 -0400 Received: by bwz17 with SMTP id 17so7469243bwz.0 for ; Tue, 24 May 2011 12:31:43 -0700 (PDT) In-Reply-To: <5180.1306265114@alphaville.americas.hpqcorp.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Sebastien Vauban , emacs-orgmode@gnu.org --0003255593be4f7f8204a40aa32c Content-Type: text/plain; charset=UTF-8 On Tue, May 24, 2011 at 2:25 PM, Nick Dokos wrote: > John Hendy wrote: > > > On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban < > wxhgmqzgwmuf@spammotel.com> wrote: > > > > Hi John, > > > > John Hendy wrote: > > > I can control a table font size directly from the .tex file like > so: > > > > > > --- > > > \scriptsize{ > > > \begin{center} > > > \begin{tabular}{lllrr} > > > > > > table entries here > > > > > > \end{tabular} > > > \end{center} > > > } > > > --- > > > > > > Any way to pass this from org-mode? Otherwise, I keep changing the > org file, > > > exporting, and then having to add this to the tex file and > re-export. > > > > > > I tried: > > > --- > > > #+begin_latex > > > \scriptsize{ > > > #+end_latex > > > > > > |org|table|here| > > > > > > #+begin_latex > > > } > > > #+end_latex > > > --- > > > > > > without success. > > > > You put the things in the wrong order: > > > > 1. put a group around some LaTeX commands > > 2. add the macro \scriptsize in it > > > > Hence: > > > > #+begin_src org > > #+begin_latex > > {\scriptsize > > #+end_latex > > > > |org|table|here| > > > > #+begin_latex > > } > > #+end_latex > > #+end_src > > > > should do it (not tested). > > > > I'm getting this error upon export (no PDF created): > > --- > > ! Argument of \frame has an extra }. > > > > \par > > l.142 } > > > > Runaway argument? > > \par \par \par > > ! Paragraph ended before \frame was complete. > > > > \par > > l.142 } > > > > ! Extra }, or forgotten \endgroup. > > } > > > > l.142 } > > > > ! Extra }, or forgotten \endgroup. > > \endframe ->\egroup > > \begingroup \def \@currenvir {frame} > > l.145 \end{frame} > > > > ) > > Runaway argument? > > --- > > > > I'm assuming something is not liking that dangling "}"... > > > > Thoughts? > > > > I didn't try Seb's workaround but your original solution almost works: > what stops it is YAB in the latex exporter, but having been bitten by > such a couple of times in the past, I applied my usual[fn:1] workaround > and presto! it works: > > ,---- > | > | * foo > | > | #+begin_latex > | \scriptsize{ %} > | #+end_latex > | > | #+tblname: foo > | | table | here | > | |-------+------| > | | table | here | > | > | #+begin_latex > | } > | #+end_latex > `---- > > Awesome!! And now I recall seeing it before on the list. Very cool. > The opening brace on the \scriptsize line confuses the exporter and it > leaves the table alone. Adding a commented-out closing brace unconfuses > it. > > Nick > > Footnotes: > > [fn:1] Maybe I should add it to the FAQ? > Perhaps -- the tough things is that an issue with braces is not what I would have expected the problem was. I thought I just wasn't combining things right or that the org exporter was making something like this impossible based on how it parsed the text. In any case, yes, it would be cool to have in public written somewhere. Thanks! --0003255593be4f7f8204a40aa32c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, May 24, 2011 at 2:25 PM, Nick Dokos <nicholas.dokos@h= p.com> wrote:
John Hendy <jw.hendy@gmail.com> wrote:

> On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote: >
> =C2=A0 =C2=A0 Hi John,
>
> =C2=A0 =C2=A0 John Hendy wrote:
> =C2=A0 =C2=A0 > I can control a table font size directly from the .= tex file like so:
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > ---
> =C2=A0 =C2=A0 > \scriptsize{
> =C2=A0 =C2=A0 > \begin{center}
> =C2=A0 =C2=A0 > \begin{tabular}{lllrr}
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > table entries here
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > \end{tabular}
> =C2=A0 =C2=A0 > \end{center}
> =C2=A0 =C2=A0 > }
> =C2=A0 =C2=A0 > ---
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > Any way to pass this from org-mode? Otherwise, I ke= ep changing the org file,
> =C2=A0 =C2=A0 > exporting, and then having to add this to the tex f= ile and re-export.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > I tried:
> =C2=A0 =C2=A0 > ---
> =C2=A0 =C2=A0 > #+begin_latex
> =C2=A0 =C2=A0 > \scriptsize{
> =C2=A0 =C2=A0 > #+end_latex
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > |org|table|here|
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > #+begin_latex
> =C2=A0 =C2=A0 > }
> =C2=A0 =C2=A0 > #+end_latex
> =C2=A0 =C2=A0 > ---
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > without success.
>
> =C2=A0 =C2=A0 You put the things in the wrong order:
>
> =C2=A0 =C2=A0 1. put a group around some LaTeX commands
> =C2=A0 =C2=A0 2. add the macro \scriptsize in it
>
> =C2=A0 =C2=A0 Hence:
>
> =C2=A0 =C2=A0 #+begin_src org
> =C2=A0 =C2=A0 =C2=A0#+begin_latex
> =C2=A0 =C2=A0 =C2=A0{\scriptsize
> =C2=A0 =C2=A0 =C2=A0#+end_latex
>
> =C2=A0 =C2=A0 =C2=A0|org|table|here|
>
> =C2=A0 =C2=A0 =C2=A0#+begin_latex
> =C2=A0 =C2=A0 =C2=A0}
> =C2=A0 =C2=A0 =C2=A0#+end_latex
> =C2=A0 =C2=A0 #+end_src
>
> =C2=A0 =C2=A0 should do it (not tested).
>
> I'm getting this error upon export (no PDF created):
> ---
> ! Argument of \frame has an extra }.
> <inserted text>=C2=A0
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \par=C2=A0
> l.142 }
> =C2=A0 =C2=A0 =C2=A0 =C2=A0
> Runaway argument?
> =C2=A0\par \par \par=C2=A0
> ! Paragraph ended before \frame was complete.
> <to be read again>=C2=A0
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\= par=C2=A0
> l.142 }
> =C2=A0 =C2=A0 =C2=A0 =C2=A0
> ! Extra }, or forgotten \endgroup.
> <recently read> }
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
> l.142 }
> =C2=A0 =C2=A0 =C2=A0 =C2=A0
> ! Extra }, or forgotten \endgroup.
> \endframe ->\egroup=C2=A0
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = \begingroup \def \@currenvir {frame}
> l.145 \end{frame}
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
> )
> Runaway argument?
> ---
>
> I'm assuming something is not liking that dangling "}"..= .
>
> Thoughts?
>

I didn't try Seb's workaround but your original solutio= n almost works:
what stops it is YAB in the latex exporter, but having been bitten by
such a couple of times in the past, I applied my usual[fn:1] workaround
and presto! it works:

,----
|
| * foo
|
| #+begin_latex
| \scriptsize{ %}
| #+end_latex
|
| #+tblname: foo
| | table | here |
| |-------+------|
| | table | here |
|
| #+begin_latex
| }
| #+end_latex
`----


Awesome!! And now I recall seeing it b= efore on the list. Very cool.
=C2=A0
The opening brace on the \scriptsize line confuses the exporter and it
leaves the table alone. Adding a commented-out closing brace unconfuses
it.

Nick

Footnotes:

[fn:1] Maybe I should add it to the FAQ?

Perhaps -- the tough things is that an issue with braces is not what I wo= uld have expected the problem was. I thought I just wasn't combining th= ings right or that the org exporter was making something like this impossib= le based on how it parsed the text. In any case, yes, it would be cool to h= ave in public written somewhere. Thanks!=C2=A0

--0003255593be4f7f8204a40aa32c--