Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using makecell package to write vertical text to my table cells. It works fine, but I have trouble centering it. Normal vertical text (within a {tabular}) is displayed as:

    \rothead{Some lenghthy\\ sentence} 

Using

    \rothead[c]{Some lenghthy\\ sentence} 

does center it, but adds a @ to the end ??

I'm not good at tex macros, this is the definition:

% \begin{macro}{\rothead}
% The macro for rotated tabular column heads. If no \package{rotating} package
% loaded this macro works like |\thead|.
%    \begin{macrocode}
\newcommand\rothead{\@ifundefined{turn}%
  {\PackageWarning{makecell}{\string\rothead\space
    needs rotating package}%
   \let\tabg@pe\theadgape
   \def\t@bset{\cellset\theadfont\theadset}\thead@}%
  {\let\theadgape\rotheadgape
   \@ifnextchar[{\@rothead}{\@@rothead}}}
%    \end{macrocode}
% For rotated column head default column setting is similar to
% |p{\rotheadsize}| (plus some additional justification settings)
%    \begin{macrocode}
\@ifdefinable\@rothead{}
\def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\thead[#1]{#2@{}}\endturn}}
\newcommand\@@rothead[1]{\thead{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\thead[c{>{\rightskip0explus
    \rotheadsize\hyphenpenalty0\pretolerance-1%
    \noindent\hskip\z@}p{\rotheadsize}
    @{}}]{#1}\endturn}}
%    \end{macrocode}
% \end{macro}

Can anyone explain please? I'd really like to center my vertical column headers :(

share|improve this question
2  
Just a comment about how you posed your question. It would be simpler if you had posted a small example document that showed the problem (e.g. a full document that loaded just the makecell and rotating packages, plus a single small table with the relevant \rothead command.) The code you added (which is from the makecell package was the right code to diagnose the problem, though.) –  Alan Munn Jan 3 '11 at 2:20

1 Answer 1

up vote 3 down vote accepted

This looks like a bug in the package, so you should contact the author about it. But as a temporary fix, it looks like you can just add the following to your preamble. (Lightly tested.)

\makeatletter
\def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\thead[#1]{#2}\endturn}}
\makeatother

This removes the offending '@' and doesn't seem to have any other ill effects.

share|improve this answer
    
@Marin: Thanks for accepting the answer. Since you've accepted it, it makes sense to up-vote it too. –  Alan Munn Jan 6 '11 at 18:18
    
can't vote up yet, i have only 8 points :) i'll vote it when i get the points –  Marin Jan 7 '11 at 17:04
    
@Marin Ah, I forgot about that. Thanks. In lieu of that, adding a comment to say that it solved your problem would probably help too. –  Alan Munn Jan 7 '11 at 21:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.