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 would like to center the Available Expression, Very Busy Expression... Live Variables cells. The following code aligns the quoted cells only on the bottom of the cell itself: is there a way to center vertically even those cells? Thanks in advance.

\usepackage{bbm}
\usepackage[italian]{babel}
\usepackage[italian]{varioref}
\usepackage{rotating}
\usepackage{pgf,tikz}
\usepackage{etex}
\usepackage{tikz-cd}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{inputenx}
\usepackage{braket}
\usepackage[a4paper]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathabx}
\usepackage{examples}
\usepackage{multirow}
\newcommand{\spheading}[2][10em]{% \spheading[<width>]{<stuff>}\rotatebox{90}{\parbox{#1}{\raggedright #2}}}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}

  ......

  \begin{tabular}{c|M{20mm} M{30mm}}
      & forward ($flow$) & backward ($flow^R$)\\
    \midrule
    \spheading[4em]{must ($\cap$)} & Available Expression & Very Busy Expression\\
    \spheading[4em]{may ($\cap$)} & Reaching Definition & Live Variables\\
     \bottomrule
   \end{tabular}

enter image description here

share|improve this question
    
When you write $flow$, LaTeX typesets this as the quantities f, l, o and w all "multiplied together". You should use $\mathit{flow}$ and $\mathit{flow}^R$ instead. Also, one of your \caps should be a \cup. –  John Wickerson May 22 '13 at 14:42
    
It's better if you post a complete compilable .tex file, starting with \documentclass. Otherwise people trying to reproduce your problem have to guess which packages (e.g. booktabs) you've loaded. –  John Wickerson May 22 '13 at 14:55
    
Your're right. Thanks for the tip. –  jackb May 22 '13 at 14:56

1 Answer 1

up vote 3 down vote accepted

You can get a reasonable approximation by putting \raisebox{-1.5em}{...} around your \rotatebox.

Code

\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{graphicx}

\newcommand{\spheading}[2][10em]{% \spheading[<width>]{<stuff>}
\raisebox{-1.5em}{\rotatebox{90}{\parbox{#1}{\raggedright #2}}}}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}

\begin{document}
  \begin{tabular}{c|M{20mm} M{30mm}}
      & forward ($\mathit{flow}$) & backward ($\mathit{flow}^R$)\\
    \midrule
    \spheading[4em]{must ($\cap$)} & Available Expression & Very Busy Expression\\
    \spheading[4em]{may ($\cap$)} & Reaching Definition & Live Variables\\
     \bottomrule
   \end{tabular}
\end{document}

Output

enter image description here

share|improve this answer

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.