-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-underbrace.tex
144 lines (130 loc) · 3.48 KB
/
demo-underbrace.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
% A test file for the module "underbrace2d.lua" of dednat6.
% This file: http://angg.twu.net/dednat6/demo-underbrace.tex.html
% http://angg.twu.net/dednat6/demo-underbrace.tex
% (find-dednat6 "demo-underbrace.tex")
% Output: http://angg.twu.net/dednat6/demo-underbrace.pdf
%
% (defun c () (interactive) (find-dednat6sh "lualatex -record demo-underbrace.tex"))
% (defun d () (interactive) (find-pdf-page "~/dednat6/demo-underbrace.pdf"))
% (defun e () (interactive) (find-dednat6 "demo-underbrace.tex"))
% (defun u () (interactive) (find-latex-upload-links "demo-underbrace"))
% (find-pdf-page "~/dednat6/demo-underbrace.pdf")
% http://angg.twu.net/dednat6/demo-underbrace.pdf
%
% (find-LATEXgrep "grep --color -nH --null -e '%R' 2017planar-has-1.tex")
%
\documentclass[oneside]{article}
%
% Not needed:
% \usepackage{proof} % For derivation trees ("%:" lines)
% \input diagxy % For 2D diagrams ("%D" lines)
% \xyoption{curve} % For the ".curve=" feature in 2D diagrams
%
\usepackage{amsfonts}
\catcode`¬=13 \def¬{\neg}
\catcode`∧=13 \def∧{\land}
\catcode`∨=13 \def∨{\lor}
\catcode`→=13 \def→{\to}
\catcode`◻=13 \def◻{\Box}
\catcode`□=13 \def□{\Box}
%
\def\ttchar#1{\setbox0=\hbox{\texttt{a}}\leavevmode\hbox to \wd0{\hss#1\hss}}
\def\basicttchars{
\def¬{\ttchar{$\neg$}}
\def→{\ttchar{$\to$}}
\def∧{\ttchar{$\land$}}
\def∨{\ttchar{$\lor$}}
\def◻{\ttchar{$\Box$}}
}
%
\begin{document}
\catcode`\^^J=10 % (find-es "luatex" "spurious-omega")
\directlua{dofile "dednat6load.lua"} % (find-dednat6 "dednat6load.lua")
\title{Dednat6: a demo for underbrace2d.lua}
\author{Eduardo Ochs}
\maketitle
% From: (find-LATEX "2017planar-has-defs.tex" "defub")
%
\def\defub#1#2{\expandafter\def\csname ub-#1\endcsname{#2}}
\def\ifubundefined#1{\expandafter\ifx\csname ub-#1\endcsname\relax}
\def\ub#1{\ifubundefined{#1}
\errmessage{UNDEFINED UB: #1}
\else
\csname ub-#1\endcsname
\fi
}
\def\und#1#2{\underbrace{#1}_{#2}}
Output:
% From: (find-LATEX "2017planar-has-1.tex" "prop-calc-ZHA")
% (find-LATEX "2017planar-has-1.tex" "prop-calc-ZHA" "defub")
%
%UB (¬ ¬ P) → P
%UB -- --
%UB 10 10
%UB ---
%UB 02
%UB -----
%UB 20
%UB -----------
%UB 12
%L
%L defub "notnotP"
%
%UB ¬(P ∧ Q) → (¬ P ∨ ¬ Q)
%UB -- -- -- --
%UB 10 01 10 01
%UB ----- --- ---
%UB 00 02 20
%UB ------- ---------
%UB 32 22
%UB ----------------------
%UB 22
%L
%L defub "demorgan"
%
$$\pu
\ub{notnotP}
\qquad
\ub{demorgan}
$$
%UB ¬( P ∧ Q) → (¬ P ∨ ¬ Q)
%UB -- -- -- --
%UB ◻P ◻Q ◻P ◻Q
%UB ------- ---- ----
%UB ◻P ∧ ◻Q ◻¬◻P ◻¬◻Q
%UB ---------- ------------
%UB ◻¬(◻P∧◻Q) ◻¬◻P ∨ ◻¬◻Q
%UB ---------------------------
%UB ◻((◻¬(◻P∧◻Q))→(◻¬◻P∨◻¬◻Q))
%L
%L defub "T-demorgan"
%
$$\pu
T(\ub{T-demorgan})
$$
\bigskip
Source (for the upper right diagram):
{
\basicttchars
\begin{verbatim}
%UB ¬(P ∧ Q) → (¬ P ∨ ¬ Q)
%UB -- -- -- --
%UB 10 01 10 01
%UB ----- --- ---
%UB 00 02 20
%UB ------- ---------
%UB 32 22
%UB ----------------------
%UB 22
%L
%L defub "demorgan"
%
$$\pu
\ub{demorgan}
$$
\end{verbatim}
}
\end{document}
% Local Variables:
% coding: utf-8-unix
% End: