I am trying to use diagbox in Beamer to create a north-east angled diagonal in a table cell using the tabular environment. It works in Beamer poster style but I can't get it to work for a standard Beamer presentation. So for example this code:

works in beamer poster but not in beamer. Am using MacTeX.

Does anyone know a fix for this?

 & \cellcolor{red} \textcolor{white}{A} & \cellcolor{red} \textcolor{white}{D}\\
 \cellcolor{red} \textcolor{white}{A} &  \diagbox[dir=NE,width=5em]{ {\tiny\(r((1,0),\omega (1,1),1,1)\)} }{ {\tiny \((0,0,0,1)\) } } & \diagbox[dir=NE,width=6em]{{\tiny\(r((1,0),\omega (1,0),1,0)\)} }{{\tiny \((0,0,0,1)\)}}\\
 \cellcolor{red}\textcolor{white}{D} & \diagbox[dir=NE,width=5em]{{\tiny\(r((1,0),\omega (0,1),0,1)\)} }{{\tiny (0,1/2,0,1/2)}}& \diagbox[dir=NE,width=6em]{{\tiny\(r((1,0),\omega(0,0),0,0)\)} }{{\tiny (0,1/2,0,1/2)}}\\

Beamer and beamerposter are different packages one loads xcolor itself the other one does not. I assume that you are loading the package xcolor with the table option (something like \usepackage[table]{xcolor}), when using beamerposter.

Beamer itself loads the xcolor package before that, which can cause trouble. So remove the \usepackage[table]{xcolor} line and add the documentclass option "tabel" which should look like \documentclass[table]{beamer}.

  • Thanks, you don't need the table option with beamerposter. The error arises on loading the diagbox package so in reading in \usepackage{diagbox}. I don't think the error is to do with xcolor as I still get the same error even when I remove all the colors. I will try adding the documentclass option table though and see what happens. Feb 25 '14 at 18:19
  • maybe you can post an example from \documentclass till \end{document}. That would help finding a solution.
    – jens_bo
    Feb 25 '14 at 18:23
  • I have worked it out thanks. The problem was a conflict between pict2e and diagbox. This is hinted at in the stackexchange discussion on a problem with \cancel and diagbox. Although my specific problem is not discussed there. The resolution is to place \RequirePackage{diagbox} before \documentclass{beamer} and not to call pict2e anywhere in the header as diagbox calls that anyway. The conflict disappears when you do this. This is not needed for beamerposter for some reason and is specific for beamer. Feb 25 '14 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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