It is common in literature to encounter the diagonal symbol when referring to matrices. For instance, if matrix A is diagonal, it can be denoted as [\A] where the "\" symbol is crossing the letter "A" from the upper left to the lower right corner.
Is there any way to do this in LaTeX (maybe by the use of any particular package)?
An example of what I am intending to do can be seen on the picture below.
Best Answer
Here's one option using the
tikzmark
library to define a command (using the optional argument one can control the vertical size):The code:
The code needs two or three runs for the rule to reach its final position.