> Hi everyone,
>
> I have the following table:
>
> \begin{longtable}{|l|c|c|c|c|c|c|c|c|}
> \hline
> Paleoflora&\rotatebox{90}{Steinmann (1922)}&\rotatebox{90}{Jaworski
> (1923)}&\rotatebox{90}{Tavera (1960)}&\rotatebox{90}{Campo II
> 2003}&\rotatebox{90}{Moisan (2004)}&\rotatebox{90}{Campo II
> 2004}&\rotatebox{90}{\centering Pérez (2005)}&\rotatebox{90}{Leppe
> (2005)}\\
> \hline \endhead
> \hline \endfoot
> \emph{Antevsia} sp.&&&&&&&&X\\
> \emph{Asterotheca fuchsi}&&&X&&X&X&&X\\
> \emph{Asterotheca rigbyana}&&&&X&X&X&&X\\
> \emph{Asterotheca} sp.&&&&&&X&&\\
> \emph{Baiera} sp.&&&X&&&&&\\
> \emph{Baiera africana}&&&&&&&&X\\
> .
> .
> .
> \end{longtable}
>
> And two questions:
> 1. How i can center vertically and horizontally the first cell of the
> table (Paleoflora)?
The horizontal bit is easy: use \multicolumn{1}{|c|}. The vertical is
much harder -- I'm not even sure it's possible to do in general (I'd love
to be proven wrong). It *is* possible to do this for one row, using a
dirty hack below.
> 2. How i can break the authors (Steinmann (1922)), so it looks like
> Steinman
> (1922)
> ?
This one is also easy: use \shortstack[c]{Steinmann\\(1922)}.
So, here's the promised dirty hack (actually, not too dirty, but will only
work for one row):
% In preamble
\makeatletter
\newlength{\HeaderHeight}\setlength\HeaderHeight{0pt}
\newlength{\HeaderHeightSave}
\newlength{\HeaderHeightTmp}
\AtBeginDocument{\global\setlength\HeaderHeightSave{\the\HeaderHeight}}
\def\AddToHeader#1{\settoheight{\HeaderHeightTmp}{#1}\ifdim\HeaderHeightTmp>\HeaderHeight\global\setlength\HeaderHeight\HeaderHeightTmp\typeout{Increased \string\HeaderHeight\ to \the\HeaderHeight}\fi\rotatebox{90}{\makebox[\HeaderHeight][c]{\rotatebox{-90}{#1}}}}
\AtEndDocument{\protected@write\@auxout{}{\string\global\string\setlength\string\HeaderHeight{\the\HeaderHeight}}\ifdim\HeaderHeight=\HeaderHeightSave\else\typeout{Row height has changed. Rerun LaTeX.}\fi}
\makeatother
% In document
\begin{longtable}{|l|c|c|c|c|c|c|c|c|}
\hline
\multicolumn{1}{|c|}{\AddToHeader{Paleoflora}}%
&\AddToHeader{\rotatebox{90}{\shortstack[c]{Steinmann\\(1922)}}}%
&\AddToHeader{\rotatebox{90}{\shortstack[c]{Jaworski\\(1923)}}}%
&\AddToHeader{\rotatebox{90}{\shortstack[c]{Tavera\\(1960)}}}%
&\AddToHeader{\rotatebox{90}{\shortstack[c]{Campo II\\2003}}}%
&\AddToHeader{\rotatebox{90}{\shortstack[c]{Moisan\\(2004)}}}%
&\AddToHeader{\rotatebox{90}{\shortstack[c]{Campo II\\2004}}}%
&\AddToHeader{\rotatebox{90}{\shortstack[c]{Prez\\(2005)}}}%
&\AddToHeader{\rotatebox{90}{\shortstack[c]{Leppe\\(2005)}}}\EndHeader\\
\hline \endhead
\hline \endfoot
\emph{Antevsia} sp.&&&&&&&&X\\
\emph{Asterotheca fuchsi}&&&X&&X&X&&X\\
\emph{Asterotheca rigbyana}&&&&X&X&X&&X\\
\emph{Asterotheca} sp.&&&&&&X&&\\
\emph{Baiera} sp.&&&X&&&&&\\
\emph{Baiera africana}&&&&&&&&X\\
\end{longtable}
HTH,
Igor
P.S. LaTeX gurus: comments on the above code are welcome.
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pech...@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ig...@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
> % In document
> [snip]
> &\AddToHeader{\rotatebox{90}{\shortstack[c]{Leppe\\(2005)}}}\EndHeader\\
^^^^^^^^^^
Ugh, this one slipped through. \EndHeader is an artifact of an earlier
attempt, and needs to be removed. Sorry.
Igor
I have found a different way to solve the problem (based on yours and a
hint found in LaTeX Tutorials, Indian TEX Users Group ):
% In preamble
\newcommand{\vertext}[1]{\multicolumn{1}{m{.8cm}|}{\centering\rotatebox{90}{\shortstack{#1}}}}
% In document
\begin{longtable}{|l|c|c|c|c|c|c|c|c|}
\hline
\multicolumn{1}{|c|}{Paleoflora}&\vertext{Steinmann\\(1922)}&\vertext{Jaworski\\(1923)}&\vertext{Tavera\\(1960)}&\vertext{Campo
II\\2003}&\vertext{Moisan\\(2004)}&\vertext{Campo
II\\2004}&\vertext{Pérez\\(2005)}&\vertext{Leppe\\(2005)}\\
\hline \endhead
\hline \endfoot
\emph{Antevsia }sp.&&&&&&&&X\\
\emph{Asterotheca fuchsi}&&&X&&X&X&&X\\
\emph{Asterotheca rigbyana}&&&&X&X&X&&X\\
\emph{Asterotheca }sp.&&&&&&X&&\\
\emph{Baiera }sp.&&&X&&&&&\\
\emph{Baiera africana}&&&&&&&&X\\
.
.
.
\end{longtable}
But this way doesn't auto adjust the columns widths as your solution.
In both solutions, the longest author name (Steinmann) touches the top
of the table. How to increase the distance from the name to the top of
the table?
Thanks very much,
Daniel Farfán Muñoz
easiest would be to make sure that the box that you rotate is bigger
than the word, eg
\newcommand{\vertext}[1]{\multicolumn{1}{m{.8cm}|}{\centering\rotatebox{90}=
{\shortstack{\mbox{ }#1\mbox{ }}}}}