Re: [O] Passing font size to exported LaTeX table

2011-06-13 Thread Suvayu Ali
Hi Nick,

On Mon, 13 Jun 2011 01:29:03 -0400
Nick Dokos nicholas.do...@hp.com wrote:

  LaTeX commands limited within the scope of the floating environment.

 
 I'd rewrite this last line slightly - the scope belongs to the
 command and the environment withing which the command is placed,
 limits the scope of the command:
 
 ...LaTeX commands and have their scope limited to the floating
 environment.
 
  For example one can set the fontsize of a table different from the
  rest of the document by putting something like =\footnotesize=
  right  
 
 This is not quite right: the fontsize in the table is by default set
 to normal size, but the rest of the document does not have to be
 normal size. I suggest
 
 ...For example one can set the fontsize of a table different from the
 default normal size by putting something like =\footnotesize=
 right...


Done and pushed. :)

 Thanks,
 Nick
 

Thanks for the comments,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-06-12 Thread suvayu ali
On Fri, Jun 10, 2011 at 3:31 PM, Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

  They should certainly be documented as hacks on Worg, but I'm not
  sure they should be documented in the manual. Of course, it may
  happen that a really good hack (by some definition of really
  good) should be elevated to a standard and documented in the
  manual, but IMO this one does not qualify. /soapbox
 

 Along with the revisions for the manual, I will document my hack on
 Worg.

 I made an account with repo.or.cz. I will soon push the changes
 documenting the hack on Worg.

Here is the documentation on Worg. Comments are welcome.

http://orgmode.org/worg/org-hacks.html#sec-1_6_1

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-06-12 Thread Nick Dokos
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 Hello everyone,
 
 On Wed, 1 Jun 2011 12:08:25 -0700
 Suvayu Ali fatkasuvayu+li...@gmail.com wrote:
 
  On Wed, 01 Jun 2011 14:50:34 -0400
  Nick Dokos nicholas.do...@hp.com wrote:
  
   soapbox I've tried to keep a neutral tone in (most of) the rest of
   the mail, but I have to say that I think clever hacks like this are
   too clever for their own good - they are at best an accident of
   implementation. The fact that the trick uses the placement option in
   order to change the font testifies to that.
  
  After the very clear description above, I agree 100%. I will remove my
  addition to the manual and instead try to improve the #+ATTR_LaTeX:
  documentation based on your code commentary. At the moment I am
  facing a very important deadline for the 8th of June, I will submit a
  revised patch after that.
  
 
 I have attached a patch removing the hack from the manual and making
 some other small improvements to the latex export of images. However I
 did leave in one sentence regarding the placement option which alludes
 that a hack is possible.
 
 Please let me know if this is an improvement.
 
   They should certainly be documented as hacks on Worg, but I'm not
   sure they should be documented in the manual. Of course, it may
   happen that a really good hack (by some definition of really
   good) should be elevated to a standard and documented in the
   manual, but IMO this one does not qualify. /soapbox
   
  
  Along with the revisions for the manual, I will document my hack on
  Worg.
 
 I made an account with repo.or.cz. I will soon push the changes
 documenting the hack on Worg.
 
 -- 
 Suvayu
 
 Open source is the future. It sets us free.
 From 7f66dba736136fc1a2ee8e2d4fbce47e07db3ca6 Mon Sep 17 00:00:00 2001
 From: Suvayu Ali (ThinkPad) fatkasuvayu+li...@gmail.com
 Date: Fri, 10 Jun 2011 14:57:48 -0700
 Subject: [PATCH] Improve Images in LaTeX export documentation
 
 * Mention use of keywords like multicolumn and float
 * Remove previous mention of hack with placement option
   as per comments on the mailing list. Hack better
   suited for Worg.
 ---
  doc/org.texi |   30 --
  1 files changed, 12 insertions(+), 18 deletions(-)
 
 diff --git a/doc/org.texi b/doc/org.texi
 index 92343de..c98bd53 100644
 --- a/doc/org.texi
 +++ b/doc/org.texi
 @@ -10207,24 +10207,14 @@ output file resulting from @LaTeX{} processing.  
 Org will use an
  @code{\includegraphics} macro to insert the image.  If you have specified a
  caption and/or a label as described in @ref{Images and tables}, the figure
  will be wrapped into a @code{figure} environment and thus become a floating
 -element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
 -options that can be used in the optional argument of the
 -@code{\includegraphics} macro.  To modify the placement option of the
 -@code{figure} environment, add something like @samp{placement=[h!]} to the
 -Attributes. It is to be noted this option can be used with tables as well.
 -The options are passed as the placement option to floating environments like
 -@code{figure} or @code{table}. One can pass other compatible options as well.
 -For example the @code{#+ATTR_LaTeX:} line below is exported as the
 -@code{figure} environment below it.
 -
 -@cindex #+ATTR_LaTeX
 -@example
 -#+ATTR_LaTeX: placement=[options]\footnotesize
 -
 -\begin@{figure@}[options]\footnotesize
 -...
 -\end@{figure@}
 -@end example
 +element.  You can use an @code{#+ATTR_LaTeX:} line to specify various other
 +options.  You can ask org to export an image as a float without specifying
 +a label or a caption by using the keyword @code{float} in this line.  Various
 +optional arguments to the @code{\includegraphics} macro can also be specified
 +in this fashion.  To modify the placement option of the floating environment,
 +add something like @samp{placement=[h!]} to the attributes.  It is to be 
 noted
 +this option can be used with tables as well.  One can also pass other
 +compatible options.
  

The question here is: what does compatible mean? Compatible with what?
Now that you added the hack to Worg, it might be better to say: 

One can also take advantage of this option to pass other, unrelated options
into the figure or table environment (see
[[http://orgmode.org/worg/org-hacks.html#sec-1_6_1][here]] for an example.)

or something like that.


  If you would like to let text flow around the image, add the word @samp{wrap}
  to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
 @@ -10246,6 +10236,10 @@ for @code{\includegraphics} and @code{wrapfigure}.
  [[./img/hst.png]]
  @end example
  
 +If you wish to include an image which spans multiple columns in a page,
 +you can use the keyword @code{multicolumn} in the @code{#+ATTR_LaTeX}
 +line. This will export the image wrapped in a @code{figure*} environment.
 +
  If you need references to a label created in this way, write
  

Re: [O] Passing font size to exported LaTeX table

2011-06-12 Thread Suvayu Ali
Hi Nick,

On Sun, 12 Jun 2011 21:52:51 -0400
Nick Dokos nicholas.do...@hp.com wrote:

 The question here is: what does compatible mean? Compatible with
 what? Now that you added the hack to Worg, it might be better to say: 
 
 One can also take advantage of this option to pass other, unrelated
 options into the figure or table environment (see
 [[http://orgmode.org/worg/org-hacks.html#sec-1_6_1][here]] for an
 example.)
 
 or something like that.

Thanks for the comment.

I modified the patch as per your suggestion. For the link however,
instead of a direct link to the section I linked to the org hacks page
and named the section, just in case the section ordering changes in
the future for some reason.

Here is my submission:
http://thread.gmane.org/gmane.emacs.orgmode/42776

:)

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-06-12 Thread Nick Dokos
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 Hi Nick,
 
 On Sun, 12 Jun 2011 21:52:51 -0400
 Nick Dokos nicholas.do...@hp.com wrote:
 
  The question here is: what does compatible mean? Compatible with
  what? Now that you added the hack to Worg, it might be better to say: 
  
  One can also take advantage of this option to pass other, unrelated
  options into the figure or table environment (see
  [[http://orgmode.org/worg/org-hacks.html#sec-1_6_1][here]] for an
  example.)
  
  or something like that.
 
 Thanks for the comment.
 
 I modified the patch as per your suggestion. For the link however,
 instead of a direct link to the section I linked to the org hacks page
 and named the section, just in case the section ordering changes in
 the future for some reason.
 
 Here is my submission:
 http://thread.gmane.org/gmane.emacs.orgmode/42776
 
 :)
 

Looks good to me.

Thanks,
Nick




Re: [O] Passing font size to exported LaTeX table

2011-06-12 Thread Suvayu Ali
Hi Nick and Tom,

On Mon, 13 Jun 2011 00:27:31 -0400
Nick Dokos nicholas.do...@hp.com wrote:

 Thomas S. Dye t...@tsdye.com wrote:
 
  Nick's got a good editorial eye: compatible options is probably
  not correct.  In the example on Worg hacks, \footnotesize is not an
  optional argument to the \table environment, it is a LaTeX command
  whose scope is determined by the \table environment within which it
  is issued.  So, instead of One can also pass other compatible
  options it would be good to say One can also pass LaTeX commands
  into the \table environment or something along those lines.
  
  The entry in Worg hacks looks good to me.  Thanks for taking care of
  this, Suvayu.
  
  Many thanks to Nick and Suvayu for figuring out how to get inside
  the table environment from Org-mode.  I can't remember how many
  times I tried and failed to figure this out on my own ...
  
 
 Now that the Worg entry exists, I'd like to expand it a bit to add
 essentially what Tom mentions in his first paragraph and also to add a
 pointer to the other solution of this problem.
 

I have modified the Worg entry like this

*** Specifying LaTeX commands to floating environments

The keyword ~placement~ can be used to specify placement options to
floating environments (like =\begin{figure}= and =\begin{table}=}) in
LaTeX export. Org passes along everything passed in options as long as
there are no spaces. One can take advantage of this to pass other
LaTeX commands limited within the scope of the floating environment.

For example one can set the fontsize of a table different from the
rest of the document by putting something like =\footnotesize= right
after the placement options. During LaTeX export using the
~#+ATTR_LaTeX:~ line below:

#+begin_src org
  ,#+ATTR_LaTeX: placement=[options]\footnotesize
#+end_src

exports the associated floating environment as shown in the following
block.

#+begin_src latex
\begin{table}[options]\footnotesize
...
\end{table}
#+end_src

If both of you agree and there is no important detail or subtlety
missing, I will commit this to Worg.

 Suvauy, is that OK with you? Or would you rather I created a
 separate hack?
 

Worg is a community resource. I would definitely be okay with and
encourage others improving upon whatever I contribute. :)

 Nick
 


-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-06-12 Thread Nick Dokos
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 Hi Nick and Tom,
 
 On Mon, 13 Jun 2011 00:27:31 -0400
 Nick Dokos nicholas.do...@hp.com wrote:
 
  Thomas S. Dye t...@tsdye.com wrote:
  
   Nick's got a good editorial eye: compatible options is probably
   not correct.  In the example on Worg hacks, \footnotesize is not an
   optional argument to the \table environment, it is a LaTeX command
   whose scope is determined by the \table environment within which it
   is issued.  So, instead of One can also pass other compatible
   options it would be good to say One can also pass LaTeX commands
   into the \table environment or something along those lines.
   
   The entry in Worg hacks looks good to me.  Thanks for taking care of
   this, Suvayu.
   
   Many thanks to Nick and Suvayu for figuring out how to get inside
   the table environment from Org-mode.  I can't remember how many
   times I tried and failed to figure this out on my own ...
   
  
  Now that the Worg entry exists, I'd like to expand it a bit to add
  essentially what Tom mentions in his first paragraph and also to add a
  pointer to the other solution of this problem.
  
 
 I have modified the Worg entry like this
 
 *** Specifying LaTeX commands to floating environments
 
 The keyword ~placement~ can be used to specify placement options to
 floating environments (like =\begin{figure}= and =\begin{table}=}) in
 LaTeX export. Org passes along everything passed in options as long as
 there are no spaces. One can take advantage of this to pass other
 LaTeX commands limited within the scope of the floating environment.
 

I'd rewrite this last line slightly - the scope belongs to the command and
the environment withing which the command is placed, limits the scope of the
command:

...LaTeX commands and have their scope limited to the floating environment.

 For example one can set the fontsize of a table different from the
 rest of the document by putting something like =\footnotesize= right

This is not quite right: the fontsize in the table is by default set to
normal size, but the rest of the document does not have to be normal
size. I suggest

...For example one can set the fontsize of a table different from the
default normal size by putting something like =\footnotesize= right...

 after the placement options. During LaTeX export using the
 ~#+ATTR_LaTeX:~ line below:
 
 #+begin_src org
   ,#+ATTR_LaTeX: placement=[options]\footnotesize
 #+end_src
 
 exports the associated floating environment as shown in the following
 block.
 
 #+begin_src latex
 \begin{table}[options]\footnotesize
 ...
 \end{table}
 #+end_src
 
 If both of you agree and there is no important detail or subtlety
 missing, I will commit this to Worg.
 

Otherwise, looks good.

  Suvauy, is that OK with you? Or would you rather I created a
  separate hack?
  
 
 Worg is a community resource. I would definitely be okay with and
 encourage others improving upon whatever I contribute. :)
 

But common courtesy dictates that I should at least ask :-) In any case,
I'm planning to post to the ML for review whatever changes I come up
with.

Thanks,
Nick




Re: [O] Passing font size to exported LaTeX table

2011-06-10 Thread Suvayu Ali
Hello everyone,

On Wed, 1 Jun 2011 12:08:25 -0700
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 On Wed, 01 Jun 2011 14:50:34 -0400
 Nick Dokos nicholas.do...@hp.com wrote:
 
  soapbox I've tried to keep a neutral tone in (most of) the rest of
  the mail, but I have to say that I think clever hacks like this are
  too clever for their own good - they are at best an accident of
  implementation. The fact that the trick uses the placement option in
  order to change the font testifies to that.
 
 After the very clear description above, I agree 100%. I will remove my
 addition to the manual and instead try to improve the #+ATTR_LaTeX:
 documentation based on your code commentary. At the moment I am
 facing a very important deadline for the 8th of June, I will submit a
 revised patch after that.
 

I have attached a patch removing the hack from the manual and making
some other small improvements to the latex export of images. However I
did leave in one sentence regarding the placement option which alludes
that a hack is possible.

Please let me know if this is an improvement.

  They should certainly be documented as hacks on Worg, but I'm not
  sure they should be documented in the manual. Of course, it may
  happen that a really good hack (by some definition of really
  good) should be elevated to a standard and documented in the
  manual, but IMO this one does not qualify. /soapbox
  
 
 Along with the revisions for the manual, I will document my hack on
 Worg.

I made an account with repo.or.cz. I will soon push the changes
documenting the hack on Worg.

-- 
Suvayu

Open source is the future. It sets us free.
From 7f66dba736136fc1a2ee8e2d4fbce47e07db3ca6 Mon Sep 17 00:00:00 2001
From: Suvayu Ali (ThinkPad) fatkasuvayu+li...@gmail.com
Date: Fri, 10 Jun 2011 14:57:48 -0700
Subject: [PATCH] Improve Images in LaTeX export documentation

* Mention use of keywords like multicolumn and float
* Remove previous mention of hack with placement option
  as per comments on the mailing list. Hack better
  suited for Worg.
---
 doc/org.texi |   30 --
 1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 92343de..c98bd53 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10207,24 +10207,14 @@ output file resulting from @LaTeX{} processing.  Org 
will use an
 @code{\includegraphics} macro to insert the image.  If you have specified a
 caption and/or a label as described in @ref{Images and tables}, the figure
 will be wrapped into a @code{figure} environment and thus become a floating
-element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
-options that can be used in the optional argument of the
-@code{\includegraphics} macro.  To modify the placement option of the
-@code{figure} environment, add something like @samp{placement=[h!]} to the
-Attributes. It is to be noted this option can be used with tables as well.
-The options are passed as the placement option to floating environments like
-@code{figure} or @code{table}. One can pass other compatible options as well.
-For example the @code{#+ATTR_LaTeX:} line below is exported as the
-@code{figure} environment below it.
-
-@cindex #+ATTR_LaTeX
-@example
-#+ATTR_LaTeX: placement=[options]\footnotesize
-
-\begin@{figure@}[options]\footnotesize
-...
-\end@{figure@}
-@end example
+element.  You can use an @code{#+ATTR_LaTeX:} line to specify various other
+options.  You can ask org to export an image as a float without specifying
+a label or a caption by using the keyword @code{float} in this line.  Various
+optional arguments to the @code{\includegraphics} macro can also be specified
+in this fashion.  To modify the placement option of the floating environment,
+add something like @samp{placement=[h!]} to the attributes.  It is to be noted
+this option can be used with tables as well.  One can also pass other
+compatible options.
 
 If you would like to let text flow around the image, add the word @samp{wrap}
 to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
@@ -10246,6 +10236,10 @@ for @code{\includegraphics} and @code{wrapfigure}.
 [[./img/hst.png]]
 @end example
 
+If you wish to include an image which spans multiple columns in a page,
+you can use the keyword @code{multicolumn} in the @code{#+ATTR_LaTeX}
+line. This will export the image wrapped in a @code{figure*} environment.
+
 If you need references to a label created in this way, write
 @samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}.
 
-- 
1.7.4.4



Re: [O] Passing font size to exported LaTeX table

2011-06-01 Thread Nick Dokos
Thomas S. Dye t...@tsdye.com wrote:

 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  I am not very familiar with org-latex internals. Based on my limited
  understanding I wrote the attached patch to the org manual. I hope it
  is up to par.
 

 [patch snipped]
 
 This looks like an improvement to me.  I'd be interested to hear what
 Nick and Seb might have to say.  They often catch things I miss.
 
 If you don't get other comments, I'd encourage you to submit this as a
 patch (I think this requires [PATCH] in the subject line) to see what
 Carsten and crew have to say about it.
 
 Thanks again for finding this solution to specifying the font size for
 floating tables on a table-by-table basis in LaTeX export.  I'd been
 looking for your solution, and for Nick's solution that works on a
 per-document or buffer basis, for many months without success.
 

Maybe I can contribute some commentary to the code and ask Suvayu to perhaps
amend the patch to clarify some things (but see my editorial comment at
the end of the email):

code commentary
There are two parts to the code: one is in org-exp.el,
org-export-attach-captions-and-attributes(), which matches caption,
label and attr_latex lines and adds text properties for later use by the
export backend. It figures out whether the following item is a table or
a link and it adds the appropriate text property (or properties - one or
more can be present for a given itme) to the item: either the whole
table[fn:1] or the line containing the link. There are three different
properties corresponding to the #+foo construct: 'org-caption,
'org-labeland and 'org-attributes.

The second part is in the specific backend - latex in this case (I did
not look at the others). There are two cases: tables and links.


The table case is handled by org-export-latex tables. It gets the
caption label and attributes from the corresponding text property. It
then further parses the string it gets from the 'org-attributes property
to figure out:

- whether this is a longtable (a table spanning multiple pages)
  (syntax: the string longtable as a word)
- whether it's a table or a table* (syntax: the string itself)
- whether it's a tabular (syntax: the string tabular followed by a
  single char - that's to catch the tabular*, tabularx and tabulary
  cases I believe).
- what the width is (syntax: width=XXX where XXX is a sequence of
  anything but white space and there is a word boundary before
  width - i.e.  width=foo will set the width to foo but 
  linewidth=foo will not).
- what the alignment is (syntax: same as width but with align
  instead)
- what the placement is (syntax: placement=XXX - where XXX is a
  string of one or more non-white-space characters.

Suvayu's method works by taking advantage of the fact that the placement
value (i.e. the string to the right of the equal sign) does not
contain white space and copies the whole thing as the placement value in
the correct place in the table environment. LaTeX then parses this and
breaks it up into placement and \scriptsize constructs. Since org adds
the placement info to the table environment, \scriptsize sneaks in by
the back door, so to speak.

In the case of a link (which presumably points to an image and handled by
org-export-latex-links and org-export-latex-format-image), the parsing
of the property figures out

   - whether to use wrapfigure (syntax: wrap as a word)
   - whether to use the figure env (syntax: float as a word)
   - whether to use the figure* env (syntax: multicolumn as a word)
   - what the placement is (syntax: same as above)

In addition, whether there is a caption or a label determines whether
the figure is floated or inlined.

/code commentary

soapbox I've tried to keep a neutral tone in (most of) the rest of the
mail, but I have to say that I think clever hacks like this are too
clever for their own good - they are at best an accident of
implementation. The fact that the trick uses the placement option in
order to change the font testifies to that. They should certainly be
documented as hacks on Worg, but I'm not sure they should be documented
in the manual. Of course, it may happen that a really good hack (by some
definition of really good) should be elevated to a standard and
documented in the manual, but IMO this one does not qualify.  /soapbox

Comments, corrections, additions are more than welcome.

Nick

Footnotes:

[fn:1] BTW, the documentation of the function says that the property is
added to the first line of the table, but unless I misread the code,
that's wrong: it gets added to the whole table.



Re: [O] Passing font size to exported LaTeX table

2011-06-01 Thread Suvayu Ali
Hi Nick,

A very big thank you for that crystal clear code commentary.

On Wed, 01 Jun 2011 14:50:34 -0400
Nick Dokos nicholas.do...@hp.com wrote:

 soapbox I've tried to keep a neutral tone in (most of) the rest of
 the mail, but I have to say that I think clever hacks like this are
 too clever for their own good - they are at best an accident of
 implementation. The fact that the trick uses the placement option in
 order to change the font testifies to that.

After the very clear description above, I agree 100%. I will remove my
addition to the manual and instead try to improve the #+ATTR_LaTeX:
documentation based on your code commentary. At the moment I am facing a
very important deadline for the 8th of June, I will submit a revised
patch after that.

 They should certainly be documented as hacks on Worg, but I'm not sure
 they should be documented in the manual. Of course, it may happen that
 a really good hack (by some definition of really good) should be
 elevated to a standard and documented in the manual, but IMO this one
 does not qualify. /soapbox
 

Along with the revisions for the manual, I will document my hack on Worg.

 Comments, corrections, additions are more than welcome.
 

Thanks a lot! :)

 Nick

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-05-28 Thread Sebastien Vauban
Hi Thomas and Suvayu,

Thomas S. Dye wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 diff --git a/doc/org.texi b/doc/org.texi
 index aa34cd3..5fa1e22 100644
 --- a/doc/org.texi
 +++ b/doc/org.texi
 @@ -10160,7 +10160,7 @@ All lines between these markers are exported 
 literally
  @subsection Tables in @LaTeX{} export
  @cindex tables, in @LaTeX{} export
  
 -For @LaTeX{} export of a table, you can specify a label and a caption
 +For @LaTeX{} export of a table, you can specify a label, a caption and 
 placement options
  (@pxref{Images and tables}).  You can also use the @code{ATTR_LaTeX} line to
  request a @code{longtable} environment for the table, so that it may span
  several pages, or to change the default table environment from @code{table}
 @@ -10207,7 +10207,20 @@ element.  You can use an @code{#+ATTR_LaTeX:} line 
 to specify the various
  options that can be used in the optional argument of the
  @code{\includegraphics} macro.  To modify the placement option of the
  @code{figure} environment, add something like @samp{placement=[h!]} to the
 -Attributes.
 +Attributes. It is to be noted this option can be used with tables as well.
 +The options are passed as the placement option to floating environments like
 +@code{figure} or @code{table}. One can pass other compatible options as 
 well.
 +For example the @code{#+ATTR_LaTeX:} line below is exported as the
 +@code{figure} environment below it.
 +
 +@cindex #+ATTR_LaTeX
 +@example
 +#+ATTR_LaTeX: placement=[options]\footnotesize
 +
 +\begin{figure}[options]\footnotesize
 +...
 +\end{figure}
 +@end example
  
  If you would like to let text flow around the image, add the word 
 @samp{wrap}
  to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left

 This looks like an improvement to me.

I think so too. The real test will be, though, the day I will search for
additional info about the tables. And the above text seems neat to me.

 I'd be interested to hear what Nick and Seb might have to say. They often
 catch things I miss.

;-)

 If you don't get other comments, I'd encourage you to submit this as a patch
 (I think this requires [PATCH] in the subject line) to see what Carsten and
 crew have to say about it.

 Thanks again for finding this solution to specifying the font size for
 floating tables on a table-by-table basis in LaTeX export. I'd been looking
 for your solution, and for Nick's solution that works on a per-document or
 buffer basis, for many months without success.

Thanks to both of you, for closing this loop up to the documentation stuff!

Best regards,
  Seb

-- 
Sébastien Vauban




Re: [O] Passing font size to exported LaTeX table

2011-05-28 Thread Suvayu Ali
Hi Tom and Seb,

On Sat, 28 May 2011 09:17:18 +0200
Sebastien Vauban wxhgmqzgw...@spammotel.com wrote:

  This looks like an improvement to me.  
 
 I think so too. The real test will be, though, the day I will search
 for additional info about the tables. And the above text seems neat
 to me.
 

Great! All is in order then. :)

 
  If you don't get other comments, I'd encourage you to submit this
  as a patch (I think this requires [PATCH] in the subject line) to
  see what Carsten and crew have to say about it.
 

From what I understand the patchwork server queues messages based on
the MIME type and contents of the attachment. If that is correct this
should be picked up just fine.

  Thanks again for finding this solution to specifying the font size
  for floating tables on a table-by-table basis in LaTeX export. I'd
  been looking for your solution, and for Nick's solution that works
  on a per-document or buffer basis, for many months without
  success.  
 
 Thanks to both of you, for closing this loop up to the documentation
 stuff!

Thanks everyone, :)

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-05-28 Thread Nick Dokos
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

   If you don't get other comments, I'd encourage you to submit this
   as a patch (I think this requires [PATCH] in the subject line) to
   see what Carsten and crew have to say about it.
  
 
 =46rom what I understand the patchwork server queues messages based on
 the MIME type and contents of the attachment. If that is correct this
 should be picked up just fine.
 

I just checked: so far at least, it's not on patchwork.

Nick



Re: [O] Passing font size to exported LaTeX table

2011-05-28 Thread Suvayu Ali
On Sat, 28 May 2011 11:21:15 -0400
Nick Dokos nicholas.do...@hp.com wrote:

 Suvayu Ali fatkasuvayu+li...@gmail.com wrote:
 
If you don't get other comments, I'd encourage you to submit
this as a patch (I think this requires [PATCH] in the subject
line) to see what Carsten and crew have to say about it.
   
  
  =46rom what I understand the patchwork server queues messages based
  on the MIME type and contents of the attachment. If that is correct
  this should be picked up just fine.
  
 
 I just checked: so far at least, it's not on patchwork.
 

Okay, I'll send it again on a separate thread with a proper subject
line.

 Nick

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-05-27 Thread Thomas S. Dye
suvayu ali fatkasuvayu+li...@gmail.com writes:

 Hello,

 On Wed, May 25, 2011 at 12:22 AM, Thomas S. Dye t...@tsdye.com wrote:
 #+LaTeX_HEADER: \usepackage{scripttab}

 * foo

 What's this?


 #+tblname: foo
 #+CAPTION: foo
 | table | here |
 |---+--|
 | table | here |

 What's this?


 I think this works OK.

 Nick

 Aloha Nick,

 This works like a charm.  Thanks!

 Although this is solved now, I found a very simple solution.

 e.g. for footnotesize just add the line:

 #+ATTR_LaTeX: placement=[options]\footnotesize

Aloha Suvayu,

And this works, too.  Thanks!

Can I ask where you found this simple solution?

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Passing font size to exported LaTeX table

2011-05-27 Thread suvayu ali
Hi Tom,

On Thu, May 26, 2011 at 11:46 PM, Thomas S. Dye t...@tsdye.com wrote:
 Although this is solved now, I found a very simple solution.

 e.g. for footnotesize just add the line:

 #+ATTR_LaTeX: placement=[options]\footnotesize

 Aloha Suvayu,

 And this works, too.  Thanks!

 Can I ask where you found this simple solution?

Of course you may. :) I came across a few very nicely written articles
by LF Mori in The Practex Journal. This particular solution was
discussed in section 3.1 of the following article:

http://www.tug.org/pracjourn/2007-1/mori/

HTH

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-05-27 Thread Thomas S. Dye
suvayu ali fatkasuvayu+li...@gmail.com writes:

 Hi Tom,

 On Thu, May 26, 2011 at 11:46 PM, Thomas S. Dye t...@tsdye.com wrote:
 Although this is solved now, I found a very simple solution.

 e.g. for footnotesize just add the line:

 #+ATTR_LaTeX: placement=[options]\footnotesize

 Aloha Suvayu,

 And this works, too.  Thanks!

 Can I ask where you found this simple solution?

 Of course you may. :) I came across a few very nicely written articles
 by LF Mori in The Practex Journal. This particular solution was
 discussed in section 3.1 of the following article:

 http://www.tug.org/pracjourn/2007-1/mori/

 HTH

Aloha Suvayu,

Thank you for the link to the Mori article.  It is nicely written.

My question was poorly written, though.  I'm interested to know where
you found the Org-mode line:

#+ATTR_LaTeX: placement=[options]\footnotesize

I haven't been able to find this solution anywhere else.

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Passing font size to exported LaTeX table

2011-05-27 Thread Suvayu Ali
Hello Tom,

On Fri, 27 May 2011 06:17:04 -1000
t...@tsdye.com (Thomas S. Dye) wrote:

 Aloha Suvayu,
 
 Thank you for the link to the Mori article.  It is nicely written.
 
 My question was poorly written, though.  I'm interested to know where
 you found the Org-mode line:
 
 #+ATTR_LaTeX: placement=[options]\footnotesize
 
 I haven't been able to find this solution anywhere else.
 

I got the solution by reading between the lines and some
experimentation. The placement option is documented in the section
referenced below[1]. Note that this does not say anything about tables.
I think I found it by experimenting that this also works for tables.
When I saw the LaTeX solution in the article I mentioned earlier, I
tried out and found exporting as above works. :)

 All the best,
 Tom

HTH

Footnotes:

[1] 
http://orgmode.org/manual/Images-in-LaTeX-export.html#Images-in-LaTeX-export
-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-05-27 Thread Thomas S. Dye
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 Hello Tom,

 On Fri, 27 May 2011 06:17:04 -1000
 t...@tsdye.com (Thomas S. Dye) wrote:

 Aloha Suvayu,
 
 Thank you for the link to the Mori article.  It is nicely written.
 
 My question was poorly written, though.  I'm interested to know where
 you found the Org-mode line:
 
 #+ATTR_LaTeX: placement=[options]\footnotesize
 
 I haven't been able to find this solution anywhere else.
 

 I got the solution by reading between the lines and some
 experimentation. The placement option is documented in the section
 referenced below[1]. Note that this does not say anything about tables.
 I think I found it by experimenting that this also works for tables.
 When I saw the LaTeX solution in the article I mentioned earlier, I
 tried out and found exporting as above works. :)

 All the best,
 Tom

 HTH

 Footnotes:

 [1] 
 http://orgmode.org/manual/Images-in-LaTeX-export.html#Images-in-LaTeX-export

Aloha Suvayu,

I think #+ATTR_LaTeX: needs more documentation.  I worked very hard to
read between the lines of the Org-mode manual to arrive at your simple
solution but didn't manage to come close!

Are you able to summarize the possibilities of #+ATTR_LaTeX?  I'm
thinking that a general description somewhere in the Org-mode manual
might be useful.  It would probably also be good to augment the existing
descriptions of its use in the manual, as well.  Perhaps it would be
possible to propose a patch to the documentation?

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Passing font size to exported LaTeX table

2011-05-27 Thread Suvayu Ali
Hello Tom,

On Fri, 27 May 2011 07:37:50 -1000
t...@tsdye.com (Thomas S. Dye) wrote:

 Aloha Suvayu,
 
 I think #+ATTR_LaTeX: needs more documentation.  I worked very hard to
 read between the lines of the Org-mode manual to arrive at your simple
 solution but didn't manage to come close!
 
 Are you able to summarize the possibilities of #+ATTR_LaTeX?  I'm
 thinking that a general description somewhere in the Org-mode manual
 might be useful.  It would probably also be good to augment the
 existing descriptions of its use in the manual, as well.  Perhaps it
 would be possible to propose a patch to the documentation?
 

I am not very familiar with org-latex internals. Based on my limited
understanding I wrote the attached patch to the org manual. I hope it
is up to par.

 All the best,
 Tom

Thanks a lot for your encouragement. :)

-- 
Suvayu

Open source is the future. It sets us free.
From 431d7e275a0b374c7b1e8135fe7e5c7d72f46a75 Mon Sep 17 00:00:00 2001
From: Suvayu Ali fatkasuvayu+li...@gmail.com
Date: Fri, 27 May 2011 11:18:35 -0700
Subject: [PATCH] Documentation on placement options in LaTeX export.

* Placement options can be passed to floating environments
  like 'figure' or 'table' with the '#+ATTR_LaTeX:' line
  during LaTeX export. Added an example to demonstrate that.
---
 doc/org.texi |   17 +++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index aa34cd3..5fa1e22 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10160,7 +10160,7 @@ All lines between these markers are exported literally
 @subsection Tables in @LaTeX{} export
 @cindex tables, in @LaTeX{} export
 
-For @LaTeX{} export of a table, you can specify a label and a caption
+For @LaTeX{} export of a table, you can specify a label, a caption and 
placement options
 (@pxref{Images and tables}).  You can also use the @code{ATTR_LaTeX} line to
 request a @code{longtable} environment for the table, so that it may span
 several pages, or to change the default table environment from @code{table}
@@ -10207,7 +10207,20 @@ element.  You can use an @code{#+ATTR_LaTeX:} line to 
specify the various
 options that can be used in the optional argument of the
 @code{\includegraphics} macro.  To modify the placement option of the
 @code{figure} environment, add something like @samp{placement=[h!]} to the
-Attributes.
+Attributes. It is to be noted this option can be used with tables as well.
+The options are passed as the placement option to floating environments like
+@code{figure} or @code{table}. One can pass other compatible options as well.
+For example the @code{#+ATTR_LaTeX:} line below is exported as the
+@code{figure} environment below it.
+
+@cindex #+ATTR_LaTeX
+@example
+#+ATTR_LaTeX: placement=[options]\footnotesize
+
+\begin{figure}[options]\footnotesize
+...
+\end{figure}
+@end example
 
 If you would like to let text flow around the image, add the word @samp{wrap}
 to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
-- 
1.7.5.1



Re: [O] Passing font size to exported LaTeX table

2011-05-27 Thread Thomas S. Dye
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 Hello Tom,

 On Fri, 27 May 2011 07:37:50 -1000
 t...@tsdye.com (Thomas S. Dye) wrote:

 Aloha Suvayu,
 
 I think #+ATTR_LaTeX: needs more documentation.  I worked very hard to
 read between the lines of the Org-mode manual to arrive at your simple
 solution but didn't manage to come close!
 
 Are you able to summarize the possibilities of #+ATTR_LaTeX?  I'm
 thinking that a general description somewhere in the Org-mode manual
 might be useful.  It would probably also be good to augment the
 existing descriptions of its use in the manual, as well.  Perhaps it
 would be possible to propose a patch to the documentation?
 

 I am not very familiar with org-latex internals. Based on my limited
 understanding I wrote the attached patch to the org manual. I hope it
 is up to par.

 All the best,
 Tom

 Thanks a lot for your encouragement. :)

 -- 
 Suvayu

 Open source is the future. It sets us free.

 From 431d7e275a0b374c7b1e8135fe7e5c7d72f46a75 Mon Sep 17 00:00:00 2001
 From: Suvayu Ali fatkasuvayu+li...@gmail.com
 Date: Fri, 27 May 2011 11:18:35 -0700
 Subject: [PATCH] Documentation on placement options in LaTeX export.

 * Placement options can be passed to floating environments
   like 'figure' or 'table' with the '#+ATTR_LaTeX:' line
   during LaTeX export. Added an example to demonstrate that.
 ---
  doc/org.texi |   17 +++--
  1 files changed, 15 insertions(+), 2 deletions(-)

 diff --git a/doc/org.texi b/doc/org.texi
 index aa34cd3..5fa1e22 100644
 --- a/doc/org.texi
 +++ b/doc/org.texi
 @@ -10160,7 +10160,7 @@ All lines between these markers are exported literally
  @subsection Tables in @LaTeX{} export
  @cindex tables, in @LaTeX{} export
  
 -For @LaTeX{} export of a table, you can specify a label and a caption
 +For @LaTeX{} export of a table, you can specify a label, a caption and 
 placement options
  (@pxref{Images and tables}).  You can also use the @code{ATTR_LaTeX} line to
  request a @code{longtable} environment for the table, so that it may span
  several pages, or to change the default table environment from @code{table}
 @@ -10207,7 +10207,20 @@ element.  You can use an @code{#+ATTR_LaTeX:} line 
 to specify the various
  options that can be used in the optional argument of the
  @code{\includegraphics} macro.  To modify the placement option of the
  @code{figure} environment, add something like @samp{placement=[h!]} to the
 -Attributes.
 +Attributes. It is to be noted this option can be used with tables as well.
 +The options are passed as the placement option to floating environments like
 +@code{figure} or @code{table}. One can pass other compatible options as well.
 +For example the @code{#+ATTR_LaTeX:} line below is exported as the
 +@code{figure} environment below it.
 +
 +@cindex #+ATTR_LaTeX
 +@example
 +#+ATTR_LaTeX: placement=[options]\footnotesize
 +
 +\begin{figure}[options]\footnotesize
 +...
 +\end{figure}
 +@end example
  
  If you would like to let text flow around the image, add the word @samp{wrap}
  to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
Aloha Suvayu,

This looks like an improvement to me.  I'd be interested to hear what
Nick and Seb might have to say.  They often catch things I miss.

If you don't get other comments, I'd encourage you to submit this as a
patch (I think this requires [PATCH] in the subject line) to see what
Carsten and crew have to say about it.

Thanks again for finding this solution to specifying the font size for
floating tables on a table-by-table basis in LaTeX export.  I'd been
looking for your solution, and for Nick's solution that works on a
per-document or buffer basis, for many months without success.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Passing font size to exported LaTeX table

2011-05-26 Thread suvayu ali
Hello,

On Wed, May 25, 2011 at 12:22 AM, Thomas S. Dye t...@tsdye.com wrote:
 #+LaTeX_HEADER: \usepackage{scripttab}

 * foo

 What's this?


 #+tblname: foo
 #+CAPTION: foo
 | table | here |
 |---+--|
 | table | here |

 What's this?


 I think this works OK.

 Nick

 Aloha Nick,

 This works like a charm.  Thanks!

Although this is solved now, I found a very simple solution.

e.g. for footnotesize just add the line:

#+ATTR_LaTeX: placement=[options]\footnotesize

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Passing font size to exported LaTeX table

2011-05-25 Thread Thomas S. Dye
Nick Dokos nicholas.do...@hp.com writes:

 [Fat-fingered it and sent it prematurely - sorry about that]

 Nick Dokos nicholas.do...@hp.com wrote:

 Nick Dokos nicholas.do...@hp.com wrote:
 
  Thomas S. Dye t...@tsdye.com wrote:
  
   
   This appears to work for tabular environments only.  When I add a
   caption the table is set normalsize and the text following it is set
   scriptsize. Or, am I doing something wrong?
   
  
  Oy, vey: I don't think you are doing anything wrong - I get the same
  thing.
  
  Can \scriptsize be used as a macro with argument? I don't have
  my references here.  If I do it the way Seb suggested, inside an
  environment, it seems to work better, in the sense that it does not
  change the thing after the table - but the table is unaffected
  nevertheless. I guess the table environment sets a font size explicitly,
  overriding outside settings.
  
 
 table - float - xfloat - floatboxreset - normalsize
 

 This was supposed to say that yes, indeed, the table environment sets
 \normalsize explicitly, through this sequence of macro calls.

 So you can redefine floatboreset to change the size:
   floatboxreset
 
 scripttab.sty:
 \makeatletter
 \def \@floatboxreset {%
 \reset@font
 \scriptsize
 \@setminipage
 }
 \makeatother
 
 scripttab.org:
 

 scripttab.sty:
 \makeatletter
 \def \@floatboxreset {%
 \reset@font
 \scriptsize
 \@setminipage
 }
 \makeatother

 scripttab.org:
 #+LaTeX_HEADER: \usepackage{scripttab}

 * foo

 What's this?


 #+tblname: foo
 #+CAPTION: foo
 | table | here |
 |---+--|
 | table | here |

 What's this?


 I think this works OK.

 Nick

Aloha Nick,

This works like a charm.  Thanks!

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



[O] Passing font size to exported LaTeX table

2011-05-24 Thread John Hendy
Hi,


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.


Thanks,
John


Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread John Hendy
On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban 
wxhgmqzgw...@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 }.
inserted text
\par
l.142 }

Runaway argument?
 \par \par \par
! Paragraph ended before \frame was complete.
to be read again
   \par
l.142 }

! Extra }, or forgotten \endgroup.
recently read }

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?


John


 Best regards,
  Seb

 --
 Sébastien Vauban





Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread Nick Dokos
John Hendy jw.he...@gmail.com wrote:

 On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban 
 wxhgmqzgw...@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 }.
 inserted text 
                 \par 
 l.142 }
        
 Runaway argument?
  \par \par \par 
 ! Paragraph ended before \frame was complete.
 to be read again 
                    \par 
 l.142 }
        
 ! Extra }, or forgotten \endgroup.
 recently read }
                  
 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
`

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?




Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread John Hendy
On Tue, May 24, 2011 at 2:25 PM, Nick Dokos nicholas.do...@hp.com wrote:

 John Hendy jw.he...@gmail.com wrote:

  On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban 
 wxhgmqzgw...@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 }.
  inserted text
  \par
  l.142 }
 
  Runaway argument?
   \par \par \par
  ! Paragraph ended before \frame was complete.
  to be read again
 \par
  l.142 }
 
  ! Extra }, or forgotten \endgroup.
  recently read }
 
  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!


Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread Sebastien Vauban
Hi John and Nick,

Nick Dokos wrote:
 John Hendy jw.he...@gmail.com wrote:
 On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban 
 wxhgmqzgw...@spammotel.com wrote:
 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 [...]
  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 }.
 inserted text 
                 \par 
 l.142 }
        
 Runaway argument?
  \par \par \par 
 ! Paragraph ended before \frame was complete.
 to be read again 
                    \par 
 l.142 }
        
 ! Extra }, or forgotten \endgroup.
 recently read }
                  
 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?

Now, a real-life example that used to work -- and still does!

#+LaTeX: {\fontsize{3.8}{4.2}\selectfont

#+BEGIN: columnview :hlines 1 :id local
| Task |  Orig. |   Time | Estim. | PRIOR | SCHEDULED | 
DEADLINE |
|--++++---+---+--|
| * POC| 856:00 | 698:50 | 775:55 |   |   | 
 |
| ** Setup |  32:00 |   2:00 |  10:00 |   |   | 
 |
| *** Bugs or features ||  32:05 |   0:15 |   |   | 
 |
| *** TODO Caching?||||   |   | 
 |
#+END:

#+LaTeX: }

So, diffs are here:

- I'm using an explicit size
- I don't use LaTeX blocks but just LaTeX one-liners


 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
 `

 The opening brace on the \scriptsize line confuses the exporter and it
 leaves the table alone. Adding a commented-out closing brace unconfuses
 it.

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

Asking the question is answering it... ;-)

Best regards,
  Seb

-- 
Sébastien Vauban




Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread Thomas S. Dye
John Hendy jw.he...@gmail.com writes:

 On Tue, May 24, 2011 at 2:25 PM, Nick Dokos nicholas.do...@hp.com wrote:

 John Hendy jw.he...@gmail.com wrote:

  On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban 
 wxhgmqzgw...@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 }.
  inserted text
  \par
  l.142 }
 
  Runaway argument?
   \par \par \par
  ! Paragraph ended before \frame was complete.
  to be read again
 \par
  l.142 }
 
  ! Extra }, or forgotten \endgroup.
  recently read }
 
  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!
 On Tue, May 24, 2011 at 2:25 PM, Nick Dokos span 
 dir=ltrmailto:nicholas.do...@hp.com/span wrote:
 John Hendy mailto:jw.he...@gmail.com wrote:

 On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban 
 mailto:wxhgmqzgw...@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#39;m getting this error upon export (no PDF created):
 ---
 ! Argument of \frame has an extra }.
 inserted text 
                 \par 
 l.142 }
        
 Runaway argument?
  \par \par \par 
 ! Paragraph ended before \frame was complete.
 to be read again 
                    \par 
 l.142 }
        
 ! Extra }, or forgotten \endgroup.
 recently read }
                  
 l.142 }
        
 ! Extra }, or forgotten \endgroup.
 \endframe -\egroup 
                     \begingroup \def \@currenvir {frame}
 l.145 \end{frame}
                  
 )
 Runaway argument?
 ---

 I#39;m assuming something is not liking that dangling }...

 Thoughts?


 I didn#39;t try Seb#39;s workaround but your original solution almost works:
 what stops it is YAB in 

Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread Nick Dokos
John Hendy jw.he...@gmail.com wrote:

 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! 
 
 

The best debugging technique I can suggest here is to export to LaTeX
and then look at the .tex file. It's usually clear what broke, who is
responsible and, often, how to fix it.

In this case, the org table looked untouched by the exporter, but when I
got rid of the ``\scriptsize {'', the table was properly exported.

Nick



Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread Nick Dokos
Thomas S. Dye t...@tsdye.com wrote:

 
 This appears to work for tabular environments only.  When I add a
 caption the table is set normalsize and the text following it is set
 scriptsize. Or, am I doing something wrong?
 

Oy, vey: I don't think you are doing anything wrong - I get the same
thing.

Can \scriptsize be used as a macro with argument? I don't have
my references here.  If I do it the way Seb suggested, inside an
environment, it seems to work better, in the sense that it does not
change the thing after the table - but the table is unaffected
nevertheless. I guess the table environment sets a font size explicitly,
overriding outside settings.

Nick




Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread Nick Dokos
Nick Dokos nicholas.do...@hp.com wrote:

 Thomas S. Dye t...@tsdye.com wrote:
 
  
  This appears to work for tabular environments only.  When I add a
  caption the table is set normalsize and the text following it is set
  scriptsize. Or, am I doing something wrong?
  
 
 Oy, vey: I don't think you are doing anything wrong - I get the same
 thing.
 
 Can \scriptsize be used as a macro with argument? I don't have
 my references here.  If I do it the way Seb suggested, inside an
 environment, it seems to work better, in the sense that it does not
 change the thing after the table - but the table is unaffected
 nevertheless. I guess the table environment sets a font size explicitly,
 overriding outside settings.
 

table - float - xfloat - floatboxreset - normalsize

So you can redefine floatboreset to change the size:

scripttab.sty:
--8---cut here---start-8---
\makeatletter
\def \@floatboxreset {%
\reset@font
\scriptsize
\@setminipage
}
\makeatother
--8---cut here---end---8---

scripttab.org:




Re: [O] Passing font size to exported LaTeX table

2011-05-24 Thread Nick Dokos
[Fat-fingered it and sent it prematurely - sorry about that]

Nick Dokos nicholas.do...@hp.com wrote:

 Nick Dokos nicholas.do...@hp.com wrote:
 
  Thomas S. Dye t...@tsdye.com wrote:
  
   
   This appears to work for tabular environments only.  When I add a
   caption the table is set normalsize and the text following it is set
   scriptsize. Or, am I doing something wrong?
   
  
  Oy, vey: I don't think you are doing anything wrong - I get the same
  thing.
  
  Can \scriptsize be used as a macro with argument? I don't have
  my references here.  If I do it the way Seb suggested, inside an
  environment, it seems to work better, in the sense that it does not
  change the thing after the table - but the table is unaffected
  nevertheless. I guess the table environment sets a font size explicitly,
  overriding outside settings.
  
 
 table - float - xfloat - floatboxreset - normalsize
 

This was supposed to say that yes, indeed, the table environment sets
\normalsize explicitly, through this sequence of macro calls.

 So you can redefine floatboreset to change the size:
  floatboxreset
 
 scripttab.sty:
 \makeatletter
 \def \@floatboxreset {%
 \reset@font
 \scriptsize
 \@setminipage
 }
 \makeatother
 
 scripttab.org:
 

scripttab.sty:
--8---cut here---start-8---
\makeatletter
\def \@floatboxreset {%
\reset@font
\scriptsize
\@setminipage
}
\makeatother
--8---cut here---end---8---

scripttab.org:
--8---cut here---start-8---
#+LaTeX_HEADER: \usepackage{scripttab}

* foo

What's this?


#+tblname: foo
#+CAPTION: foo
| table | here |
|---+--|
| table | here |

What's this?

--8---cut here---end---8---

I think this works OK.

Nick