1

I'm trying to reproduce such tree:

enter image description here

I know that it was created with Latex, but since I'm a beginner, I really don't know where to start. Would it be possible to create something like that in TkiZ?

  • 2
    Your question leaves all the effort to our community, even typing the essentials of a TeX document such as \documentclass{}...\begin{document} etc. As it is, most of our users will be very reluctant to touch your question, and you are left to the mercy of our procrastination team who are very few in number and very picky about selecting questions. You can improve your question by adding a minimal working example (MWE) that more users can copy/paste onto their systems to work on. If no hero takes the challenge we might have to close your question. – Adam Liter Feb 18 '14 at 23:06
  • And welcome to TeX.SX! – Adam Liter Feb 18 '14 at 23:07
  • What type of tree is that? (I've not seen one like that before.) – cfr Feb 19 '14 at 1:49
  • Unfortunately, I don't know its name. It is mainly used for checking if formula is tautology. – solusipse Feb 19 '14 at 2:54
  • Oh, I see how it works. Weird. (That is, different and so looks-weird-to-me.) – cfr Feb 19 '14 at 3:33
5

One can produce this kind of diagram using TikZ; below, an option using a matrix of math nodes:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{matrix}

\newcommand\mynot{\mathord{\sim}}

\begin{document}

\begin{tikzpicture}
\matrix[
  matrix of math nodes,
  row sep=-\pgflinewidth,
  column sep=-\pgflinewidth,
  nodes={
    text width=5em,
    inner xsep=7pt,
    text depth=0.75ex,
    text height=2ex
  },
  nodes in empty cells,
  column 1/.style={align=left},
  column 2/.style={align=right},
  column 3/.style={align=left},
  column 4/.style={align=right},
] (mat)
{
& 1 & 0 & \\
& \alpha\to\beta & & \\
& \mynot\beta\to\mynot\gamma & & \\
& \gamma & & \\
& & \alpha & \\
& |[align=left]|\mynot\beta & |[align=right]|\mynot\gamma & C1 \\
& \text{NO} & & N1  \\
\alpha & \beta & & C1 \\
};

% some additional labels
\node[label={right:$\gamma$},anchor=south,yshift=3pt] at (mat-7-3.south east) {};
\node[label={below:$X$},anchor=north,yshift=8pt] at (mat-7-3.south east) {};
\node[label={left:$\beta$},anchor=south,yshift=3pt] at (mat-7-1.south east) {};

% tiny lines at the bottom
\foreach \Colu in {1,3}
{
\draw 
  ([xshift=-4pt]mat-8-\Colu.south west) --
  ([xshift=4pt]mat-8-\Colu.south west)
;
\draw 
  ([xshift=-4pt,yshift=-2pt]mat-8-\Colu.south west) --
  ([xshift=4pt,yshift=-2pt]mat-8-\Colu.south west)
;
}

% thick lines inside the matrix
\begin{scope}[ultra thick]
\draw
  (mat-2-2.north west) --
  (mat-2-3.north east)
;
\draw 
  (mat-1-2.north east) --
  (mat-6-2.north east) --
  (mat-6-1.north east) --
  (mat-7-1.south east) --
  (mat-7-1.south west) --
  (mat-8-1.south west)
  ;
\draw 
  (mat-7-1.south east) --
  (mat-7-3.south west) --
  (mat-8-3.south west)
  ;
\draw 
  (mat-6-2.north east) --
  (mat-6-3.north east) --
  (mat-7-3.south east)
  ;
\end{scope}
\end{tikzpicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.