-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-preproc.tex
105 lines (89 loc) · 2.56 KB
/
demo-preproc.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
% A demo of how to run dednat6load.lua as a "real preprocessor".
% This file:
% http://angg.twu.net/dednat6/demo-preproc.tex.html
% http://angg.twu.net/dednat6/demo-preproc.tex
% find-angg "dednat6/demo-preproc.tex")
%
% See the comments in dednat6load.lua for details:
% http://angg.twu.net/dednat6/dednat6load.lua.html
% (find-angg "dednat6/dednat6load.lua")
% and, of course, the home page of dednat6 and the TUGBoat article:
% http://angg.twu.net/dednat6.html
% http://angg.twu.net/dednat6/tugboat-rev2.pdf
%
% Note: this is an _experimental feature_ that I implemented in a
% hurry in may/2019 when I had to prepare an extended abstract using
% the "compositionality" class, that was VERY incompatible with
% lualatex... it uses the command-line option "-t" of dednat6load.lua,
% that is very low-level, and requires me to run "output(preamble1)"
% and "write_dnt_file()".
%
% Eduardo Ochs, 2019may15.
%
% Commands to compile this (using emacs and eev-isms):
% (find-dednat6sh0 "rm -v demo-preproc.dnt")
% (find-dednat6sh "./dednat6load.lua -4 demo-preproc.tex")
% (find-dednat6sh "pdflatex demo-preproc.tex")
% (find-dednat6 "demo-preproc.tex")
% (find-dednat6 "demo-preproc.dnt")
% (find-pdf-page "~/dednat6/demo-preproc.pdf")
\documentclass[oneside]{book}
\usepackage{proof} % For derivation trees ("%:" lines)
\input diagxy % For 2D diagrams ("%D" lines)
\xyoption{curve} % For the ".curve=" feature in 2D diagrams
\begin{document}
This is a demo of how to run {\tt dednat6load.lua} as a standalone
preprocessor outside of Lua\LaTeX! --- to generate a {\tt .dnt} file.
This PDF was generated with:
\begin{verbatim}
rm -v demo-preproc.dnt
./dednat6load.lua -t demo-preproc.tex
pdflatex demo-preproc.tex
\end{verbatim}
\bigskip
\bigskip
\input\jobname.dnt
A tree:
%
%L addabbrevs("->", "\\to ")
%
%: [a]^1 a->b
%: -----------
%: b b->c
%: ------------
%: c
%: ----1
%: a->c
%:
%: ^comp
%:
$$\ded{comp}$$
\def\catA{\mathbf{A}}
\def\catB{\mathbf{B}}
A diagram:
%
%D diagram adj
%D 2Dx 100 +25
%D 2D 100 LA <--| A
%D 2D | |
%D 2D | <-> |
%D 2D v v
%D 2D +25 B |--> RB
%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 enddiagram
%D
$$\diag{adj}
$$
\end{document}
% Local Variables:
% coding: utf-8-unix
% End: