summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/calendar/demoover.tex
blob: d563747e9efc6c1627741d2850c14542e42b2ac6 (plain)
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
%%
%% This is file `demoover.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% overword.dtx  (with options: `demo')
%% 
\documentclass{minimal}
\usepackage{overword}

\begin{document}

\makeatletter

\newtoks\registerone
\newtoks\registertwo
\def\list{}

\def\stashonright{%
  \registerone=\expandafter{\@overword}
  \registertwo=\expandafter{\list}
  \edef\list{%
    \noexpand\\{\the\registerone}\the\registertwo}}

\def\showlist{%
  \def\\##1{\message{##1}}
  \message{\space\space -> }
  \list
  \message{^^J}}

\def\readlistagain{%
  \def\\##1{ ##1 }
  \edef\listtext{\list}
\message{\listtext}
  \expandafter\store\listtext\enditall}

\def\storeandshow{%
  \@ifoverword\enditall
   {\message{Ran into \string\enditall!^^J}
    \stashonright
    \expandafter\showlist\@gobble}
   {\stashonright
    \storeandshow}
   {\message{Ran into \string\end!^^J}
    \stashonright
    \showlist}}

\message{^^J----------------------------------------------------------------------}
\message{This file demonstrates the operation of the Overword package for LaTeX}
\message{Ordinarily, TeX reads and inteprets printable characters one by one.}
\message{With this package, it is possible to read input word by word.  This}
\message{capability makes it possible to design user interfaces which are more}
\message{intuitive to users.  The Calendar bundle is one example of such an}
\message{interface.  Below, a phrase is printed to the terminal twice, once in}
\message{reverse word order, and once in re-reversed (normal) word order.  Each}
\message{message is triggered by a control sequence found just beyond the last}
\message{word read --- \string\enditall in the first instance, \string\end\space in the second.}
\message{This file produces no printed output.}
\message{^^J----------------------------------------------------------------------}

\storeandshow This is a demonstration of the overword package \enditall

\let\listclone\list
\def\list{}
\def\\#1{ #1 }
\edef\listtext{\listclone}
\expandafter\storeandshow\listtext

\end{document}
%% 
%%
%% End of file `demoover.tex'.