TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Tables of numbers

Is it possible to put a "x\y" style legend in one cell (maybe be made up of several cells) of a table? It would be great to make the 'x' slightly lower while the 'y' slight higher.

Please see the picture below for illustration:


Thank you very much.

share|improve this question

marked as duplicate by Caramdir, lockstep, Joseph Wright Feb 22 '11 at 8:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Welcome to tex.sx! Note that it is unusual around here to sign your questions (as there is already a box with your username below it) or to have any greeting. A suggestion: Change your username to something more telling than "user2015". – lockstep Feb 22 '11 at 0:35
Have a look at tex.stackexchange.com/questions/7262/tables-of-numbers, tex.stackexchange.com/questions/9275/… and tex.stackexchange.com/questions/9253/slashbox-alternative. Maybe one of the solutions to these questions is applicable to your case. – Caramdir Feb 22 '11 at 1:29
Thanks for the suggestions, @lockstep:) – Li Wang Feb 22 '11 at 4:44
tex.stackexchange.com/questions/7262/tables-of-numbers provides a perfect solution --- i.e. \backslashbox in slashbox package. Thank you very much @Caramdir. – Li Wang Feb 22 '11 at 4:47
up vote 6 down vote accepted

AFAIK, there are two packages for this purpose. One is my diagbox (replacement of old slashbox). The other is makecell. Here is an example of \diaghead in makecell:



\theadfont\diagbox[width=11em]{Diag\\Column Head I}{Diag Column\\Head II}&
\thead{Second\\column}&\thead{Third\\column}\\    \hline
& foo & bar \\    \hline


\diaghead{\theadfont Diag ColumnmnHead II}%
{Diag\\Column Head I}{Diag Column\\Head II}&
\thead{Second\\column}&\thead{Third\\column}\\    \hline
& foo & bar \\    \hline

enter image description here

share|improve this answer
maybe you could add the makecell answer to the duplicate question, so that we have all solutions in one place. – Caramdir Feb 23 '11 at 0:23
@Caramdir: Yes. But which one should I answer? I've no good idea. – Leo Liu Feb 23 '11 at 4:17
Ok, I add this answer to tex.stackexchange.com/questions/9253/slashbox-alternative – Leo Liu Feb 23 '11 at 4:22
This also works:) Thank you very much!! – Li Wang Mar 10 '11 at 7:09

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