-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-minimal.tex
121 lines (110 loc) · 3.8 KB
/
demo-minimal.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
% A minimal test file for Dednat6.
% This file: http://angg.twu.net/dednat6/demo-minimal.tex.html
% http://angg.twu.net/dednat6/demo-minimal.tex
% (find-dednat6 "demo-minimal.tex")
% Output: http://angg.twu.net/dednat6/demo-minimal.pdf
%
% See: http://angg.twu.net/dednat6.html
% http://angg.twu.net/dednat6.html#quick-start
%
%
% To compile (i.e., tex) this file, do this:
%
% lualatex demo-minimal.tex
%
% this makes TeX and Lua process this file "in parallel", or sort of.
% Lua processes the trees and diagrams in 2D ascii art in comments
% that are in the lines that start with "%:" or "%D", converts them to
% TeX code, and sends that code to TeX.
%
% The section 3 ("3. Semi-preprocessors") of the TUGBoat article about
% dednat6 explains what this "in parallel (or sort of)" means. The PDF
% for the article is here:
%
% https://tug.org/TUGboat/tb39-3/tb123ochs-dednat.pdf
% http://angg.twu.net/dednat6/2018tugboat-rev2.pdf
%
% Section 3 ends with this paragraph:
%
% `\pu' means "process until" - or, more precisely, _make dednat6
% process everything until this point that it hasn't processed yet_.
% The first \pu [in the example] processes the lines 1--26 of
% foo.tex, and "outputs" - i.e., sends to TeX - the first
% \defded{my-tree}; the second \pu processes the lines 28--34 of
% foo.tex, and `outputs' the second \defded{my-tree}. Thus, it is
% not technically true that TeX and dednat6 process foo.tex in
% parallel; dednat6 goes later, and each \pu is a synchronization
% point.
%
%
% This comment block contains some emacs/eev-isms.
% You don't need to understand them.
% See: (find-eev-quick-intro "7.4. Commands with very short names")
% http://angg.twu.net/eev-intros/find-eev-quick-intro.html#7.4
%
% (defun c () (interactive) (find-dednat6sh "lualatex -record demo-minimal.tex"))
% (defun d () (interactive) (find-pdf-page "~/dednat6/demo-minimal.pdf"))
% (defun e () (interactive) (find-dednat6 "demo-minimal.tex"))
% (defun u () (interactive) (find-latex-upload-links "demo-minimal"))
% (find-pdf-page "~/dednat6/demo-minimal.pdf")
% http://angg.twu.net/dednat6/demo-minimal.pdf
%
\documentclass[oneside]{article}
\usepackage{proof} % For derivation trees ("%:" lines)
\input diagxy % For 2D diagrams ("%D" lines)
\xyoption{curve} % For the ".curve=" feature in 2D diagrams
\begin{document}
\catcode`\^^J=10 % (find-es "luatex" "spurious-omega")
\directlua{dofile "dednat6load.lua"} % (find-dednat6 "dednat6load.lua")
\title{Dednat6: a minimal test file}
\author{Eduardo Ochs}
\maketitle
Some trees:
%
%L addabbrevs("->", "\\to ")
%
%: [x]^1 f [a]^1 a->b H
%: -------- ----------- ...
%: f(x) g b b->c A B C E F \Pi
%: -------- ------------ =======r ::::\phi ...
%: g(f(x)) c D G I
%: ----------1 ----1 -------------------
%: λx.g(f(x)) a->c J
%:
%: ^x.g(f(x)) ^x.g(f(x)).t ^bars
%:
\pu
$$\ded{x.g(f(x))} \qquad \ded{x.g(f(x)).t} \qquad \ded{bars}$$
\def\catA{\mathbf{A}}
\def\catB{\mathbf{B}}
A diagram:
%
%D diagram adj
%D 2Dx 100 +25 +25 +25
%D 2D 100 LA <--| A
%D 2D | |
%D 2D | <-> |
%D 2D v v
%D 2D +25 B |--> RB C --> D
%D 2D
%D 2D +15 \catB \catA
%D 2D
%D (( LA A <-|
%D LA B -> A RB ->
%D B RB |->
%D LA RB harrownodes nil 20 nil <->
%D \catB \catA <- sl^ .plabel= a L
%D \catB \catA -> sl_ .plabel= b R
%D
%D C D -> .curve= ^10pt .plabel= a a
%D C D -> .curve= _10pt .plabel= b b
%D ))
%D enddiagram
%D
$$\pu
\diag{adj}
$$
\end{document}
% Local Variables:
% coding: utf-8-unix
% End: