# How to build a logical argument like this?

How to build a logical argument like this?

with the color line

A simple array will do:

\documentclass{article}

\usepackage{amsmath,amssymb}

\begin{document}

$\begin{array}{ r l } & p \rightarrow q \\ & p \\ \cline{2-2} \therefore & q \end{array}$

\end{document}


If you want a coloured rule, add colortbl to your preamble and use:

$\begin{array}{ r l } & p \rightarrow q \\ & p \\ \arrayrulecolor{red}\cline{2-2} \therefore & q \end{array}$


Rule widths in an array can be adjusted using \setlength{\arrayrulewidth}{<len>}. The default is .4pt.

• Thank you very much for your help. Can you tell me how to increase the thickness of the line? – Carlos Feliz Oct 21 '18 at 2:12
• To change the thickness you can use \setlength{\arrayrulewidth}{0.75pt} . . . for example. – corporal Oct 21 '18 at 2:57 Depending on how much extension you want on the line...two ways are shown. The thickness of the rule is determined by the value of \fboxrule. \documentclass{article} \usepackage{amssymb} \usepackage[TABcline]{tabstackengine} \TABstackMath \begin{document} \[ \alignShortstack{ & p \rightarrow q\\ & p\\ \TABcline{2} \therefore & q }
$\fboxrule=1pt \setstacktabbedgap{1.5ex} \tabbedShortstack[l]{ & p \rightarrow q&\\ & p&\\ \TABcline{2} \therefore & q& }$
\end{document}


As this question is tagged tikz-pgf, I also try to give an answer based on TikZ.

\documentclass[fleqn]{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\begin{document}
$\begin{tikzpicture} \matrix[matrix of math nodes,nodes in empty cells] (mat) {& p & \to & q\\ & p & & \\ \therefore & q & & \\ }; \draw[red,line width=1pt] ((mat-2-2.south west)!0.5!(mat-3-2.north west)) coordinate (aux) -- (aux-|mat.east); \end{tikzpicture}$
\end{document}


It is true that this very diagram can be done also with other, arguably more basic packages. On the other hand, at the very moment you wish to do some more fancy things, it is quite possible that you will appreciate the countless features offered by TikZ.

If you have also commutative diagrams in your document, you may want to use tikz-cd anyway, in which case you could simply do

\documentclass[fleqn]{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz-cd}
\usetikzlibrary{matrix,calc}
\begin{document}
$\begin{tikzcd}[remember picture,row sep=3pt,column sep=1pt] & p \arrow[rr]& ~ & q\\ & p & & \\ \therefore & q & & \\ \end{tikzcd} \tikz[remember picture,overlay]{ \draw[red,line width=1pt] ((\tikzcdmatrixname-2-2.south west)!0.5!(\tikzcdmatrixname-3-2.north west)) coordinate (aux) -- (aux-|\tikzcdmatrixname.east); }$
\end{document}