2

I want to reproduce diagrams like the following in tikz (taken from Sider's Logic for Philosophy, p. 189):

enter image description here

In particular, I can't figure out how to stack symbols as they are in this image (having 1s and 0s above certain operators, and asterisks either above or below). I've tried stacking with \mathop and \overset but neither is producing the result I need. Here is my current code:

$$\mathop{\Diamond}_{*}^{1} \Box P \rightarrow \Box \Diamond P$$ % kind of squished together and doesn't work in tikz node environment

$$\overset{1}{\Diamond} \Box P \rightarrow \Box \Diamond P$$ \\% works in tikz node but squished together and no option to put something underneath


\begin{center}
\begin{tikzpicture}[>=stealth',shorten >=2pt,shorten <=2pt]

\node[rectangle,draw,minimum height=2cm] (1) [label=left:$a$] {$\Diamond  P \rightarrow \Box \Diamond P$};
\node[rectangle,draw,minimum height=2cm]  (2) [label=left:$b$, below left=of 1] {$\Box P$};
\node[rectangle,draw,minimum height=2cm] (3) [label=left:$c$, below right=of 1] {$\Diamond P$};

\path[->] (1) edge (2);
\path[->] (1) edge (3);

\end{tikzpicture}
\end{center}
2
  • 1
    See stackengine package. I think it should be straightforward. Nov 7, 2016 at 21:13
  • 2
    @StevenB.Segletes I'm shocked, just shocked that you would suggest that, Steven. :)
    – Alan Munn
    Nov 7, 2016 at 21:18

1 Answer 1

1

Stacking can be obtained with array.

\documentclass{article}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,arrows,positioning}

\newenvironment{LfPmatrix}
 {$\renewcommand{\arraystretch}{1.2}%
  \setlength{\arraycolsep}{0pt}%
  \begin{array}{*{7}{c}}}
 {\end{array}$}

\begin{document}

\begin{tikzpicture}[>=stealth',shorten >=2pt,shorten <=2pt]

\node[rectangle,draw,minimum height=1.5cm] (1) [label=left:r\strut] 
  {\begin{LfPmatrix}
    \mathtt{1}&&&\mathtt{0}&\mathtt{0}\\
    \Diamond&\Box&P&\to&\Box&\Diamond&P\\
    {*}&&&&{*}
   \end{LfPmatrix}};
\node[rectangle,draw,minimum height=1.5cm] (2) [label=left:a\strut, below left=of 1]
  {\begin{LfPmatrix}
    {*} \\
    \mathtt{1} \\
    \Box&P
   \end{LfPmatrix}};
\node[rectangle,draw,minimum height=1.5cm] (3) [label=left:b\strut, below right=of 1] 
  {\begin{LfPmatrix}
    {*} \\
    \mathtt{0} \\
    \Diamond P
   \end{LfPmatrix}};

\path[->] (1) edge (2);
\path[->] (1) edge (3);

\end{tikzpicture}

\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .