Quantcast
Channel: Putting a vertical line through text in a table - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Putting a vertical line through text in a table

$
0
0

I am trying to strike through both vertically and horizontally in a table when working horizontally most methods work as row heights are all the same, however, a vertical strikethrough always ends up diagonally using the method outlined below

The relevant code in preamble:

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}\newcommand{\DrawVLine}[3][]{%    \begin{tikzpicture}[overlay,remember picture]        \draw [#1] ($(#2.north)$) -- ($(#3.north)$);    \end{tikzpicture}%}%\newcommand{\DrawLine}[3][]{%    \begin{tikzpicture}[overlay,remember picture]        \draw [#1] ($(#2)+(-0.4,0.6ex)$) -- ($(#3)+(0.6,0.6ex)$);    \end{tikzpicture}%}%

Relevant array:

$\begin{array}{|c|c|c|c|}\hline&Dig&\tikzmark{StartB}Weed&Cut\\\hlineBoris&50&0&50\\\hlinePercival&20&0&30\\\hline\tikzmark{StartA}Spike&0&\tikzmark{EndB}0&\tikzmark{EndA}0\\\hline\end{array}\\$\DrawLine[red, very thick,dotted]{StartA}{EndA}\DrawVLine[red,very thick,dotted]{StartB}{EndB}

However this ends up like this:

enter image description here

What I want is to have the red line centred in the column and straight, it is possible to adjust this by adding values to 2.north and 3.north but this is seperate for each table, meaning it is not robust enough for my use.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images