# Making Argument Diagrams in LaTex

I am trying to do my homework for Logic lesson in LaTex and I need to make Argument Diagrams. I have no idea how to make these in LaTex. All I think is doing it manually with TikzImage.

Below are some examples for Argument Diagrams. (From our textbook “Schaum’s outline Logic 2nd Edition”)

After searching on the internet I saw people doing Argument Diagrams with tikzcd. This is an example of something I did by copying other people's work.

        \begin{center}
\begin{tikzcd}[row sep=1.5em,column sep=0.3em]
{1} \arrow{d} \& {} \& {} \& {} \& {} \& {} \& {}  \\
{2} \& {+} \& {3} \& {+}\arrow{d} \& {4} \& {+} \& {5}  \\
{} \& {} \& {} \& {6} \& {} \& {} \& {}  \\
\end{tikzcd}
\end{center}


And here is the image of the output:

However, I want to add a horizontal line under the second row.

I couldn’t find any way to do it. Are you guys familiar with how to do such a thing?

• Welcome to TeX.SE! Commented Oct 10, 2021 at 13:23
• Isn’t it the purpose of homework to do them yourself? What you try so far? Where you stuck in your efforts? Commented Oct 10, 2021 at 13:30
• I don't think you really need TikZ to do that but it can be done with it, with simple nodes and edges. Come back with a minimal working example (MWE) showing what you tried. Commented Oct 10, 2021 at 13:37
• @Zarko Actually my purpose for my homework is to do my diagrams not to do LaTex. I also could make these pdf’s by handwriting and scanning the diagrams, however, since I am trying to learn LaTex I wanted to make a fresh start by trying to do homeworks via LaTex. Commented Oct 10, 2021 at 14:46
• Hi, just try to check so key words in Google : tikz arrows "tikz tree with arrows" and so on and You will find Your solution be shure Commented Oct 10, 2021 at 15:01

Maybe this is what you like:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{center}
\begin{tikzcd}[every matrix/.append style={name=mymatr},row sep=1.5em,column sep=0.3em, ampersand replacement=\&, execute at end picture={\draw (mymatr-2-1.south west) -- (mymatr-2-7.south east);}]
{1} \arrow{d} \& {} \& {} \& {} \& {} \& {} \& {}  \\
{2} \& {+} \& {3} \& {+}\arrow{d} \& {4} \& {+} \& {5}  \\
{} \& {} \& {} \& {6} \& {} \& {} \& {}  \\
\end{tikzcd}
\end{center}
\end{document}


One possibilities is use of pure tikz.

For starting point may serve this (no very simple) example:

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
positioning,
shapes.multipart,
}
\newcommand\ppbb{path picture bounding box}

\begin{document}
\begin{tikzpicture}[
node distance = 5mm and 0mm,
arr/.style = {-{Straight Barb[scale=0.8]}, semithick},
HMPN/.style args = {#1/#2}{%
rectangle split, rectangle split parts=3,
rectangle split horizontal,
inner ysep=1pt, outer ysep=1pt,
node contents={#1\nodepart{two}\kern-1.4pt+\kern-1.4pt\nodepart{three}#2},
path picture={\draw (\ppbb.south west) -- (\ppbb.south east);}},
]
\node (a) [HMPN=3/4];   % 3 + 4
\node (b) [HMPN=1/2, below left = of a.two split south]; % 1 + 2
\draw[arr] (a.south) -- (b.three north);
\node (c) [below=of b] {5};
\draw[arr] (b) -- (c);
\end{tikzpicture}
\end{document}


Hello after searching in the internet I saw people doing Argument Diagrams with tikzcd. This is example of something I did by copying other peoples work.

        \begin{center}
\begin{tikzcd}[row sep=1.5em,column sep=0.3em]
{1} \arrow{d} \& {} \& {} \& {} \& {} \& {} \& {}  \\
{2} \& {+} \& {3} \& {+}\arrow{d} \& {4} \& {+} \& {5}  \\
{} \& {} \& {} \& {6} \& {} \& {} \& {}  \\
\end{tikzcd}
\end{center}


And here is the image of the output:

However I want to add a horizontal line under second row.

I couldn’t find anyway to do it. Are you guys familiar with how to do such a thing.

Thanks

• Bravo! Better and simpler than mine solution! +1 Commented Oct 10, 2021 at 21:12
• @Zarko but this is not an answer... Commented Oct 10, 2021 at 21:22
• @Atahan I answered starting from this post, please look at my answer. Commented Oct 10, 2021 at 21:36
• @CarLaTex, it is written as answer. It is good one and can be accepted as such (regardless that is copy of some solution, as OP said) :-) Commented Oct 10, 2021 at 22:13
• @Zarko No, read it all, it is a question Commented Oct 10, 2021 at 22:15