xtable-longtable question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

xtable-longtable question

Felipe Carrillo
Hello:
I am using Sweave to generate a PDF with figures and tables and was wondering if is possible to carry on table headers and some kind of caption like 'Continued' to the next PDF page when creating long tables.

Felipe D. Carrillo  
Supervisory Fishery Biologist  
Department of the Interior  
US Fish & Wildlife Service  
California, USA

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: xtable-longtable question

Duncan Mackay-2
I use Sweave and longtable but have not used them together.

It can be done but you may find the package booktabs helpful for headers
and footers for longtable and tables
as it allows you to put different first and last page headers to the rest.
Something like (untested)
PS You do not need to put \set longtables or something like that if you
have the latest longtable package as it is no longer required

% all table headers
\toprule
\addlinespace[3pt]
\multicolumn{1}{c}{colname 1} & ...\\
\midrule
\addlinespace[3pt]
\endhead

% if want different first 1
\toprule
\addlinespace[3pt]
\multicolumn{1}{c}{colname 1} & ...\\
\midrule
\addlinespace[3pt]
\endfirsthead

% last footer
\bottomrule
\endlastfoot

% other footers
\addlinespace[5pt]
\multicolumn{3}{r}{Continued next page}\\
\midrule
\endfoot

Regards

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
ARMIDALE NSW 2351
Email (home): [hidden email]

At 05:31 8/01/2009, you wrote:

>Hello:
>I am using Sweave to generate a PDF with figures and tables and was
>wondering if is possible to carry on table headers and some kind of
>caption like 'Continued' to the next PDF page when creating long tables.
>
>Felipe D. Carrillo
>Supervisory Fishery Biologist
>Department of the Interior
>US Fish & Wildlife Service
>California, USA
>
>______________________________________________
>[hidden email] mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: xtable-longtable question

Felipe Carrillo
Thanks Duncan, I'll try that with my data.

--- On Wed, 1/7/09, Duncan Mackay <[hidden email]> wrote:

> From: Duncan Mackay <[hidden email]>
> Subject: Re: [R] xtable-longtable question
> To: [hidden email]
> Cc: [hidden email]
> Date: Wednesday, January 7, 2009, 1:15 PM
> I use Sweave and longtable but have not used them together.
>
> It can be done but you may find the package booktabs
> helpful for headers
> and footers for longtable and tables
> as it allows you to put different first and last page
> headers to the rest.
> Something like (untested)
> PS You do not need to put \set longtables or something
> like that if you
> have the latest longtable package as it is no longer
> required
>
> % all table headers
> \toprule
> \addlinespace[3pt]
> \multicolumn{1}{c}{colname 1} & ...\\
> \midrule
> \addlinespace[3pt]
> \endhead
>
> % if want different first 1
> \toprule
> \addlinespace[3pt]
> \multicolumn{1}{c}{colname 1} & ...\\
> \midrule
> \addlinespace[3pt]
> \endfirsthead
>
> % last footer
> \bottomrule
> \endlastfoot
>
> % other footers
> \addlinespace[5pt]
> \multicolumn{3}{r}{Continued next page}\\
> \midrule
> \endfoot
>
> Regards
>
> Duncan Mackay
> Department of Agronomy and Soil Science
> University of New England
> ARMIDALE NSW 2351
> Email (home): [hidden email]
>
> At 05:31 8/01/2009, you wrote:
> >Hello:
> >I am using Sweave to generate a PDF with figures and
> tables and was
> >wondering if is possible to carry on table headers and
> some kind of
> >caption like 'Continued' to the next PDF page
> when creating long tables.
> >
> >Felipe D. Carrillo
> >Supervisory Fishery Biologist
> >Department of the Interior
> >US Fish & Wildlife Service
> >California, USA
> >
> >______________________________________________
> >[hidden email] mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained,
> reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.