% A demo of how to run dednat6load.lua as a "real preprocessor".
% This file:
%   http://angg.twu.net/LATEX/2018dednat6-preproc.tex.html
%   http://angg.twu.net/LATEX/2018dednat6-preproc.tex
%                (find-LATEX "2018dednat6-preproc.tex")
%
% See the comments in dednat6load.lua for details:
%   http://angg.twu.net/LATEX/dednat6load.lua.html
%                (find-LATEX "dednat6load.lua")
% and, of course, the home page of dednat6 and the TUGBoat article:
%   http://angg.twu.net/dednat6.html
%   http://angg.twu.net/LATEX/2018tugboat-rev1.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-LATEXsh0 "rm -v                2018dednat6-preproc.dnt")
%   (find-LATEXsh  "./dednat6load.lua -4 2018dednat6-preproc.tex")
%   (find-LATEXsh  "pdflatex             2018dednat6-preproc.tex")
%   (find-angg       "LATEX/2018dednat6-preproc.tex")
%   (find-angg       "LATEX/2018dednat6-preproc.dnt")
%   (find-pdf-page "~/LATEX/2018dednat6-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                2018dednat6-preproc.dnt
./dednat6load.lua -t 2018dednat6-preproc.tex
pdflatex             2018dednat6-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:
