I am trying to set the vertical height of a row which uses diagbox to be smaller, but past techniques such as \setarstrut and cellspace appear to not be working thus far. In particular, I am able to almost create the table exactly as sought, but the the row with the diagonal is too tall. How exactly can one set this particular row to be a constant height (e.g. to match the height of the other rows)?
The environement NiceTabular of nicematrix has a built-in command \diagbox which gives directly the expected output. Moreover, you have a key hvlines which draws all the rules excepted in the blocks.
However, nicematrix package have the issue of being unable to adjust it's own version of diagbox command such that one can't bold the text using \textbf in the diagbox and also can't do \raisebox command to position the text in the diagbox nicely.
When using cancel package to cross out something and the package diagbox is also loaded the line does not appear in the proper location. When diagbox is not loaded everything works ok. However, I need to load that package to use it with some cells in tables.
The diagbox package internally loads pict2e which does some redefinitions that cause the problem with cancel; to prevent the redefinitions made by pict2e, load the pict2e package with the original option before diagbox:
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:
Here are two versions of your table. In the first one, I have removed the empty line as well as the \multirow commands. This will improve the diagbox output. However, there will still be small white spaces around the intersections as the horizontal lines from the booktabs package are desigend to be used without vertical lines.
You can use NiceTabular of nicematrix which a built-in \diagbox command which draws the rule with Tikz. However, we will have the problem of the small vertical rule. You can draw it with Tikz using the PGF/Tikz nodes created under the tabular by nicematrix.
With spread the table have natural width, so to make its width equal to \textwidth a manual tweaking is needed. In above MWE \tabcolsep is reduced by "trial and errormethod, the same I did with font size and width of\diagbox`.
Since you use an arraystretch of 1.5 for your table, you will have to change the height of the diagbox from 3\line to 4.5\line. However, you will notice the small gap between the diagonal horizontal line as well as between the vertical and the horizontal lines. This is due to the usage of the horizontal lines from the booktabs package that are incompatible with vertical lines.
I propose to make the last rotated header two-lined. This is possible with the \rothead and \rotcell commands from makecell * also use the keys height= and width= from diagbox. The width is set with the help of te eqparbox package, with eqboxwidth length. Finally I replaced your \tabred command with changing the value off \tabcolsep.
The error is caused by the original option in the \documentclass and the \usepackage[original]pict2e. Leave these out and it probably works. You can even leave out the whole \usepackagepict2e because it is loaded by diagbox.
aa06259810