File: manual.html

package info (click to toggle)
whizzytex 1.00iii-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 456 kB
  • ctags: 302
  • sloc: lisp: 2,114; sh: 882; makefile: 202
file content (1010 lines) | stat: -rw-r--r-- 46,193 bytes parent folder | download
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD><TITLE></TITLE>

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.06-7 of 2001-11-14">
</HEAD>
<BODY TEXT=black BGCOLOR=white>
<!--HEVEA command line is: /usr/bin/hevea -I /home/morgon/remy/lib/tex -o manual.html -fix -o doc/manual.html doc/manual.tex -->
<!--HTMLHEAD-->
<!--ENDHTML-->
<!--CUT DEF section 1 -->






<H1 ALIGN=center>
<FONT SIZE=6><B><FONT COLOR="#0000ff">WhizzyTeX</FONT></B></FONT><A NAME="text1" HREF="#note1"><SUP><FONT SIZE=2>1</FONT></SUP></A><BR>
<EM>An <B>Emacs</B> minor-mode<BR>
for <B>incremental viewing of</B><BR>
<B>L<sup>A</sup>T<sub>E</sub>X documents</B></EM>
</H1>

<H3 ALIGN=center>Didier Rmy</H3>

<H3 ALIGN=center>Version 1.00ii, </H3>
<BLOCKQUOTE><B>Abstract: </B>

WhizzyTeX
is an Emacs minor mode for incrementally
viewing L<sup>A</sup>T<sub>E</sub>X documents that you are editing.
It works under Unix with <TT>gv</TT> and <TT>xdvi</TT> viewers, but 
the <A HREF="http://pauillac.inria.fr/advi/">Active-DVI</A> viewer will
provide much better visual effects and offer more functionalities.
</BLOCKQUOTE>
<!--TOC section Installation-->

<H2><A NAME="htoc1">1</A>&nbsp;&nbsp;Installation</H2><!--SEC END -->

To use whizzytex, you need <TT>Emacs</TT> or <TT>XEmacs</TT>, <TT>latex2e</TT>, and
<TT>bash</TT> installed, and at least one DVI or Postscript previewer, such as
<TT>advi</TT>, <TT>xdvi</TT>, or <TT>dvips</TT> combined with <TT>gv</TT>. <BR>
<BR>
WhizzyTeX has been developed under Linux Redhat 7.2 but has not been
extensively tested on other platforms. While L<sup>A</sup>T<sub>E</sub>X and Emacs are quite
portable, you may run into compatibility problem with the bash
shell-script. <BR>
<BR>
Get the source <TT>whizzytex-1.00ii.tgz</TT> 
from the <A HREF="http://pauillac.inria.fr/whizzytex">distribution</A>, 
uncompress and untar it in some working directory, as follows:
<BLOCKQUOTE>
<TT>
gunzip whizzytex-1.00ii.tgz<BR>
tar -xvf whizztex-1.00ii.tar<BR>
cd whizzytex-1.00ii</TT>
</BLOCKQUOTE>
Then, the installation can be automatic (default or customized), or manual.<BR>
<BR>
<!--TOC subsection Automatic installation-->

<H3><A NAME="htoc2">1.1</A>&nbsp;&nbsp;Automatic installation</H3><!--SEC END -->

<A NAME="install/automatic"></A>
By default, all files will be installed in the directory
<CODE>/usr/local/lib/whizzytex/</CODE> and Emacs-lisp code will not be 
byte-compiled. Then, just type: 
<BLOCKQUOTE>
<TT>
make all
</TT>
</BLOCKQUOTE>
This will create a <CODE>Makefile.config</CODE> file (only if nonexistent) by
taking a copy of the template <CODE>Makefile.config.in</CODE>. This will also check
that the <CODE>Makefile.config</CODE> (whether it is the default or a modified
version) makes sense. If you wish to change the default configuration, or if
your configuration is rejected, see ``<B>Customizing the installation</B>''
below. This will also prepared configured versions of the
files for installation.<BR>
<BR>
Finally, to install files to their final destination, type:
<BLOCKQUOTE>
<TT>
make install
</TT>
</BLOCKQUOTE>
See <B>Using WhizzyTeX</B> (Section <A HREF="#using">2</A>) to test your installation.<BR>
<BR>
<!--TOC subsection Customizing the installation-->

<H3><A NAME="htoc3">1.2</A>&nbsp;&nbsp;Customizing the installation</H3><!--SEC END -->

To customize the installation, you can edit 
<CODE>Makefile.config</CODE>, manually.
You may also use the command
<BLOCKQUOTE>
<TT>
make config
</TT>
</BLOCKQUOTE>
for semi-automatic editions. This will test your system configuration and 
choose default values accordingly and prompt for confirmation or when
a decision need to be taken. Of course, you can combine both, doing manual
corrections at the end.<BR>
<BR>
The automatic configuration only check for the existence of commands, but
will not test their interface. Moreover, manual configuration allows to
choose commands that may not even exists.<BR>
<BR>
<!--TOC paragraph Checking <TT>Makefile.config</TT>-->

<H5>Checking <TT>Makefile.config</TT></H5><!--SEC END -->

A misconfiguration of your installation, or ---much more subttle--- a
misconfiguration of other commands (many installation wrap scripts around
standard commands that are sometimes incorrect and break their interface),
may lead to systematic errors when launching WhizzyTeX. To prevent delaying
such obvious errors, some sanity checks are done on the file
<CODE>Makefile.config</CODE> before building other files.
This includes checking for mandatory bindings and for the conformance of
latex and viewers commands to their expected interface.
The later is done by simulating the core of a small WhizzyTeX session:
a small file is created, a specialed version of latex format is build for 
that file, and used to run L<sup>A</sup>T<sub>E</sub>X on on the file; finally, all 
declared viewers are tested on the DVI output, which open
windows, temporarily. <BR>
<BR>
If the sanity check fails, at least part of your configuration is 
suspicious. If some windows remain opened, your confirguration is likely to
be erronesous (and so, even if not detected by the script). <BR>
<BR>
However, if you really know what you are doing, you may bypass the check by
typing <CODE>make config.force</CODE>, which will stamp your <CODE>Makefile.config</CODE>
as correct without checking it.<BR>
<BR>
At the end of customization, proceed as described in ``<B>Automatic
installation</B>'' (Section <A HREF="#install/automatic">1.1</A>)<BR>
<BR>
<!--TOC paragraph Customization guide-->

<H5>Customization guide</H5><!--SEC END -->

By default, WhizzyTeX assumes the standard convention that 
<CODE>latex</CODE> is the command name used to call L<sup>A</sup>T<sub>E</sub>X, 
<CODE>initex</CODE>, the command name used to build a new format, and that the latex 
predefined format is <CODE>latex</CODE>.<BR>
<BR>
These values may be changed if you have another implementation of L<sup>A</sup>T<sub>E</sub>X
uses other names. Then, just redefine the variables <CODE>INITEX</CODE>,
<CODE>LATEX</CODE>, and <CODE>LATEXFMT</CODE> accordingly in the file
<CODE>Makefile.config</CODE>.
For instance, <CODE>platex</CODE> could be use the default configuration
<BLOCKQUOTE>
<TT>
INITEX = iniptex<BR>
LATEX = platex<BR>
LATEXFMT = platex
</TT>
</BLOCKQUOTE>
If you wish to run WhizzyTeX with several configuration, you must choose a
default configuration, but you will be able to call WhizzyTeX with another
configuration from emacs (see Section <A HREF="#configuration">3.1</A> below). <BR>
<BR>
<!--TOC subsection Manual installation-->

<H3><A NAME="htoc4">1.3</A>&nbsp;&nbsp;Manual installation</H3><!--SEC END -->

Since WhizzyTeX only need three files to run, installation can also be done
manually:
<UL><LI><TT>whizzytex.el</TT><BR>
<BR>
This could be installed in a directory visible by Emacs, but does not need
to, since you can always use the full path when you load it or declare
autoload. <BR>
<BR>
No default location.<BR>
<BR>
<LI><TT>whizzytex</TT><BR>
<BR>
This file is a bash-shell script that should be executable. There is not
reason to have it visible from the executable path, since it should not be
used but with WhizzyTeX.<BR>
<BR>
The variable <TT>whizzytex-command-name</TT> defined in <TT>whizzytex.el</TT> 
contains its full path (or just its name if visible from the executable
path). <BR>
<BR>
Default value is <CODE>/usr/local/lib/whizzytex/bin/whizzytex</CODE><BR>
<BR>
<LI><TT>whizzytex.sty</TT><BR>
<BR>
This file are <TT>latex2e</TT> macros. There is no reason to put this visible
from L<sup>A</sup>T<sub>E</sub>X path, since it should not be used but with WhizzyTeX.<BR>
<BR>
Variable variable <TT>PACKAGE</TT> defined in <TT>whizzytex</TT> 
the full path (or just the name if the path is visible from L<sup>A</sup>T<sub>E</sub>X. <BR>
<BR>
Default value is <CODE>/usr/local/lib/whizzytex/latex/whizzytex.sty</CODE></UL>
<!--TOC subsection Automatic upgrading-->

<H3><A NAME="htoc5">1.4</A>&nbsp;&nbsp;Automatic upgrading</H3><!--SEC END -->

For convenience, the distribution also offers a facility to download
and upgrade new versions of WhizzyTeX (this requires <CODE>wget</CODE> installed). 
If automatic upgrading does not work, just do it manually.<BR>
<BR>
All operations should be performed in the WhizzyTeX top directory, <EM>i.e.</EM> where you untar whizzytex for the first time. We assume that have 
created a link: 
<BLOCKQUOTE>
<TT>
ln -s whizzytex-1.00ii whizzytex
</TT>
</BLOCKQUOTE>
(which will be maintained as a link the current version by the manager). 
Alternatively, you can use <TT>whizzytex-1.00ii</TT> in place of <TT>whizzytex</TT> below. The main commands are:
<BLOCKQUOTE>
<TT>
make -f whizzytex/Manager upgrade<BR>
make -f whizzytex/Manager install
</TT>
</BLOCKQUOTE>
The command <CODE>upgrade</CODE> will successively download the newest version,
unpack it, copy the configuration of the current version to the newest
version, and bring the newest version up-to-date. The command <CODE>install</CODE>
will install files of the newest version. <BR>
<BR>
The following command will (re-)install and old version:
<BLOCKQUOTE>
<TT>
make VERSION=&lt;version&gt; download downgrade install
</TT>
</BLOCKQUOTE>
<!--TOC section Using WhizzyTeX-->

<H2><A NAME="htoc6">2</A>&nbsp;&nbsp;Using WhizzyTeX</H2><!--SEC END -->
 
<A NAME="using"></A>
<!--TOC subsection Loading <TT>whizzytex.el</TT>-->

<H3><A NAME="htoc7">2.1</A>&nbsp;&nbsp;Loading <TT>whizzytex.el</TT></H3><!--SEC END -->

Maybe, <TT>whizzytex</TT> is already installed on your (X)Emacs system, by trying
<BLOCKQUOTE>
<TT>
ESC x whizzytex-mode RET
</TT>
</BLOCKQUOTE>
If this works, skip this section.
Otherwise, you should first load the library <CODE>whizzytex.el</CODE> or, better,
declare it autoload. To do this permanently, include the following
declaration in your Emacs startup file (probably is <CODE>~/.emacs</CODE>).
<BLOCKQUOTE><TT>
(autoload 'whizzytex-mode<BR>
"/usr/local/lib/whizzytex/lisp/whizzytex.el"<BR>
"WhizzyTeX, a minor-mode WYSIWIG environment for LaTeX" t)
</TT>
</BLOCKQUOTE>
(where <CODE>/usr/local/bin/whizzytex/lisp/whizzytex.el</CODE> is the 
exact location of <CODE>whizzytex.el</CODE>, which depends on your installation.)
If <CODE>whizzytex.el</CODE> in your (X)Emacs <TT>load-path</TT>, or if you have 
adjusted this variable appropriately, you can simply write:
<BLOCKQUOTE><TT>
(autoload 'whizzytex-mode "whizzytex"<BR>
"WhizzyTeX, a minor-mode WYSIWIG environment for LaTeX" t)
</TT>
</BLOCKQUOTE>
<!--TOC subsection Quick start-->

<H3><A NAME="htoc8">2.2</A>&nbsp;&nbsp;Quick start</H3><!--SEC END -->
 
WhizzyTeX runs as a minor mode of Emacs to be launched on 
an L<sup>A</sup>T<sub>E</sub>X Emacs buffer. The extension of the buffer should be <CODE>.tex</CODE>.
WhizzyTeX also understands <CODE>.ltx</CODE> extensions, but gives priority to the
former when it has to guess the extension. Other extensions are not possible.
<BLOCKQUOTE><EM>The file attached to the buffer must exists and either be a well-formed
L<sup>A</sup>T<sub>E</sub>X source file, or be </EM>mastered<EM>, </EM>i.e.<EM> loaded by another
L<sup>A</sup>T<sub>E</sub>X source file. Thus, when the buffer is does not look well-formed (it
does not contain a </EM><CODE><EM>\begin{document}</EM></CODE><EM> command), WhizzyTeX will search
for its master file, asking the user if need be, so as to first launch
itself on a buffer visiting the master file. In particular, an empty buffer
will be considered as beeing mastered, which may not be what you intend. 
</EM></BLOCKQUOTE>
To start WhizzyTeX on either kind of buffer, type:
<BLOCKQUOTE>
<TT>
ESC x whizzytex-mode RET
</TT>
</BLOCKQUOTE>
By default, this should add new bindings so that you can later turn mode
on and off with key strokes <TT>C-c w</TT>. This will also add a new menu
<TT>Whizzy</TT> in the menu bar call ``the'' menu below.<BR>
<BR>
When <TT>whizzytex-mode</TT> is started for the first time on a new buffer, it
attempts to configure buffer local variables automatically by examining
the content of file, and using default values of global bindings.<BR>
<BR>
You may customize default settings globally by running appropriate
hooks or locally by inserting appropriate comments in the source file ---see
the manual below. <BR>
<BR>
You may also change the settings interactively using the menu, or tell
whizzytex-mode to prompt the user for local customization by passing prefix
argument 4 (using, for instance, key sequence <CODE>C-u C-c w</CODE>). <BR>
<BR>
<!--TOC subsection Editing-->

<H3><A NAME="htoc9">2.3</A>&nbsp;&nbsp;Editing</H3><!--SEC END -->

Once <TT>whizzytex-mode</TT> is on, just type in as usual. WhizzyTeX should work
transparently, refreshing the presentation as you type or move into your
L<sup>A</sup>T<sub>E</sub>X buffer. <BR>
<BR>
Additionally, a gray overlay is put outside of the current slice (the <EM>slice</EM> is the region of your buffer under focus, which is automatically
determined by WhizzyTeX). When a L<sup>A</sup>T<sub>E</sub>X error occurs and it can be
localized in the source buffer, a yellow overlay also is put on the region
around the error, and removed when the error is fixed.<BR>
<BR>
Furthermore, when an error is persistent for several slices or some amount
of time, the interaction-buffer will pop up with the error log
(this option can be toggled on and off with the <TT>Auto interaction</TT> menu
entry). <BR>
<BR>
<!--TOC subsection Recovering from errors-->

<H3><A NAME="htoc10">2.4</A>&nbsp;&nbsp;Recovering from errors</H3><!--SEC END -->

WhizzyTeX makes a good attempt at doing everything automatically. 
However, there remains situations where the user need to understand 
WhizzyTeX ---when WhizzyTeX does not seem to understand the user anymore. <BR>
<BR>
For that purpose, WhizzyTeX report processing and error messages
in its interaction window. Thus the first help for debugging
is always to look at interaction window (buffer 
<CODE>*filename.tex*</CODE> (where <CODE>filename</CODE> stands for the name of the file
associated with the main buffer in case several files are composing your
document). <BR>
<BR>
This window will pop up and down automatically when an error persists or
disappear. For debugging, you may switch this <TT>Auto interaction</TT> mode
off so as to see the buffer permanently. You may also set the mark 
to prevent the region between <CODE>(point-min)</CODE> and <CODE>(mark)</CODE> to be
erased automatically (as long as the buffer is visible). <BR>
<BR>
The <TT>Log...</TT> menu entry can be used to view log files of
last actions performed by whizzytex. <BR>
<BR>
<!--TOC subsection Error during initialization-->

<H3><A NAME="htoc11">2.5</A>&nbsp;&nbsp;Error during initialization</H3><!--SEC END -->

The most delicate part of WhizzyTeX is when starting <TT>whizzytex-mode</TT>,
and usually for the first time in a new buffer, since at that time all kinds
of initialization errors may occur (in addition to L<sup>A</sup>T<sub>E</sub>X errors. <BR>
<BR>
WhizzyTeX will attempt to identify the error and report appropriate messages
in the interaction buffer. (In case an error occurs ---or nothing happens---
always have a look at the interaction buffer, even if it did not prompted
automatically.)<BR>
<BR>
Here are a description of errors during initialization mostly in
chronological order. <BR>
<BR>
<!--TOC paragraph Emacs fails during setup-->

<H5>Emacs fails during setup</H5><!--SEC END -->

This is all under Emacs, so easily under control.
Normally, Emacs should report error messages. See the documentation for
explanations. <BR>
<BR>
In case, of uncaught fatal errors, you may
<CODE>ESC X toggle-debug-on-error</CODE> to get help from Emacs, and try to fix
the problem. <BR>
<BR>
<!--TOC paragraph Emacs cannot find whizzytex-->

<H5>Emacs cannot find whizzytex</H5><!--SEC END -->

This should typically be an installation problem, where the variable
<CODE>whizzytex-command-name</CODE> is erroneous (maybe you need to give the full
path). Try to evaluate <CODE>(shell-command whizzytex-command-name)</CODE> in the
minibuffer, which of course should fail, but only after the command has been
reached.<BR>
<BR>
<!--TOC paragraph Whizzytex cannot build a format-->

<H5>Whizzytex cannot build a format</H5><!--SEC END -->

Then WhizzyTeX will refuse to start. This is most probably an error in your
macros. Try to compile L<sup>A</sup>T<sub>E</sub>X your file. 
Also try to erase all auxiliary files, since if those are erroneous, they
may disturb the creation of the format (which loads some of the auxiliary
files). <BR>
<BR>
There still could be some bad interaction between your macros and WhizzyTeX
macros, but this is very rare.<BR>
<BR>
<!--TOC paragraph Whizzytex cannot launch the previewer-->

<H5>Whizzytex cannot launch the previewer</H5><!--SEC END -->

Usually, this is because whizzytex received wrong previewer parameter. See
the command echoed in the interaction buffer or try to evaluate
<CODE>(whizzy-get whizzytex-view-mode)</CODE>.<BR>
<BR>
<!--TOC paragraph Other errors-->

<H5>Other errors</H5><!--SEC END -->

There are two remaining problems that could happen at launch time, but that
are not particular to launch time: WhizzyTeX could not recompiled the whole 
document or the current slice. However, these should not be fatal. 
In the former case, whizzytex will proceed, ignoring the whole document 
(or using the slice instead if you are in duplex mode). In the later case,
whizzytex will replace the slice by an empty slice ---and print a welcoming
document, as if you launch WhizzyTeX outside of any slice. <BR>
<BR>
<!--TOC subsection Errors during normal edition-->

<H3><A NAME="htoc12">2.6</A>&nbsp;&nbsp;Errors during normal edition</H3><!--SEC END -->

After initialization time, WhizzyTeX will keep recompiles slices as you
type or move, but also recompiles the format and the whole document when you
save a file. Each of this step may failed, but this should not be fatal, and
Emacs should report the error, possible pop up the interaction window, and
continue. <BR>
<BR>
<!--TOC paragraph Whizzytex fails on the current slice-->

<H5>Whizzytex fails on the current slice</H5><!--SEC END -->

This should not be considered as an error, it <B>must</B> happen during
edition. In particular, WhizzyTeX is not much aware of L<sup>A</sup>T<sub>E</sub>X and could
very well slice in the middle of the typesetting of an environment or a
macro command. This should not matter, since the erroneous slice will be
ignore temporarily until the slice is correct again.<BR>
<BR>
<!--TOC paragraph Whizzytex keeps failing on the current slice-->

<H5>Whizzytex keeps failing on the current slice</H5><!--SEC END -->

The slice can also be erroneous because the Emacs did not correctly inferred
where to insert the cursor, which may slice erroneous, although what you
typed is correct. Hopefully, this will not occur too often, and disappear as
you move the point. It should also disappear if you switch off both <TT>Point visible</TT> and <TT>Page to Point</TT> options, which is actually a good
thing to do when you suspect some misbehavior. This will make WhizzyTeX
more robust, but less powerful and more boring.<BR>
<BR>
<!--TOC paragraph Whizzytex does not seem to slice at all-->

<H5>Whizzytex does not seem to slice at all</H5><!--SEC END -->

The interaction window does not produce any output. 
Try to move in the slice, or to another slice. <BR>
<BR>
If nothing happens, check the interaction
window, to see if it did attempt to recompile the slice.
If nothing happens in the interaction window, check for Emacs messages
(in the <CODE>*Messages*</CODE> buffer). You may also check for the presence 
(and content) of the slice by visiting 
<CODE>_whizzy_filename.tex</CODE> or
<BLOCKQUOTE>
<PRE>
_whizzy_filename/input/_whizzy_name.new
</PRE></BLOCKQUOTE>
If neither file exists, it means that Emacs did
not succeed to slice, which you may force by evaluating
<CODE>(whizzy-observe-changes t)</CODE>. 
This can be run in even if <TT>whizzytex-mode</TT> is suspended, which may
avoid automatic processing of slices, and their erasure.<BR>
<BR>
If the slice is present, you may try to compile it by hand (outside of
Emacs) with 
<BLOCKQUOTE>
<PRE>
latex '&amp;_whizzy_filename' _whizzy_filename.tex
</PRE></BLOCKQUOTE>
and see if it succeeds. <BR>
<BR>
<!--TOC paragraph Reformatting failed-->

<H5>Reformatting failed</H5><!--SEC END -->

Formatting errors are fatal during initialization, but accepted once
initialized. In case of an error during reformatting, WhizzyTeX will ignore
the error and continue with the old format. This means that new macros may
be ignored leading to further slicing errors. When rebuilding the format
failed, the mode-line string will display the suffix <CODE>FMT</CODE> until the
error is fixed. See the interaction buffer or select <CODE>format</CODE> from the
<CODE>log...</CODE> menu entry).<BR>
<BR>
You may also force reformatting by typing the <CODE>reformat</CODE> command
in the interaction buffer. <BR>
<BR>
<!--TOC paragraph Whizzytex cannot process the whole document-->

<H5>Whizzytex cannot process the whole document</H5><!--SEC END -->

This is very likely a problem with you document, so try to L<sup>A</sup>T<sub>E</sub>X it 
first. There is a small possibility of strange interaction between
your macros and WhizzyTeX package. Try to turn options 
<TT>Page to Point</TT> and <TT>Point visible</TT> off and retry. 
This will make WhizzyTeX more robust (but also less powerful and more
boring). <BR>
<BR>
<!--TOC subsection Debugging-->

<H3><A NAME="htoc13">2.7</A>&nbsp;&nbsp;Debugging</H3><!--SEC END -->

If you are completely lost, and none of the above helped, you may need some
debugging. If this is your first attempt at WhizzyTeX, you should suspect your
configuration. You should them try with the examples of the distribution. 
Otherwise, you may rollback to a file and configuration that used to work, 
and make incremantal changes.<BR>
<BR>
You can turn emacs debug mode on and off with
<BLOCKQUOTE>
<PRE>
ESC x toggle-debug-on-error RET
</PRE></BLOCKQUOTE>
You can also turn whizzytex debug mode on and off by typing either line
in the interaction window:
<BLOCKQUOTE>
<PRE>
debug on
debug off
</PRE></BLOCKQUOTE>
<!--TOC section Manual-->

<H2><A NAME="htoc14">3</A>&nbsp;&nbsp;<A NAME="manual"></A>Manual</H2><!--SEC END -->
 
This section describes how to use and parameterize WhizzyTeX. <BR>
<BR>
Since, most of the documentation is available online in Emacs from the
<CODE>Help</CODE> entry of the menu by following hyperlinks, we keep this section
to a minimal, so as to avoid redundancy. <BR>
<BR>
Alternatively, you can type
<BLOCKQUOTE>
<PRE>
ESC x describe-function RET whizzytex-mode RET
</PRE></BLOCKQUOTE>
(In XEmacs, you may need to use
<BLOCKQUOTE>
<PRE>
ESC x hyper-describe-function RET whizzytex-mode RET
</PRE></BLOCKQUOTE>
instead of <CODE>describe-function</CODE> to see hyper-links.)<BR>
<BR>
Section <A HREF="#configuration">3.1</A>, <A HREF="#modes">3.2</A> and
<A HREF="#types">3.3</A> are also available as online help. <BR>
<BR>
<!--TOC subsection Configuration-->

<H3><A NAME="htoc15">3.1</A>&nbsp;&nbsp;Configuration</H3><!--SEC END -->
 
<A NAME="configuration"></A>
<!--TOC subsubsection Emacs global configuration-->

<H4>3.1.1&nbsp;&nbsp;Emacs global configuration</H4><!--SEC END -->

<A NAME="Emacs-configuration"></A>
See Emacs help for <CODE>whizzy-default-bindings</CODE> and
<CODE>whizzytex-mode-hook</CODE> for list of bindings.<BR>
<BR>
The Emacs on-line help for <CODE>whizzytex-mode</CODE> lists all user-configurable
variables, which may be given default values in your Emacs startup file
to be used instead of WhizzyTeX own default values. <BR>
<BR>
<!--TOC subsubsection File-based configuration-->

<H4>3.1.2&nbsp;&nbsp;File-based configuration</H4><!--SEC END -->

<A NAME="File-configuration"></A>
A configuration line is one that starts with regexp prefix ``<CODE>^%; +</CODE>''
followed by a configuration keyword. If two configuration lines have the same
keyword, only the first one is considered. The argument of a configuration
line is the rest of the line stripped of its white space.<BR>
<BR>
The keywords are:


<DL COMPACT=compact><DT>
<B>whizzy-master</B><DD><FONT FACE=symbol></FONT><TT>master</TT><FONT FACE=symbol></FONT><BR>
This only makes sense for a file loaded by a <EM>master</EM> file. 
<FONT FACE=symbol></FONT><TT>master</TT><FONT FACE=symbol></FONT> is the relative or full name of the
master file. Optional surrounding quotes (character <CODE>"</CODE>) are
stripped off, so that <CODE>"foo.tex"</CODE> and <CODE>foo.tex</CODE> are equivalent.<BR>
<BR>
<DT><B>whizzy</B><DD> 
[ <FONT FACE=symbol></FONT><TT>slicing</TT><FONT FACE=symbol></FONT> ] 
[ <FONT FACE=symbol></FONT><TT>viewer</TT><FONT FACE=symbol></FONT> [ <FONT FACE=symbol></FONT><TT>command</TT><FONT FACE=symbol></FONT> ] ]
[ <TT>-pre</TT> <FONT FACE=symbol></FONT><TT>make</TT><FONT FACE=symbol></FONT> ] 
[ <TT>-tex</TT> <FONT FACE=symbol></FONT><TT>suffix</TT><FONT FACE=symbol></FONT> ]<BR>
[ <TT>-initex</TT> <FONT FACE=symbol></FONT><TT>initex</TT><FONT FACE=symbol></FONT> ]
[ <TT>-latex</TT> <FONT FACE=symbol></FONT><TT>latex</TT><FONT FACE=symbol></FONT> ]
[ <TT>-fmt</TT> <FONT FACE=symbol></FONT><TT>format</TT><FONT FACE=symbol></FONT> ]
[ <TT>-duplex</TT> ]<BR>
All arguments are optional, but if present they must appear in order:
<DL COMPACT=compact><DT>
<B><FONT FACE=symbol></FONT><TT>slicing</TT></B><B><FONT FACE=symbol></FONT></B><DD><BR>
is determines the way the document is sliced
(see section&nbsp;<A HREF="#modes">3.2</A>).<BR>
<BR>
<DT><B><FONT FACE=symbol></FONT><TT>viewer</TT></B><B><FONT FACE=symbol></FONT></B><DD><BR>
is the type of viewer and can only be one of 
<CODE>-advi</CODE>, <CODE>-xdvi</CODE>, or <CODE>-ps</CODE> (see section&nbsp;<A HREF="#types">3.3</A>)<BR>
<BR>
<DT><B><FONT FACE=symbol></FONT><TT>command</TT></B><B><FONT FACE=symbol></FONT></B><DD><BR>
is optional and is the command used to call the viewer
(of course, it should agree with <FONT FACE=symbol></FONT><TT>viewer</TT><FONT FACE=symbol></FONT>). <BR>
<BR>
<DT><B><TT>-pre</TT></B><B> <FONT FACE=symbol></FONT><TT>make</TT></B><B><FONT FACE=symbol></FONT></B><DD><BR>
tells WhizzyTeX to use the command <FONT FACE=symbol></FONT><TT>make</TT><FONT FACE=symbol></FONT> to preprocess
the slice. 
The command <FONT FACE=symbol></FONT><TT>make</TT><FONT FACE=symbol></FONT> will receive one argument
<TT>_whizzy_basename.new</TT> and should produce 
<TT>_whizzy_basename.tex</TT>
(or <TT>_whizzy_basename.ltx</TT> if the extension of the master file is 
<TT>.ltx</TT>).
By default, <CODE>mv</CODE> is simply used.<BR>
<BR>
The Unix <CODE>make</CODE> can itself be used as a preprocessor (with an
appropriate <CODE>Makefile</CODE>). However, one may have to work around
<CODE>make</CODE>'s notion of time (using FORCE), which is usually too rough. 
This is safe, since WhizzyTeX tests itself for needed recompilations.<BR>
<BR>
<DT><B><TT>-initex <FONT FACE=symbol></FONT>initex</TT></B><B><TT><FONT FACE=symbol></FONT></TT></B><DD><BR>
<BR>
uses <FONT FACE=symbol></FONT><TT>initex</TT><FONT FACE=symbol></FONT> for the initex command instead of the value 
assign to INITEX in <CODE>Makefile.config</CODE> (or <CODE>whizzytex</CODE>)<BR>
<BR>
<DT><B><TT>-latex <FONT FACE=symbol></FONT>latex</TT></B><B><TT><FONT FACE=symbol></FONT></TT></B><DD><BR>
<BR>
uses <FONT FACE=symbol></FONT><TT>latex</TT><FONT FACE=symbol></FONT> for the latex command instead of the value 
assign to LATEX in <CODE>Makefile.config</CODE> (or <CODE>whizzytex</CODE>)<BR>
<BR>
<DT><B><TT>-fmt <FONT FACE=symbol></FONT>format</TT></B><B><TT><FONT FACE=symbol></FONT></TT></B><DD><BR>
<BR>
uses <FONT FACE=symbol></FONT><TT>format</TT><FONT FACE=symbol></FONT> for the latex format instead
of the value set to LATEXFMT in <CODE>Makefile.config</CODE> (or <CODE>whizzytex</CODE>). 
This can either be used in combination with <CODE>-latex</CODE> and <CODE>-initex</CODE>,
or alone. For instance,
<CODE>hugelatex</CODE> could be used (depending on your L<sup>A</sup>T<sub>E</sub>X configuration) to
build a larger format to process huge files.<BR>
<BR>
<DT><B><TT>-duplex</TT></B><DD><BR>
tells WhizzyTeX to launch another window with the whole document (which is
recompiled every time the source buffer is saved).<BR>
<BR>
With <CODE>-advi</CODE> previewers, both views communicate with Emacs and can be
used to navigate through source buffers and positions.
</DL><BR>
For instance, a typical configuration line will be:
<PRE>
   %; whizzy subsection -dvi "xdvi -s 3"
</PRE>It tells whizzytex to run in subsection slicing mode and use a <CODE>dvi</CODE>
style viewer called with the command
<CODE>xdvi -s 3</CODE>. This is also equivalent to
<PRE>
   %; whizzy subsection -dvi xdvi -s 3
</PRE>since Emacs removes outer double-quotes in option arguments. <BR>
<BR>
A more evolved configuration line is:
<PRE>
   %; whizzy -pre make -initex iniptex -latex platex -fmt platex
</PRE>It tells WhizzyTeX to use <CODE>iniptex</CODE> and <CODE>platex</CODE> comands instead
of <CODE>initex</CODE> and <CODE>latex</CODE> and to use the format file <CODE>platex.fmt</CODE> 
instead of <CODE>latex.fmt</CODE>. Moreover, it should use <CODE>make</CODE> to preprocess
files.<BR>
<BR>
<DT><B>whizzy-paragraph</B><DD> <TT>regexp</TT><BR>
This sets the Emacs variable <CODE>whizzy-paragraph</CODE> to <TT>regexp</TT>.
</DL> 
<!--TOC subsection Modes-->

<H3><A NAME="htoc16">3.2</A>&nbsp;&nbsp;Modes</H3><!--SEC END -->
 
<A NAME="modes"></A>
WhizzyTeX recognizes three modes <CODE>slide</CODE>, <CODE>section</CODE>, and <CODE>document</CODE>. 
The mode determines the slice of the document being displayed and how
frequently updates occurs. 
<DL COMPACT=compact><DT><B>slide</B><DD><BR>
<BR>
The mode <CODE>slide</CODE> is mainly used for documents of the class seminar. 
In slide mode, the slide is the text between two <CODE>\begin {slide}</CODE>
comments (thus, the text between two slides is displayed after the
preceding slide). <BR>
<BR>
In slice modes, overlays are ignored <EM>i.e.</EM> all overlays all displayed in
the same slide, unless a command
<CODE>\overlay {</CODE><I>n</I><CODE>}</CODE> occurs on the left of the point, on the same line
(if several commands are on the same line, the 
right-most one is taken), in which case only layers <I>p</I> <FONT FACE=symbol></FONT> <I>n</I> are displayed.<BR>
<BR>
<DT><B>section</B><DD>
In <CODE>section</CODE> mode, the slice of text is the current chapter, section.<BR>
<BR>
<DT><B>subsection</B><DD>
As <CODE>section</CODE> but also slice at subsections. <BR>
<BR>
<DT><B>paragraph</B><DD>
The <CODE>paragraph</CODE> mode is a variation on section mode where, the separator
<CODE>whizzy-paragraph</CODE> is defined by the user (set to two empty lines by
default) instead of using <CODE>\section</CODE> and <CODE>\subsection</CODE> commands. 
subsection.<BR>
<BR>
<DT><B>document</B><DD>
The <CODE>document</CODE> take the region between <CODE>\begin{document}</CODE>
and <CODE>\end</CODE><CODE>{document}</CODE> as the slice. <BR>
<BR>
<DT><B>none</B><DD>
In <CODE>none</CODE> slicing mode, there is no sectioning unit at all and
the whole document is recompiled altogether. 
Currently, pages are not turned to point and the 
cursor is not shown in <CODE>document</CODE> mode, because full documents are not
sliced. (A slicing document mode could be obtained by working in paragraph
mode, with an appropriate regexp.)</DL>
<!--TOC subsection Viewer types-->

<H3><A NAME="htoc17">3.3</A>&nbsp;&nbsp;Viewer types</H3><!--SEC END -->

<A NAME="types"></A>
See help for <CODE>whizzy-viewers</CODE>.<BR>
<BR>
The previewer types can have three possible values:
<TT>-ps</TT>, <TT>-dvi</TT>, or <TT>-advi</TT>. <BR>
<BR>
The previewer type should agree with the previewer command in several ways:
<UL><LI>They tell whizzytex whether to use signal <TT>SIGHUP</TT> (with <TT>-ps</TT>)
or <TT>SIGUSR1</TT> (<TT>-dvi</TT> and <TT>-advi</TT>) to tell the previewer to
reload the file<BR>
<BR>
In particular, if you write a front-hand shell-script <CODE>viewer</CODE> to the
call previewer, and want to use <CODE>viewer</CODE> as the previewer, you should 
arrange for <CODE>viewer</CODE> to understand these signals (and forward them to the
previewer). The simplest way is to hand your script with an exec command
calling the <CODE>gv</CODE>, <CODE>dvi</CODE> or <CODE>advi</CODE>.<BR>
<BR>
<LI>They tell whizzytex whether to process the slice to 
Postscript (with <TT>-ps</TT>) or to DVI format (with <TT>-dvi</TT> and <TT>-advi</TT>). <BR>
<BR>
<LI>Moreover, <TT>-advi</TT> requires the previewer to 
recognize additional <CODE>\special</CODE> commands, in particular
source line information of the form: 
<BLOCKQUOTE>
<PRE>
#line 610, 615 &lt;&lt;recog&gt;&gt;&lt;&lt;nizes&gt;&gt; manual
</PRE></BLOCKQUOTE></UL>

Then, the previewer command is the command to call the previewer. This
string will be passed as such to the WhizzyTeX shell-script. Note that the
name of the <CODE>dvi</CODE> or postscript file will be appended to the previewer
command.<BR>
<BR>
<!--TOC subsection Watching other files-->

<H3><A NAME="htoc18">3.4</A>&nbsp;&nbsp;Watching other files</H3><!--SEC END -->

WhizzyTeX is designed to watch other files and not just the slice saved by
Emacs. In fact, it watches any file dropped in the pool directory. 
For instance, 
if your source file uses images, you can just change the image and
drop the new version in the pool. Then WhizzyTeX will pick the new version,
move it to the working directory and recompile a new slice. Be aware of name
clashes: if you drop a file in the pool, it will automatically be move to
the working directory with the same name, overriding any file of the same
name sitting there. <BR>
<BR>
However, activity is entirely controlled by Emacs, since after every
iteration WhizzyTeX waits for Emacs to send a new command (usually the empty
command that means iterate again). Hence, other files will only be taken
into account at the next iteration. If you really wish these files
to be watched you need to instrument emacs to send and empty line input to
the interaction buffer regularly, even when idle. <BR>
<BR>
<!--TOC subsection Frequency of recompilation-->

<H3><A NAME="htoc19">3.5</A>&nbsp;&nbsp;Frequency of recompilation</H3><!--SEC END -->
 
To obtain maximum WhizzyTeX effect, a new slice should be save after any
edition changed or any displacement that outside of the current slice.
However, to avoid overloading the machine with useless and annoying
refreshments, some compromise is made, depending on Emacs several
parameters: edition <EM>v.s.</EM> move Emacs last commands, 
successful <EM>v.s.</EM> erroneous last slice, and the duration of last slice
recompilation. This usually works well. However, different behavior may wish
to be obtained in different situations. For instance, when editing on a
lab-top, one may wish to save batteries by keeping the load rather low, hence
not using the full power of the processor. Conversely, one may wish 
WhizzyTeX to be as responsive as possible. There is an function
<CODE>whizzy-load-factor</CODE> that control a variable of the same name, which can
be used to adjust the responsiveness (by increasing or decreasing the
load-factor). This simply adds extra delays between slicing. <BR>
<BR>
The format is automatically recompiled at the beginning of each session, and
whenever the buffer containing the file is saved. That is, to load new
packages or define new global macros (before the <CODE>\begin{document}</CODE>), it
suffices to save the current file.<BR>
<BR>
<!--TOC subsection Cross-references, page and section numbers-->

<H3><A NAME="htoc20">3.6</A>&nbsp;&nbsp;Cross-references, page and section numbers</H3><!--SEC END -->
 
The slice is always recompiled with the <CODE>.aux</CODE> file of the whole
document. In paragraph mode, cross references and section numbers are 
recompiled whenever the buffer itself is saved (manually). 
This recompilation operates in batch and concurrently with the recompilation
of slices, so it may take several slices before the new counters or
references are adjusted.<BR>
<BR>
(The recompilation of the whole document is off in slide mode.) <BR>
<BR>
<!--TOC section Viewers-->

<H2><A NAME="htoc21">4</A>&nbsp;&nbsp;Viewers</H2><!--SEC END -->

<!--TOC subsection Viewing with Active-Dvi-->

<H3><A NAME="htoc22">4.1</A>&nbsp;&nbsp;Viewing with Active-Dvi</H3><!--SEC END -->

<A HREF="http://pauillac.inria.fr/advi/">Active-DVI</A> is a DVI previewer with
several additional features. 
In particular, it recognizes extra specials, some of which are particular 
useful for whizzytex that allows a two way communication between 
the source Emacs buffer and the previewer: 
<UL><LI>
The previewer will automatically turn pages for you, as you are editing. 
This is done by telling Emacs to save the current position in the slice. 
Then, the recompilation of the slice will include the current position 
as an hyperref location <CODE>Start-Document</CODE> whenever possible. 
Then, just tell <CODE>Active-Dvi</CODE> to automatically jump at this location
when it opens/reloads the file. <BR>
<BR>
<LI>Conversely, <CODE>Active-Dvi</CODE> can dump source file positions on clicks, 
when available, that is forwarded to Emacs so that it can move to the
corresponding line.<BR>
<BR>
To enjoy this feature, the option <CODE>-advi</CODE> should be used instead of
<CODE>-dvi</CODE>. This will produce extra information (such as source line
numbers) using <CODE>\special</CODE> that most DVI previewers do not recognize
and may complain about.</UL>
<!--TOC subsection Defining your own previewer-->

<H3><A NAME="htoc23">4.2</A>&nbsp;&nbsp;Defining your own previewer</H3><!--SEC END -->

To use your own command as a previewer, you must choose either type
<CODE>-dvi</CODE> or <CODE>-ps</CODE> . In particular, your previewer should 
accept <CODE>SIGUSR1</CODE> (for <CODE>-dvi</CODE>) signal or <CODE>SIGHUP</CODE> (for <CODE>-ps</CODE>) 
signal and respond by reloading the file.<BR>
<BR>
<!--TOC subsection Viewing with acroread-->

<H3><A NAME="htoc24">4.3</A>&nbsp;&nbsp;Viewing with acroread</H3><!--SEC END -->

This does not work because they is no simple way to tell
<CODE>acroread</CODE> to reload its file in batch. <BR>
<BR>
<!--TOC section Implementation-->

<H2><A NAME="htoc25">5</A>&nbsp;&nbsp;Implementation</H2><!--SEC END -->

In short, <FONT COLOR=navy>WhizzyTeX</FONT> is selecting a small slice of the document that 
you are editing around the cursor (according to the selected mode) 
and redisplay the slice incrementally as it changes through edition. 
<UL><LI><B>Emacs is watching you</B> typing and moving in the 
Emacs buffer attached to the L<sup>A</sup>T<sub>E</sub>X source file that your editing and keeps
saving the current slice (current slide, section, or subsection, according
to the mode).<BR>
<BR>
<LI><B>A shell-script daemon</B>
keeps recompiling whenever a new slice (or other files) are produced, and if
recompilation succeeds, tels the previewer to updates the display of the slice.<BR>
<BR>
<LI><B>A few L<sup>A</sup>T<sub>E</sub>X macros</B> allow to build a specialized
format with all macro loaded, which considerably speed up the time for
slicing. Additionally, the slice is a bit instrumented to show the cursor,
and includes specials that allows back-pointing from the DVI file into the
Emacs buffer.</UL>

The rest of this section briefly describe these three parts<A NAME="text2" HREF="#note2"><SUP><FONT SIZE=2>2</FONT></SUP></A>, and
their interactions.<BR>
<BR>
<!--TOC subsection Emacs code-->

<H3><A NAME="htoc26">5.1</A>&nbsp;&nbsp;Emacs code</H3><!--SEC END -->

The main trick is to use <CODE>post-command-hook</CODE> to make Emacs watch
changes. It uses <CODE>buffer-modified-tick</CODE> to tell if any editing has
actually occurred, and compare the point position with the (remembered)
position of the region being displayed to see if saving should occur. It
uses <CODE>sit-for</CODE> to delay slicing until at least the time of slice
computation has ellapsed since last saving, a significant number of editing
changes has occurred, or iddleness.<BR>
<BR>
WhizzyTeX can also display the cursor position, in which case slices are
also recomputed when the cursor moves, but with lower priority.<BR>
<BR>
<!--TOC subsection L<sup>A</sup>T<sub>E</sub>X code-->

<H3><A NAME="htoc27">5.2</A>&nbsp;&nbsp;L<sup>A</sup>T<sub>E</sub>X code</H3><!--SEC END -->

The main TeX trick is to build a format specialized to the current
document so as to avoid reloading the
whole macros at each compilation. This is (almost<A NAME="text3" HREF="#note3"><SUP><FONT SIZE=2>3</FONT></SUP></A>) entirely transparent, that is, the source file does not have
to understand this trick.<BR>
<BR>
This is implemented by redefining <CODE>\documentclass</CODE> which in turn
redefines <CODE>\document</CODE> to execute <CODE>\dump</CODE> (after redefining
<CODE>\document</CODE> to its old value and <CODE>\documentclass</CODE> so that it skips
everything till <CODE>\document</CODE>). This is robust ---and seems 
to work with rather complex macros. <BR>
<BR>
The specialized format can be used in two modes: by default it expects a
full document: it them dumps counters at sectioning commands (chapters, 
sections, and subsections). This is useful to correctly 
numberred sections and pages on slices. <BR>
<BR>
There are also a a few other used to get more advanced behavior, especially
to dump source line numbers and file names so that the previewer can
transform clicks into source file positions. <BR>
<BR>
When building the format, WhizzyTeX also look for a local file of name
<CODE>whizzy.sty</CODE>, which if existing is loaded at the end of the macros. 
This may be used to add other macros in whizzy mode, <EM>e.g.</EM> 
some TeX environments may be redefined to changed they type setting,
according to whether the current line is inside or outside the environment. 
(We have written such an extension for an exercise package that sends the
answers at the end in an appendix, unless the cursor is inside the answer,
in which case the answer is in-lined.)<BR>
<BR>
<!--TOC subsection Bash code-->

<H3><A NAME="htoc28">5.3</A>&nbsp;&nbsp;Bash code</H3><!--SEC END -->

There is no real trick there. This is a shell-script watching the pool
(a directory where slices and other new version of files must be dropped). 
It them recompiles a slice and wait for input (in stdin). 
It recognizes a few one-line commands as input <TT>reformat</TT>, <TT>dupplex</TT>, and by default just watch for the presence of a new slice. 
It recompiles the format file (and the page and section number, but in batch
mode) whenever the source file (its Unix date) has changed and 
recompiles the slice whenever it is present (since WhizzyTeX renames ---hence
removes--- the slice before processing it).<BR>
<BR>
If the file has been recompiled successfully, it triggers the previewer
(ghostscript or xdvi) so that it rereads the dvi or ps file. Otherwise, it
processes the TeX log file and tries to locate the error. It then sends part
of the log file with annotations to the <CODE>*TeX-shell*</CODE> buffer from which
Emacs has been WhizzyTeX, so that Emacs can report the error. <BR>
<BR>
<!--TOC subsection Interaction between the components-->

<H3><A NAME="htoc29">5.4</A>&nbsp;&nbsp;Interaction between the components</H3><!--SEC END -->
 
The control is normally done by Emacs, which launches and kills the Unix
daemon. Quitting the previewer should be noticed by the daemon, which tells
Emacs to turn mode off before exiting. <BR>
<BR>
Muliple WhizzyTeX running on the same file would certainly raise racing
conditions between files and would not make sense. 
For that purpose, the daemon pid is saved in a file and WhizzyTeX
will kill any old WhizzyTeX process on startup. <BR>
<BR>
<!--TOC section Whizzy dream-->

<H2><A NAME="htoc30">6</A>&nbsp;&nbsp;Whizzy dream</H2><!--SEC END -->

When used together with Active-DVI, WhizzyTeX could be made much mode
powerful. In particular, it would be quite easy to to lift WhizzyTeX from an
incremental viewer to an assistant editor.<BR>
<BR>
Active-DVI could easily provide a notion of active boxes.
These would be recognized by
<CODE>\special</CODE> annotations preceeding boxes. 
Active boxes would be autoraise on focus and could be moved or resized with
the mouse. Rather than displaying actions on screen, which would be unaware
of TeX position stategies, actions should rather be reported in stdout,
as is already done for positions. <BR>
<BR>
Active-DVI actions could then easily be interepreted by WhizzyTeX by
adjusting or inserting the correct vertical or horizontal dimension around
active objects, and processed in the next slice. Thanks to the short
incremental loop, this would (almost) appear as if actions where executed by
Active-DVI.<BR>
<BR>
<!--BEGIN NOTES document-->
<HR WIDTH="50%" SIZE=1><DL><DT><A NAME="note1" HREF="#text1"><FONT SIZE=5>1</FONT></A><DD>Whizzytex is free software, 
Copyright 2001, 2002 INRIA
and distributed under the GNU General Public License
(See the COPYING file enclosed with the distribution).
<DT><A NAME="note2" HREF="#text2"><FONT SIZE=5>2</FONT></A><DD>This
section is not quite up-to-date, hence it puts emphasis on the original
design, but several aspects have changed significantly since the first
version. Implementation of more recent features is thus omitted.
<DT><A NAME="note3" HREF="#text3"><FONT SIZE=5>3</FONT></A><DD><TT>\begin{document}</TT> should be typed as such without any white
white space
</DL>
<!--END NOTES-->
<!--HTMLFOOT-->
<!--ENDHTML-->
<!--FOOTER-->
<HR SIZE=2>
<BLOCKQUOTE><EM>This document was translated from L<sup>A</sup>T<sub>E</sub>X by
</EM><A HREF="http://pauillac.inria.fr/~maranget/hevea/index.html"><EM>H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</EM></A><EM>.
</EM></BLOCKQUOTE>
</BODY>
</HTML>