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.

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

How can one create a diagonal separator in a table corner in ConTeXt (like the package slashbox for LaTeX)?

share|improve this question
up vote 3 down vote accepted

Here is a solution based on natural tables:

draw (0,OverlayHeight) -- (OverlayWidth,0);
clip currentpicture to OverlayBox; % otherwise the rule overlaps the table frame


\setupTABLE [1] [1] [background=DiagRule]

\bTR \bTD   \eTD   \bTD col   \eTD \eTR
\bTR \bTD row \eTD \bTD value \eTD \eTR

The nice thing about natural tables is that the background of a cell can be just about anything. In this case, I am using a simple metapost graphic that draws a diagonal line.

share|improve this answer
There is an anonymous edit suggestion for this answer which states to add clip currentpicture to OverlayBox; just before \stopuseMPgraphic because "otherwise the rule overlaps the table frame". Instead if approving it I add it here as comment so you can decide it for yourself. – Martin Scharrer Mar 2 '11 at 12:09
@martin: yes, that makes sense, will edit – Taco Hoekwater Mar 2 '11 at 12:24
thanks, that's nice. Is it possible to add headings to be separated by the diagonal too? Like having row\col in in top left table corner only. – urso Mar 3 '11 at 16:25

Your Answer


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.