2

How can I write down that line from horizontal, then vertical and with an arrow pointing at argument 2?

conditional proof

mao2047
  • 33
  • 4

3 Answers3

9

For an explanation of the \tikznode command see my answer to "How to add arrow in equations and matrix?".

enter image description here

\documentclass{article}
\usepackage{amssymb}% defines \therefore
\let\impl\supset
\usepackage{tikz}
\newcommand\tikznode[3][]{%
  \tikz[remember picture,baseline=(#2.base)]
      \node[minimum size=0pt,inner sep=0pt,#1](#2){#3};%
}
\begin{document}
\begin{center}
  \begin{tabular}{rll}
              1.  & $A\impl B$ \rlap{\quad$/\therefore A\impl (A\cdot B)$}\\
 \tikznode{A}{2.} & $A$                & supuesto \\
              3.  & $B$                & $1$, $2$, M.P.\\
              4.  & $A\cdot B$                        & $2$, $3$, Conj.\\
              5.  & \tikznode{B}{$A\impl(A\cdot B)$\strut} & $2$--$4$, C.P.
   \end{tabular}
\end{center}
\begin{tikzpicture}[remember picture,overlay]
  \draw[stealth-,shorten <=2pt] (A) -- ++(-1.5em,0) |- (B.north east);
\end{tikzpicture}
\end{document}
gernot
  • 49,614
  • Absolutely right! This is pretty much what I needed.Thank you so much! – mao2047 Feb 03 '21 at 18:35
  • 1
    @gernot, your answer is more than excellent. However, in the picture that mao2047 has included (and in general all examples of this style of expressing conditional proofs), the (horizontal) part of the arrow shaft extends from the left margin to just above the end of the following line's assertion (in this case, the ) of line 5 ( \A\impl(A\cdot B)\ ). Is there a way to do this, if not automatically, then at least without guessing and doing quick and dirty trial-and-error? (Please let me know if my comment doesn't make sense.) – Noah J Jun 16 '23 at 11:26
  • 1
    @NoahJ You are right, this horizontal line is too short. See my adapted solution. I switched to a tabular environment, as this makes the code a bit simpler, but you can also use an array, but then may need \text from the mathtools package. – gernot Jun 16 '23 at 17:10
  • @gernot I just wrote some macro definitions that, while using basically your solution, simplify what the writer must input, but they're too lengthy for me to include all of them here. For example:

    \newcounter{lineno} % as in ``line number'' \newcommand{\copiproof}[1]{\begin{center}\begin{tabular}{rll}\setcounter{lineno}{0}#1\end{tabular}\end{center}} % after Irving Copi \newcommand{\premise}[1]{\addtocounter{lineno}{1}\thelineno. & $#1$\\}

    Do I have your permission to write a Q&A style question so that I can give all of the definitions, if I credit you?

    – Noah J Jun 18 '23 at 16:29
  • @NoahJ This is all open, use it as you like, with or without credits. – gernot Jun 19 '23 at 07:27
5

Another solution, based on an enumerate environment, the eqparbox package and pstricks:

\documentclass[svgnames]{article}
\usepackage{mathtools,amssymb}
\usepackage{pst-node}
\usepackage{enumitem}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{%
\eqmakebox[#1][l]{$\displaystyle#2$}}

\begin{document}

\begin{enumerate}[wide =2em, labelsep=1em, nosep]
\item $A\supset B \quad/\therefore A\supset(A\cdot B)$
\item\pnode[-2em, 0.8ex]{2} \eqmathbox{E} supuesto
\item \eqmathbox{B} 1, 2, M. P.
\item \eqmathbox{A\cdot B} 2, 3, Conj.
\item \eqmathbox{A\supset (A\cdot B)\pnode[-0.75ex, 2.2ex]{A}\quad} 2–4, C. P.
\ncbar[linecolor=LightSlateGray, linejoin=1, arrows=-&gt;, arrowinset=0.12, angle=180]{A}{2}
\end{enumerate}

\end{document}

enter image description here

Bernard
  • 271,350
0
\documentclass{article}
\usepackage{amssymb} % for \therefore
\usepackage{nicematrix,tikz}
\usetikzlibrary{arrows.meta,ext.paths.ortho} % for "r-lr"

\begin{document}

\begin{NiceTabular}{rll}
  1.  & $A\supset B$ \rlap{\quad$/\therefore A\supset (A\cdot B)$}\\
  2.  & $A$                  & supuesto \\
  3.  & $B$                  & $1$, $2$, M.P.\\
  4.  & $A\cdot B$               & $2$, $3$, Conj.\\
  5.  & $A\supset(A\cdot B)$     & $2$--$4$, C.P.
\CodeAfter \tikz \draw [<-,shorten < = 2pt] (2-1) r-lr ([yshift=1pt]5-|3);
\end{NiceTabular}

\end{document}

Output of the above code

F. Pantigny
  • 40,250