Splitting a cell diagonally

If we need a header for the first column but also for the entries of the first row, the top-left cell can be split to contain both header entries, separated by a diagonal line.

How to do it...

We will use the slashbox package. It is part of MiKTeX, but not of TeX Live. Users of TeX Live can download it from CTAN at http://ctan.org/pkg/slashbox.

In this recipe, we will build a time table. It's intended to be filled out by hand later, so we willuse vertical lines for delimiting fields. Follow these steps:

  1. Use any document class. Here, we simply use the article class:
    \documentclass{article}
  2. Load the slashbox package:
    \usepackage{slashbox}
  3. Within the document body, create the tabular layout:
    \begin{document} \renewcommand{\arraystretch}{1.8} ...

Get LaTeX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.