Generalproblem with sideways columns

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
lnewton
Posts: 17
Joined: Mon Mar 31, 2008 3:01 pm

problem with sideways columns

Post by lnewton »

Also posted to comp.text.tex ...

have a table rendered in tabular environment, within table,
within landscape. It uses the makecell package to render column
headers sideways.

A complete working example, which I render with pdflatex, is
shown below. The content is confidential, so I've X'ed it out,
but otherwise, it is exactly as encountered within the document
from which it is taken. I opted to retain the full number of
columns and lines because every time I tried to condense it, I
horsed it up.

Code: Select all

\documentclass{book}
\usepackage{longtable,amssymb,rotating,makecell,lscape,array}

\newcommand{\colhead}[1]{\begin{sideways}\small{#1}\,\end{sideways}}
\newcommand{\colbreak}{\\}
\headheight 1in
\textheight 6.75in

\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcommand\yes{$\checkmark$} % a checkmark found in amssymb
\newcommand\ex{X}

\begin{document}
\begin{landscape}
\begin{table}
\begin{tabular}{|p{2.7in}C{4pt}|C{7pt}|C{16pt}|C{7pt}|C{7pt}|C{16pt}|
                   C{16pt}|C{7pt}|C{16pt}|C{16pt}|C{16pt}|C{7pt}|}
\hline
\textbf{Xxxxx xx Xxxx XX Xxxxxx} &
\colhead{\makecell[l]{\small \textbf{XXX 00000 Xxxxxxx Xxxx}}} &
\colhead{\makecell[l]{\small Xxxxxxxx Xxxxxx}} &
\colhead{\makecell[l]{\small Xxxxxxxxxxxx xx \colbreak xxxxxxxxxxx xxxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxx xxxxxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxx xxxxxxxxx xxxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxxxxx xxx\colbreak xxxxxxxxxxxxx xxxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxxxxxxxxxxx xxx\colbreak xxxxxxxxxx xxxxxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxxx xxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxxxxxxxx xxxxxxx xxxxxxxxxxx,\colbreak xxxxxxxxxxx xxx xxxxxxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxxxxxxxx xxxxxxxx\colbreak xxxxxxxx xxxxxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxxxxx xxxxxxxxxx\colbreak xxxxxxxxxx}} &
\colhead{\makecell[l]{\small Xxxxxxxxxx}}\\ \hline

\small{Xxxxxxxxxxx Xxxxxxxx Xxxxxxxxx (B.1)}                &&\ex&\ex&   &\ex&\ex&\ex&\ex&\ex&   &\ex&\ex\\ \hline
\small{Xxxxxxxx Xxxxxxxx (B.2)}                             &&   &   &   &   &   &\ex&\ex&   &   &   &   \\ \hline
\small{Xxxxxxxx \& Xxx Xxxxxxxx (B.3)}                      &&   &   &   &\ex&   &   &\ex&   &   &   &   \\ \hline
\small{Xxxxxxxxx Xxxx Xxxxxxxx (B.4)}                       &&   &   &   &   &   &\ex&   &   &   &   &   \\ \hline
\small{Xxxxxx Xxxxxx Xxxxxxxx (B.5)}                        &&   &\ex&   &\ex&   &\ex&\ex&\ex&   &   &   \\ \hline
\small{Xxxxxxxx Xxxxxxxx (B.6)}                             &&   &\ex&   &\ex&   &\ex&\ex&\ex&\ex&   &   \\ \hline
\small{Xxxxxxxx Xxxxxxxx Xxxxxxxx (B.7)}                    &&   &   &   &\ex&   &\ex&   &\ex&\ex&\ex&   \\ \hline
\small{Xxxxxxxx Xxxxxxxxx \& Xxxxxxxxx (B.8)}               &&   &\ex&   &\ex&   &   &   &   &   &   &\ex\\ \hline
\small{Xxxxxxxx Xxxxxxxxx Xxxxxxxx (B.9)}                   &&   &\ex&\ex&\ex&\ex&\ex&\ex&\ex&\ex&   &\ex\\ \hline
\small{Xxxxxxxx Xxxxxxxxxxxxx (B.10)}                       &&   &   &   &\ex&   &   &   &   &\ex&   &\ex\\ \hline
\small{Xxxx Xxxxxxxxxxxxxx (B.11)}                          &&   &   &\ex&\ex&   &\ex&\ex&   &   &   &\ex\\ \hline
\small{Xxxxxxxxx Xxxxxxxxxx xxx Xxxxxxxxx  (B.12)}          &&   &   &   &\ex&   &\ex&   &\ex&\ex&   &\ex\\ \hline
\small{Xxxxxxxx, Xxxxxxxxx \& Xxxxxxxx xx XX Xxxxxx. (E.1)} &&   &   &   &   &\ex&   &   &   &   &   &   \\ \hline
\small{Xxxxxxxx Xxxxxxxxxx Xxxxxxxx (E.7)}                  &&   &   &   &   &   &   &   &   &   &\ex&   \\ \hline
\small{Xxx xx Xxxxxxxx, X-xxxx \& Xxxxx XX Xxxxxxxxx (E.8)} &&\ex&   &\ex&\ex&   &   &   &\ex&   &   &\ex\\ \hline
\small{Xxxxxxxxxx Xxxxxxx (E.30)}                           &&   &   &   &\ex&   &\ex&   &\ex&   &   &\ex\\ \hline
\end{tabular}
\caption{Xxxxx XX Xxxxxx Xxxxxxxx xx XXX-XXXXX Xxxxxxx XXXXX}
\end{table}
\end{landscape}

\end{document}
The problem is that if a reader thumbs through normally, holding
the document in portrait orientation, and encounters this page,
initially the sideways column headers are upside down to his
view. It's true that when he rotates the page they are then
viewable if he cocks his head to the left again, but this looks
quite wrong and silly.

What I really desire is to rotate those column headers 180
degrees, and push them over (down), perhaps with an \hfill, so
the butt ends instead of the first letters appear along the
header line, and when viewing the page in normal portrait view
the column headers are readable.

I may have overexplained this, but if you look at the example (I
use pdflatex to render), you'll see what I mean.

I'm surmise there must be an argument to sideways I have not
figured out as yet.

Can anyone help with this? Thank you much.
Lynn

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply