我提供以下关于模态逻辑语义表构建的 MWE。
\documentclass[a4paper,twoside,10pt]{memoir}
\usepackage{alphabeta}
\usepackage {tikz}
\usepackage {forest}
\usetikzlibrary {positioning,graphs}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{mathtools}
\begin{document}
\begin{forest}
[$F(\Box A\wedge\Box B)\rightarrow\Box(A\wedge B)$, name=root, tikz={\node [draw,red,fit=(!1)(!ll)] {};}
[ $T(\Box A\wedge\Box B)$, name=nodeA [ $F\:\Box(A\wedge B)$, name=nodeB, tikz={\node [draw,red,fit=(!1)(!ll)] {};}
[ $T\Box A$, name=nodeC [ $T\:\Box B$, name=nodeD [ $F(A\wedge B)$, name=nodeE
[ $FA$, rectangle, draw [ $TA$, rectangle, draw, name=nodeF [ $\otimes$ ] ] ]
[ $FB$, rectangle, draw [ $TB$, rectangle, draw, name=nodeG [ $\otimes$ ] ] ] ] ] ] ] ] ]
\draw[->] (nodeA) to [out=west, in=west] (nodeC);
\draw[->] (nodeB) to [out=east, in=east] (nodeE);
\end{forest}
\end{document}
我需要改进箭头的绘制..主要问题是使用第二个矩形中封闭的节点作为单个(虚拟)节点,并绘制左箭头的尖端(即末端)(从第二个节点开始),在第二个矩形左侧垂直边的中间...如果箭头不与矩形的边界相交,那就太好了(但这是一个次要的、不太重要的问题)。
答案1
我不知道该如何理解你的问题,所以我用蓝色添加了第二种可能的解释,希望其中一个是你想要的。
\documentclass[a4paper,twoside,10pt]{memoir}
\usepackage{alphabeta}
\usepackage {tikz}
\usepackage {forest}
\usetikzlibrary {positioning,graphs}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{mathtools}
\begin{document}
\begin{forest}
[$F(\Box A\wedge\Box B)\rightarrow\Box(A\wedge B)$, name=root,
[ $T(\Box A\wedge\Box B)$, name=nodeA [ $F\:\Box(A\wedge B)$, name=nodeB,
[ $T\Box A$, name=nodeC [ $T\:\Box B$, name=nodeD [ $F(A\wedge B)$,
name=nodeE
[ $FA$, rectangle, draw [ $TA$, rectangle, draw, name=nodeF [ $\otimes$ ] ] ]
[ $FB$, rectangle, draw [ $TB$, rectangle, draw, name=nodeG [ $\otimes$ ] ] ] ] ] ] ] ] ]
\node [draw,red,fit=(nodeA)(nodeB)] (fit1) {};
\node [draw,red,fit=(nodeC)(nodeD)] (fit2) {};
\draw[->] (nodeA-|fit1.west) to [out=west, in=west] (nodeC-|fit2.west);
\draw[->] (nodeB-|fit1.east) to [out=east, in=east] (nodeE);
\draw[->,blue] (fit1.west) to [out=west, in=west] (fit2.west);
\draw[->,blue] (fit1.east) to [out=east, in=east] (nodeE);
\end{forest}
\end{document}