tags:

views:

492

answers:

2

Is it possible to draw diagonal (parallelogram) cells in LaTeX: the cell content is diagonal, and the cell's originally vertical borders are also diagonal.

Here is what I managed to do using the rotating package:

\begin{tabular}{|r|c|c|}
\hline
\\ \\ \\ \\ \\ \\ \\ \\ \\ \\
 & \begin{rotate}{45}Trying to save some horizontal space\end{rotate} & \begin{rotate}{45}While keeping headers readable\end{rotate} \\
\hline
this & is & a \\
\hline
sample & latex & table \\
\hline
\end{tabular}

Here is a screenshot of the output vs what is possible using excel:

LaTeX vs. Excel screenshots

Thanks.

A: 

Sometimes the easiest solution is to insert a picture created by another program (in this case Excel).

mathmike
In my case , it is not an important document, so I prefer sacrifying some readability for the sake of simplicity. I simply put the rotation at 90°.Sure, TeX is capable of drawing sideways borders, I am just totally ignorant of TeX language to hope to implement this feature.
Amyn Bennamane
Inserting pictures is much more reasonable for graphics than for something like this. With a table, there are at least two significant issues: formatting won't match, and you can't use math mode.
Jefromi
+1  A: 

I suspect that PGF-TiKZ can probably do what you want, but it's beyond my abilities to give you any help with that.

High Performance Mark
Thank you, I will look at that.
Amyn Bennamane