yatex

view docs/yatexe.tex @ 51:b0371b6ed799

Created `ChangeLog'. Log hereafter will be written in `ChangeLog'.
author yuuji
date Tue, 20 Dec 1994 21:00:21 +0000
parents eb0512bfcb7f
children 5d94deabb9f9
line source
1 \def\lang{jp} % -*- texinfo -*-
2 \input texinfo.tex
3 @setfilename yatexe
4 @settitle Yet Another tex-mode for Emacs
6 @iftex
7 @c @syncodeindex fn cp
8 @syncodeindex vr cp
9 @end iftex
11 @titlepage
12 @sp 10
13 @center
14 @subtitle Yet Another tex-mode for emacs
15 @title Wild Bird
16 @subtitle // YaTeX //
17 @author @copyright{} 1991-1994 by HIROSE, Yuuji [yuuji@@ae.keio.ac.jp]
18 @end titlepage
20 @node Top, What is YaTeX?, (dir), (dir)
21 @comment node-name, next, previous, up
22 @cindex Demacs
23 @cindex Mule
24 @cindex LaTeX
25 @cindex YaTeX
27 @menu
28 * What is YaTeX?:: Introduction
29 * Main features:: What YaTeX can do
30 * Installation:: Guide to install
31 * Typesetting:: Call typesetting processes
32 * %# notation:: Quick notation of controlling YaTeX
33 * Completion:: Input LaTeX commands with completion
34 * Local dictionaries:: Directory dependent completion
35 * Commenting out:: Commenting/uncommenting text
36 * Cursor jump:: Jumping to related position
37 * Changing and Deleting:: Changing/deleting certain unit of text
38 * Filling:: Filling an item or paragraph
39 * Updation of @code{\includeonly}:: Maintaining @code{\includeonly}
40 * What column?:: Column position guide in tabular
41 * Intelligent newline:: Guess requisites of new line
42 * Online help:: On-line documentation of LaTeX
43 * Cooperation with other packages:: Work well with gmhist, min-out
44 * Customizations:: How to breed `Wild Bird'
45 * Etcetera:: YaTeX is acquisitive.
46 * Copying:: Redistribution
48 --- The Detailed Node Listing ---
50 %# notation
52 * Changing typesetter::
53 * Static region for typesetting::
54 * Lpr format::
55 * Editing %# notation::
57 Completion
59 * Begin-type completion::
60 * Section-type completion::
61 * Large-type completion::
62 * Maketitle-type completion::
63 * Arbitrary completion::
64 * End completion::
65 * Accent completion::
66 * Image completion::
67 * Greek letters completion::
69 Section-type completion
71 * view-sectioning::
73 Changing and Deleting
75 * Changing La@TeX{} commands::
76 * Killing La@TeX{} commands::
78 Customizations
80 * Lisp variables::
81 * Add-in functions::
82 * Add-in generator::
84 Lisp variables
86 * All customizable variables::
87 * Sample definitions::
88 * Hook variables::
89 * Hook file::
91 Procedure
93 * How the add-in function works?::
94 * How the function is called::
95 * Useful functions for creating add-in::
96 * Contribution::
98 How the add-in function works?
100 * Defining `option add-in'::
101 * Defining `argument add-in'::
102 @end menu
104 @node What is YaTeX?, Main features, Top, Top
105 @comment node-name, next, previous, up
106 @chapter What is YaTeX?
108 YaTeX automates typesetting and previewing of LaTeX and enables
109 completing input of LaTeX mark-up command such as
110 @code{\begin@{@}}..@code{\end@{@}}.
112 YaTeX also supports Demacs which runs on MS-DOS(386), Mule (Multi
113 Language Enhancement to GNU Emacs), and latex on DOS.
115 @node Main features, Installation, What is YaTeX?, Top
116 @comment node-name, next, previous, up
117 @chapter Main features
119 @itemize
120 @item Invocation of typesetter, previewer and related programs(@kbd{C-c t})
121 @item Typesetting on static region which is independent from point
122 @item Semiautomatic replacing of @code{\include only}
123 @item Jumping to error line(@kbd{C-c '})
124 @item Completing-read of La@TeX{} commands such as @code{\begin@{@}},
125 @code{\section} etc.
126 (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m})
127 @item Enclosing text into La@TeX{} environments or commands
128 (@kbd{C-u} @var{AboveKeyStrokes})
129 @item Displaying the structure of text at entering sectioning delimiters
130 @item Learning unknown/new La@TeX{} commands for the next completion
131 @item Argument reading with a guide for complicated La@TeX{} commands
132 @item Generating argument-readers for new/unsupported commands(@file{yatexgen})
133 @item Quick changing or deleting of La@TeX{} commands(@kbd{C-c c}, @kbd{C-c k})
134 @item Jumping from and to inter-file, begin<->end, ref<->label(@kbd{C-c g})
135 @item Blanket commenting out or uncommenting
136 (@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
137 @item Easy input of accent mark, math-mode's commands and Greek letters
138 (@kbd{C-c a}, @kbd{;}, @kbd{/})
139 @item Online help for the popular La@TeX{} commands
140 (@kbd{C-c ?}, @kbd{C-c /})(English help is not yet supported)
141 @end itemize
143 @node Installation, Typesetting, Main features, Top
144 @comment node-name, next, previous, up
145 @chapter Installation
146 @cindex installation
147 @cindex .emacs
148 @cindex auto-mode-alist
149 @cindex autoload
151 Put next two expressions into your @file{~/.emacs}.
153 @lisp
154 (setq auto-mode-alist
155 (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
156 (autoload 'yatex-mode "yatex" "Yet Another La@TeX{} mode" t)
157 @end lisp
159 Next, add certain path name where you put files of YaTeX to your
160 load-path. If you want to put them in @file{~/src/emacs}, write
162 @lisp
163 (setq load-path
164 (cons (expand-file-name "~/src/emacs") load-path))
165 @end lisp
167 @noindent
168 in your @file{~/.emacs}
170 Then, yatex-mode will be automatically loaded when you visit a
171 file which has extension @file{.tex}. If yatex-mode is successfully
172 loaded, mode string on mode line will be turned to "YaTeX".
175 @node Typesetting, %# notation, Installation, Top
176 @comment node-name, next, previous, up
177 @chapter Typesetting
178 @cindex typesetting
179 @cindex previewer
180 @cindex typesetter
181 @cindex latex
182 @cindex printing out
184 The prefix key stroke of yatex-mode is @kbd{C-c} (Press 'C' with Control
185 key) by default. If you don't intend to change the prefix key stroke,
186 assume all @kbd{[prefix]} as @kbd{C-c} in this document. These key
187 strokes execute typeset or preview command.
189 @table @kbd
190 @item [prefix] tj
191 @dots{} invoke latex
192 @item [prefix] tr
193 @dots{} invoke latex on region
194 @item [prefix] tk
195 @dots{} kill current typesetting process
196 @item [prefix] tb
197 @dots{} invoke bibtex
198 @item [prefix] tp
199 @dots{} preview
200 @item [prefix] tl
201 @dots{} lpr dvi-file
202 @end table
204 The current editing window will be divided horizontally when you
205 invoke latex command, and log message of La@TeX{} typesetting will be
206 displayed in the other window; called typesetting buffer. The
207 typesetting buffer automatically scrolls up and traces La@TeX{}
208 warnings and error messages. If you see latex stopping by an
209 error, you can send string to latex in the typesetting buffer.
211 If an error stops the La@TeX{} typesetting, this key stroke will
212 move the cursor to the line where La@TeX{} error is detected.
214 @table @kbd
215 @item [prefix] '
216 @itemx ([prefix]+single quotation)
218 @dots{} jump to the previous error or warning
219 @end table
221 If you find a noticeable error, move to the typesetting buffer and move
222 the cursor on the line of error message and type @kbd{SPACE} key. This
223 makes the cursor move to corresponding source line.
225 Since @kbd{[prefix] tr} pastes the region into the file
226 @file{texput.tex} in the current directory, you should be careful of
227 overwriting. The method of specification of the region is shown in the
228 section @xref{%#NOTATION}.
230 The documentstyle for typeset-region is the same as that of editing
231 file if you edit one file, and is the same as main file's if you
232 edit splitting files.
234 YaTeX asks you the range of dvi-printing by default. You can
235 skip this by invoking it with universal-argument as follows:
237 @example
238 C-u [prefix] tl
239 @end example
241 @node %# notation, Completion, Typesetting, Top
242 @comment node-name, next, previous, up
243 @chapter %# notation
244 @cindex %# notation
246 You can control the typesetting process by describing @code{%#}
247 notations in the source text.
249 @menu
250 * Changing typesetter::
251 * Static region for typesetting::
252 * Lpr format::
253 * Editing %# notation::
254 @end menu
256 @node Changing typesetter, Static region for typesetting, %# notation, %# notation
257 @comment node-name, next, previous, up
258 @section To change the `latex' command or to split a source text.
259 @cindex typesetter
261 To change the typesetting command, write
263 @example
264 %#!latex-big
265 @end example
267 @noindent
268 anywhere in the source text. This is useful for changing
269 typesetter.
271 @node Splitting input files, Static region for typesetting, Changing typesetter, %# notation
272 @comment node-name, next, previous, up
274 And if you split the source text and
275 edit subfile that should be included from main text.
277 @example
278 %#!latex main.tex
279 @end example
281 @noindent
282 will be helpful to execute latex on main file from sub text buffer. Since
283 this command line after @kbd{%#!} will be sent to shell literally, next
284 description makes it convenient to use ghostview as dvi-previewer.
286 @example
287 %#!latex main ; dvi2ps main.dvi > main
288 @end example
290 @noindent
291 Note that YaTeX assumes the component before the last period of
292 the last word in this line as base name of the main La@TeX{} source.
294 To make best use of the feature of inter-file jumping by
295 @kbd{[prefix] g} (see @ref{Cursor jump}), take described below into
296 consideration.
298 @itemize
299 @item You can put split texts in sub directory, but not in
300 sub directory of sub directory.
301 @item In the main text, specify the child file name with relative path name
302 such as \include{chap1/sub}, when you include the file in
303 a sub-directory.
304 @item In a sub-text, write @code{%#!latex main.tex} even if @file{main.tex}
305 is in the parent directory(not %#!latex ../main.tex).
306 @end itemize
308 @node Static region for typesetting, Lpr format, Changing typesetter, %# notation
309 @comment node-name, next, previous, up
310 @section Static region
311 @cindex static region
312 @cindex Fixed region
314 Typeset-region by @kbd{[prefix] tr} passes the region between point and
315 mark to typesetting command by default. But when you want to typeset
316 static region, enclose the region by @code{%#BEGIN} and @code{%#END} as
317 follows.
319 @example
320 %#BEGIN
321 TheRegionYouWantToTypesetManyTimes
322 %#END
323 @end example
325 This is the rule of deciding the region.
327 @enumerate
328 @item
329 If there exists %#BEGIN before point,
331 @enumerate
332 @item
333 If there exists %#END after %#BEGIN,
334 @itemize
335 @item From %#BEGIN to %#END.
336 @end itemize
338 @item
339 If %#END does not exist after %#BEGIN,
340 @itemize
341 @item From %#BEGIN to the end of buffer.
342 @end itemize
343 @end enumerate
345 @item
346 If there does not exist %#BEGIN before point,
347 @itemize
348 @item Between point and mark(standard method of Emacs).
349 @end itemize
350 @end enumerate
352 It is useful to write @code{%#BEGIN} in the previous line of \begin and
353 @code{%#END} in the next line of \@code{end} when you try complex
354 environment such as `tabular' many times. It is also useful to put only
355 @code{%#BEGIN} alone at the middle of very long text. Do not forget to
356 erase @code{%#BEGIN} @code{%#END} pair.
358 @node Lpr format, Editing %# notation, Static region for typesetting, %# notation
359 @comment node-name, next, previous, up
360 @section Lpr format
361 @cindex lpr format
363 Lpr format is specified by three Lisp variables. Here are the
364 default values of them.
366 @table @code
367 @item (1)dviprint-command-format
368 @code{"dvi2ps %f %t %s | lpr"}
369 @item (2)dviprint-from-format
370 @code{"-f %b"}
371 @item (3)dviprint-to-format
372 @code{"-t %e"}
373 @end table
375 On YaTeX-lpr, @code{%s} in (1) is replaced by the file name of main
376 text, @code{%f} by contents of (2), %t by contents of (3). At these
377 replacements, @code{%b} in (2) is also replaced by the number of beginning
378 page, @code{%e} in (3) is replaced by the number of ending page. But
379 @code{%f} and @code{%t} are ignored when you omit the range of print-out
380 by @kbd{C-u [prefix] tl}.
382 If you want to change this lpr format temporarily, put a command
383 such as follows somewhere in the text:
385 @example
386 %#LPR dvi2ps %f %t %s | 4up -page 4 | texfix | lpr -Plp2
387 @end example
389 And if you want YaTeX not to ask you the range of printing
390 out, the next example may be helpful.
392 @example
393 %#LPR dvi2ps %s | lpr
394 @end example
396 @node Editing %# notation, , Lpr format, %# notation
397 @comment node-name, next, previous, up
398 @section Editing %# notation
400 To edit @code{%#} notation described above, type
402 @table @kbd
403 @item [prefix] %
404 @dots{} editing %# notation menu
405 @end table
407 @noindent
408 and select one of the entry of the menu as follows.
410 @example
411 !)Edit-%#! B)EGIN-END-region L)Edit-%#LPR
412 @end example
414 @noindent
415 Type @kbd{!} to edit @code{%#!} entry, @code{b} to enclose the region with
416 @code{%#BEGIN} and @code{%#END}, and @code{l} to edit @code{%#LPR} entry.
417 When you type @kbd{b}, all @code{%#BEGIN} and @code{%#END} are
418 automatically erased.
420 @node Completion, Local dictionaries, %# notation, Top
421 @comment node-name, next, previous, up
422 @chapter Completion
423 @cindex completion
425 YaTeX makes it easy to input the La@TeX{} commands. There are several
426 kinds of completion type, begin-type, section-type, large-type, etc...
428 @menu
429 * Begin-type completion::
430 * Section-type completion::
431 * Large-type completion::
432 * Maketitle-type completion::
433 * Arbitrary completion::
434 * End completion::
435 * Accent completion::
436 * Image completion::
437 * Greek letters completion::
438 @end menu
440 @node Begin-type completion, Section-type completion, Completion, Completion
441 @comment node-name, next, previous, up
442 @section Begin-type completion
443 @cindex begin-type completion
444 @cindex environment
445 @cindex prefix b
447 "Begin-type completion" completes commands of @code{\begin@{env@}} ...
448 @code{\end@{env@}}. All of the begin-type completions begin with this key
449 sequence.
451 @table @kbd
452 @item [prefix] b
453 @dots{} start begin-type completion
454 @end table
456 @noindent
457 An additional key stroke immediately completes a frequently used
458 La@TeX{} @code{\begin@{@}}...@code{\@code{end}@{@}} environment.
460 @table @kbd
461 @item [prefix] b c
462 @dots{} @code{\begin@{center@}...\end@{center@}}
463 @item [prefix] b d
464 @dots{} @code{\begin@{document@}...\end@{document@}}
465 @item [prefix] b D
466 @dots{} @code{\begin@{description@}...\end@{description@}}
467 @item [prefix] b e
468 @dots{} @code{\begin@{enumerate@}...\end@{enumerate@}}
469 @item [prefix] b E
470 @dots{} @code{\begin@{equation@}...\end@{equation@}}
471 @item [prefix] b i
472 @dots{} @code{\begin@{itemize@}...\end@{itemize@}}
473 @item [prefix] b l
474 @dots{} @code{\begin@{flushleft@}...\end@{flushleft@}}
475 @item [prefix] b m
476 @dots{} @code{\begin@{minipage@}...\end@{minipage@}}
477 @item [prefix] b t
478 @dots{} @code{\begin@{tabbing@}...\end@{tabbing@}}
479 @item [prefix] b T
480 @dots{} @code{\begin@{tabular@}...\end@{tabular@}}
481 @item [prefix] b^T
482 @dots{} @code{\begin@{table@}...\end@{table@}}
483 @item [prefix] b p
484 @dots{} @code{\begin@{picture@}...\end@{picture@}}
485 @item [prefix] b q
486 @dots{} @code{\begin@{quote@}...\end@{quote@}}
487 @item [prefix] b Q
488 @dots{} @code{\begin@{quotation@}...\end@{quotation@}}
489 @item [prefix] b r
490 @dots{} @code{\begin@{flushright@}...\end@{flushright@}}
491 @item [prefix] b v
492 @dots{} @code{\begin@{verbatim@}...\end@{verbatim@}}
493 @item [prefix] b V
494 @dots{} @code{\begin@{verse@}...\end@{verse@}}
495 @end table
497 Any other La@TeX{} environments are made by completing-read of the
498 Emacs function.
500 @table @kbd
501 @item [prefix] b SPACE
502 @dots{} begin-type completion
503 @end table
505 @noindent
506 The next message will show up in the minibuffer
508 @example
509 Begin environment(default document):
510 @end example
512 @noindent
513 by typing @kbd{[prefix] b}. Put the wishing environment with completion
514 in the minibuffer, and @code{\begin@{env@}}...\@code{\end@{env@}} will be
515 inserted in the La@TeX{} source text. If the environment you want to put
516 does not exist in the YaTeX completion table, it will be registered in the
517 user completion table. YaTeX automatically saves the user completion
518 table in the user dictionary file at exiting of emacs.
520 If you want to enclose some paragraphs which have already been
521 written, invoke the begin-type completion with changing the case
522 of @kbd{b} of key sequence upper(or invoke it with universal argument
523 by @kbd{C-u} prefix).
524 @cindex enclose region into environment
526 The following example encloses a region with `description'
527 environment.
529 @table @kbd
530 @item [prefix] B D
531 @itemx (or ESC 1 [prefix] b D)
532 @itemx (or C-u [prefix] b D)
534 @dots{} begin-type completion for region
535 @end table
537 This enclosing holds good for the completing input by @kbd{[prefix] b
538 SPC}. @kbd{[prefix] B SPC} enclose a region with the environment selected
539 by completing-read.
541 @node Section-type completion, Large-type completion, Begin-type completion, Completion
542 @comment node-name, next, previous, up
543 @section Section-type completion
544 @cindex section-type completion
545 @cindex prefix s
547 "Section-type completion" completes section-type commands which take an
548 argument or more such as @code{\section@{foo@}}. To invoke section-type
549 completion, type
551 @table @kbd
552 @item [prefix] s
553 @dots{} section-type completion
554 @end table
556 @noindent
557 then the prompt
559 @example
560 (C-v for view) \???@{@} (default documentstyle):
561 @end example
563 @noindent
564 will show up in the minibuffer. Section-type La@TeX{} commands are
565 completed by space key, and the default value is selected when you
566 type nothing in the minibuffer.
568 Next,
570 @example
571 \section@{???@}:
572 @end example
574 @noindent
575 prompts you the argument of section-type La@TeX{} command. For
576 example, the following inputs
578 @example
579 \???@{@} (default documentstyle): section
580 \section{???}: Hello world.
581 @end example
583 @noindent
584 will insert the string
586 @example
587 \section@{Hello world.@}
588 @end example
590 in your La@TeX{} source. When you neglect argument such as
592 @example
593 (C-v for view) \???@{@} (default section): vspace*
594 \vspace*@{???@}:
595 @end example
597 YaTeX puts
599 @example
600 \vspace*@{@}
601 @end example
603 @noindent
604 and move the cursor in the braces.
606 In La@TeX{} command, there are commands which take more than one
607 arguments such as @code{\addtolength{\topmargin}{8mm}}. To complete these
608 commands, invoke section-type completion with universal argument as,
609 @cindex number of argument
611 @example
612 C-u 2 [prefix] s (or ESC 2 [prefix] s)
613 @end example
615 @noindent
616 and make answers in minibuffer like this.
618 @example
619 (C-v for view) \???@{@} (default vspace*): addtolength
620 \addtolength@{???@}: \topmargin
621 Argument 2: 8mm
622 @end example
624 @code{\addtolength} and the first argument @code{\topmargin} can be typed
625 easily by completing read. Since YaTeX also learns the number of
626 arguments of section-type command and will ask that many arguments in
627 future completion, you had better tell the number of arguments to YaTeX at
628 the first completion of the new word. But you can change the number of
629 arguments by calling the completion with different universal argument
630 again.
633 Invoking section-type completion with @code{[Prefix] S} (Capital `S')
634 includes the region as the first argument of section-type command.
636 The section/large/maketitle type completion can work at the
637 prompt for the argument of other section-type completion.
638 Nested La@TeX{} commands are efficiently read with the recursive
639 completion by typing YaTeX's completion key sequence in the
640 minibuffer.
642 @menu
643 * view-sectioning::
644 @end menu
646 @node view-sectioning, , Section-type completion, Section-type completion
647 @comment node-name, next, previous, up
648 @subsection view-sectioning
649 @cindex view sectioning
650 @cindex outline
652 In the minibuffer at the prompt of section-type command completion,
653 typing @kbd{C-v} shows a list of sectioning commands in source text(The
654 line with @code{<<--} mark is the nearest sectioning command). Then,
655 default sectioning command appears in the minibuffer. You can go up/down
656 sectioning command by typing @kbd{C-p}/@kbd{C-n}, can scrolls up/down the
657 listing buffer by @kbd{C-v}/@kbd{M-v}, and can hide sectioning commands
658 under certain level by 0 through 6. Type @kbd{?} in the minibuffer of
659 sectioning prompt for more information.
661 @node Large-type completion, Maketitle-type completion, Section-type completion, Completion
662 @comment node-name, next, previous, up
663 @section Large-type completion
665 "Large-type completion" inputs the font or size changing
666 descriptions such as @code{@{\large @}}. When you type
668 @table @kbd
669 @item [prefix] l
670 @dots{} large-type completion
671 @end table
673 @noindent
674 the message in the minibuffer
676 @example
677 @{\??? @} (default large):
678 @end example
680 prompts prompts you large-type command with completing-read. There are
681 TeX commands to change fonts or sizes, @code{it}, @code{huge} and so on,
682 in the completion table.
684 Region-based completion is also invoked by changing the letter after
685 prefix key stroke as @kbd{[prefix] L}. It encloses the region by braces
686 with large-type command.
688 @node Maketitle-type completion, Arbitrary completion, Large-type completion, Completion
689 @comment node-name, next, previous, up
690 @section Maketitle-type completion
691 @cindex maketitle-type completion
693 We call it "maketitle-type completion" which completes commands such as
694 @code{\maketitle}. Take notice that maketitle-type commands take no
695 arguments. Then, typing
697 @table @kbd
698 @item [prefix] m
699 @dots{} maketitle-type completion
700 @end table
702 @noindent
703 begins maketitle-completion. Above mentioned method is true for
704 maketitle-completion, and there are La@TeX{} commands with no
705 arguments in completion table.
707 @node Arbitrary completion, End completion, Maketitle-type completion, Completion
708 @comment node-name, next, previous, up
709 @section Arbitrary completion
710 @cindex arbitrary completion
712 @noindent
713 You can complete certain La@TeX{} command anywhere without typical
714 completing method as described, by typing
716 @table @kbd
717 @item [prefix] SPC
718 @dots{} arbitrary completion
719 @end table
721 @noindent
722 after the initial string of La@TeX{} command that is preceded by @code{\}.
724 @node End completion, Accent completion, Arbitrary completion, Completion
725 @comment node-name, next, previous, up
726 @section End completion
727 @cindex end completion
729 @noindent
730 YaTeX automatically detects the opened environment and close it with
731 \@code{\end@{environment@}}. Though proficient YaTeX users never fail to
732 make environment with begin-type completion, some may begin an environment
733 manually. In that case, type
735 @table @kbd
736 @item [prefix] e
737 @dots{} @code{end} completion
738 @end table
740 @noindent
741 at the end of the opened environment.
743 @node Accent completion, Image completion, End completion, Completion
744 @comment node-name, next, previous, up
745 @section Accent completion
746 @cindex accent completion
748 When you want to write the European accent marks(like @code{\`@{o@}}),
750 @table @kbd
751 @item [prefix] a
752 @dots{} accent completion
753 @end table
755 @noindent
756 shows the menu
758 @example
759 1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b
760 @end example
762 @noindent
763 in the minibuffer. Chose one character or corresponding numeric,
764 and you will see
766 @example
767 \`{}
768 @end example
770 @noindent
771 in the editing buffer with the cursor positioned in braces. Type
772 one more character `o' for example, then
774 @example
775 \`{o}
776 @end example
778 @noindent
779 will be completed, and the cursor gets out from braces.
781 @node Image completion, Greek letters completion, Accent completion, Completion
782 @comment node-name, next, previous, up
783 @section Image completion of mathematical sign
784 @cindex image completion
785 @cindex math-mode
786 @cindex sigma
787 @cindex leftarrow
788 @cindex ;
790 Arrow marks, sigma mark and those signs mainly used in the
791 TeX's math environment are completed by key sequences which
792 imitate the corresponding symbols graphically. This completion
793 only works in the math environment. YaTeX automatically detects
794 whether the cursor located in math environment or not, and
795 change the behavior of key strokes @kbd{;} and @kbd{/}.
797 By the way, we often express the leftarrow mark by `<-' for example.
798 Considering such image, you can write @code{\leftarrow} by typing @kbd{<-}
799 after @kbd{;} (semicolon) as a prefix. In the same way,
800 @code{\longleftarrow} (@code{<--}) is completed by typing @kbd{;<--},
801 infinity mark which is imitated by @code{oo} is completed by typing
802 @kbd{;oo}.
804 Here are the sample operations in YaTeX math-mode.
806 @example
807 INPUT Completed La@TeX{} commands
808 ; < - @code{\leftarrow}
809 ; < - - @code{\longleftarrow}
810 ; < - - > @code{\longleftrightarrow}
811 ; o @code{\circ}
812 ; o o @code{\infty}
813 @end example
815 In any case, you can quit from image completion and can move
816 to the next editing operation if the La@TeX{} command you want is
817 shown in the buffer.
819 @code{;} itself in math-environment is inserted by @kbd{;;}. Typing
820 @kbd{TAB} in the midst of image completion shows all of the La@TeX{}
821 commands that start with the same name as string you previously typed in.
822 In this menu buffer, press @kbd{RET} after moving the cursor (by @kbd{n},
823 @kbd{p}, @kbd{b}, @kbd{f}) to insert the La@TeX{} command.
825 To know all of the completion table, type @kbd{TAB} just after @kbd{;}.
826 And here is the sample menu by @kbd{TAB} after @kbd{;<}.
828 @example
829 KEY LaTeX sequence sign
830 < \leq <
831 ~
832 << \ll <<
833 <- \leftarrow <-
834 <= \Leftarrow <=
835 @end example
837 You can define your favorite key-vs-sequence completion table in the
838 Emacs-Lisp variable @code{YaTeX-math-sign-alist-private}. See also
839 @file{yatexmth.el} for the information of the structure of this variable.
841 @node Greek letters completion, , Image completion, Completion
842 @comment node-name, next, previous, up
843 @section Greek letters completion
844 @cindex Greek letters completion
845 @cindex /
847 Math-mode of YaTeX provides another image completion, Greek letters
848 completion in the same method. After prefix @kbd{/}, typing @kbd{a} makes
849 @code{\alpha}, @kbd{b} makes @code{\beta} and @kbd{g} makes @code{\gamma}
850 and so on. First, type @kbd{/TAB} to know all the correspondence of
851 alphabets v.s. Greek letters.
853 If you will find @kbd{;} or @kbd{/} doesn't work in correct position of
854 math environment, it may be a bug of YaTeX. Please send me a bug report
855 with the configuration of your text, and avoid it temporarily by typing
856 @kbd{;} or @kbd{/} after universal-argument(@kbd{C-u}) which forces
857 @kbd{;} and @kbd{/} to work as math-prefix.
859 @node Local dictionaries, Commenting out, Completion, Top
860 @comment node-name, next, previous, up
861 @chapter Local dictionaries
862 @cindex local dictionaries
863 @cindex nervous users
865 Tables for completion consist of three dictionaries; `standard
866 dictionary' built in @file{yatex.el}, `user dictionary' for your common
867 private commands, and `local dictionary' that is effective in a certain
868 directory.
870 When you input the command unknown to YaTeX at a completion in the
871 minibuffer, YaTeX asks you with the following prompt;
873 @example
874 `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscad
875 @end example
877 @noindent
878 In this menu, typing @kbd{u} updates your `user dictionary', @kbd{l}
879 updates your local dictionary, @kbd{n} updates only on-memory dictionary
880 which go through only current Emacs session, and @kbd{d} updates no
881 dictionary and throws the new word away.
883 If you find this switching feature meaningless and bothersome, put the
884 next expression into your @file{~/.emacs}
886 @lisp
887 (setq YaTeX-nervous nil)
888 @end lisp
890 @node Commenting out, Cursor jump, Local dictionaries, Top
891 @comment node-name, next, previous, up
892 @chapter Commenting out
893 @cindex commenting out
894 @cindex prefix >
895 @cindex prefix <
896 @cindex prefix ,
897 @cindex prefix .
899 You may want to comment out some region.
901 @table @kbd
902 @item [prefix] >
903 @dots{} comment out region by %
904 @item [prefix] <
905 @dots{} uncomment region
906 @end table
908 @noindent
909 cause an operation to the region between point and mark.
911 @table @kbd
912 @item [prefix] .
913 @dots{} comment out current paragraph
914 @item [prefix] ,
915 @dots{} uncomment current paragraph
916 @end table
918 @noindent
919 comments or uncomments the paragraph where the cursor belongs.
920 This `paragraph' means the region marked by the function
921 mark-paragraph, bound to @kbd{ESC h} by default. It is NOT
922 predictable what will happen when you continuously comment out
923 some paragraph many times.
925 You can also comment out an environment between @code{\begin} and
926 @code{\end}, or a @code{\begin}-\@code{\end} pair themselves, by making the
927 following key strokes on the line where @code{\begin@{@}} or
928 @code{\end@{@}} exists.
930 @table @kbd
931 @item [prefix] >
932 @dots{} comment out from \begin to \@code{end}
933 @item [prefix] <
934 @dots{} uncomment from \begin to \@code{end}
935 @end table
937 @noindent
938 comment whole the contents of environment. Moreover,
940 @table @kbd
941 @item [prefix] .
942 @dots{} comment out \begin and \@code{end}
943 @item [prefix] ,
944 @dots{} uncomment \begin and \@code{end}
945 @end table
947 @noindent
948 (un)comments out only environment declaration: @code{\begin@{@}} and
949 @code{\end@{@}}. NOTE that even if you intend to comment out some region,
950 invoking @kbd{[prefix] >} on the @code{\begin},@code{\end} line decides to
951 work in `commenting out from @code{\begin} to @code{\end}' mode.
954 @node Cursor jump, Changing and Deleting, Commenting out, Top
955 @comment node-name, next, previous, up
956 @chapter Cursor jump
957 @cindex cursor jump
958 @cindex prefix g
960 @section Jump to corresponding object
962 Typing
964 @table @kbd
965 @item [prefix] g
966 @dots{} go to corresponding object
967 @end table
969 @noindent
970 in a certain place move the cursor to the place corresponding to the
971 La@TeX{} command of last place. YaTeX recognize the followings as pairs
972 that have relation each other.
974 @itemize @bullet
975 @item @code{\begin@{@}} <-> @code{\end@{@}}
976 @item @code{%#BEGIN} <-> @code{%#END}
977 @item @code{\label@{@}} <-> @code{\ref@{@}}
978 @item @code{\include(\input)} -> included file
979 @item @code{\bibitem@{@}} <-> @code{\cite@{@}}
980 @end itemize
982 On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the
983 cursor to the corresponding @code{\end},@code{\begin} line, if its partner
984 really exists. The behavior on the line @code{%#BEGIN} and @code{%#END}
985 are the same. Note that if the correspondent of @code{label/ref} or
986 @code{cite/bibitem} exists in another file, that file have to be opened to
987 make a round trip between references by @kbd{[prefix] g}.
989 If you type @code{[prefix] g} on the line of @code{\include@{chap1@}},
990 typically in the main text, YaTeX switches buffer to @file{chap1.tex}.
992 @table @kbd
993 @item [prefix] 4 g
994 @dots{} go to corresponding object in other window
995 @end table
997 @noindent
998 do the same job as @kbd{[prefix] g} except it's done in other window.
999 Note that this function doesn't work on @code{begin/end},
1000 @code{%#BEGIN/%#END} pairs because it is meaningless.
1002 @section Jump to main file
1004 Typing
1006 @table @kbd
1007 @item [prefix] ^
1008 @dots{} visit main file
1009 @item [prefix] 4^
1010 @dots{} visit main file in other buffer
1011 @end table
1012 @cindex prefix ^
1013 @cindex prefix 4 ^
1015 in a sub text switch the buffer to the main text specified by
1016 @code{%#!} notation.
1018 @section Other jumping features
1020 And these are the functions which work on the current La@TeX{}
1021 environment:
1023 @table @kbd
1024 @item M-C-a
1025 @dots{} beginning of environment
1026 @item M-C-e
1027 @dots{} @code{end} of environment
1028 @item M-C-@@
1029 @dots{} mark environment
1030 @end table
1031 @cindex M-C-a
1032 @cindex M-C-e
1033 @cindex M-C-@@
1035 @node Changing and Deleting, Filling, Cursor jump, Top
1036 @comment node-name, next, previous, up
1037 @chapter Changing and Deleting
1039 These functions are for change or deletion of La@TeX{} commands
1040 already entered.
1042 @table @kbd
1043 @item [prefix] c
1044 @dots{} change La@TeX{} command
1045 @item [prefix] k
1046 @dots{} kill La@TeX{} command
1047 @end table
1048 @cindex prefix c
1049 @cindex prefix k
1051 @menu
1052 * Changing La@TeX{} commands::
1053 * Killing La@TeX{} commands::
1054 @end menu
1056 @node Changing La@TeX{} commands, Killing La@TeX{} commands, Changing and Deleting, Changing and Deleting
1057 @comment node-name, next, previous, up
1058 @section Changing La@TeX{} commands
1060 @kbd{[prefix] c} can change the various (La)@TeX{} commands. This can
1061 change the followings.
1062 @itemize @bullet
1063 @item Environment names
1064 @item Section-type commands
1065 @item Argument of section-type commands
1066 @item Optional parameters (enclosed by []) of section-type commands
1067 @item Font/size designators
1068 @end itemize
1070 Typing @kbd{[prefix] c} on one of above objects you want to change
1071 brings a suitable reading function sometimes with completion.
1072 Note: If you want to change the argument of section-type command that
1073 contains other La@TeX{} commands, type @kbd{[prefix] c} either of
1074 surrounding braces of the argument in order to make YaTeX ignore the
1075 internal La@TeX{} sequences as an object of changing. Anyway, it is
1076 very difficult to know which argument position the cursor belongs because
1077 the La@TeX{} commands can be nested and braces can freely emerge. So keep
1078 it mind to put the cursor on a brace when you are thinking of changing a
1079 complicated argument.
1081 @node Killing La@TeX{} commands, , Changing La@TeX{} commands, Changing and Deleting
1082 @comment node-name, next, previous, up
1083 @section Killing La@TeX{} commands
1084 @cindex Killing La@TeX{} commands
1086 @kbd{[prefix] k} kills the La@TeX{} commands sometimes with their
1087 arguments. Following table illustrates the correspondence of the invoking
1088 position and what is killed.
1090 @example
1091 [Invoking position] [action]
1092 \begin, \end line kill \begin,\end pairs
1093 %#BEGIN, %#END line kill %#BEGIN,%#END pairs
1094 on a Section-type command kill section-type command
1095 on a parenthesis kill parentheses
1096 @end example
1098 Note that when killing @code{\begin, \end} or @code{%#BEGIN, %#END} pair,
1099 the lines @code{\begin, \end} or @code{%#BEGIN, %#END} exist will be
1100 killed entirely. So take care not to create any line that contains more
1101 than one @code{\begin} or so.
1103 While all operations above are to kill `containers' which surround some
1104 text, universal argument (@kbd{C-u}) for these commands kills not only
1105 `containers' but also `contents' of them. See below as a sample.
1107 @example
1108 Original text: [prefix] k C-u [prefix] k
1109 Main \footnote@{note@} here. Main note here. Main here.
1110 ~(cursor)
1111 @end example
1113 @node Filling, Updation of @code{\includeonly}, Changing and Deleting, Top
1114 @comment node-name, next, previous, up
1115 @chapter Filling
1116 @cindex filling
1118 @section Filling an item
1119 @cindex filling an item
1120 @cindex prefix i
1122 To fill a term (descriptive sentences) of @code{\item}, type
1124 @table @kbd
1125 @item [prefix] i
1126 @dots{} fill item
1127 @end table
1129 @noindent
1130 on that item.
1132 YaTeX uses the value of the variable @code{YaTeX-item-regexp} as the
1133 regular expression to search item header in itemize environment.
1134 If you make a newcommand to itemize terms(e.g. @code{\underlineitem}), put
1136 @lisp
1137 (setq YaTeX-item-regexp
1138 "\\(\\\\item\\)\\|\\(\\\\underlineitem\\)")
1139 @end lisp
1140 @cindex YaTeX-item-regexp
1142 in your @file{~/.emacs}. If you are not familiar with regular expression
1143 for Emacs-Lisp, name a newcommand for `itemize' beginning with
1144 @code{\item} such as @code{\itembf}, not @code{\bfitem}.
1146 This function -- YaTeX-fill-item -- reformats the @code{\item} into
1147 `hang-indented' style. When you separate the topic word and its
1148 description, use @kbd{M-q} instead. For example:
1150 @example
1151 Hang indentation:
1153 >\item[foo] `foo' is the typical word for describing an
1154 > arbitrarily written....
1156 Normal indentation:
1158 > \item bar
1160 > When the word `for' is used as an arbitrarily word, `bar'
1161 > is bound to follow it.
1162 @end example
1164 Note that the indent depth of the @code{\item} and its descriptive
1165 paragraph are the same in latter case. If you want to use different
1166 depth, invoke fill-paragraph at the beginning of non-whitespace
1167 character(see below).
1169 @section Filling paragraph
1170 @cindex Filling paragraph
1171 @cindex M-q
1173 Fill-paragraph is little bit adapted for La@TeX{} sources. It retains from
1174 filling in certain environments where formatting leads to a disaster such
1175 as verbatim, tabular, or so. And it protects @code{\verb} expressions
1176 from being folded (The variable @code{YaTeX-verb-regexp} controls this).
1177 Besides, putting cursor on the first occurrence of non-whitespace
1178 character on a line changes the fill-prefix temporarily to the depth of
1179 the line.
1181 @node Updation of @code{\includeonly}, What column?, Filling, Top
1182 @comment node-name, next, previous, up
1183 @chapter Updation of @code{\includeonly}
1184 @cindex includeonly
1186 When you edit splitting source texts, the notation
1188 @example
1189 \includeonly@{CurrentEditingFileName@}
1190 @end example
1192 @noindent
1193 in the main file reduces the time of typesetting. If you want
1194 to hack other file a little however, you have to rewrite it to
1196 @example
1197 \includeonly@{OtherFileNameYouWantToFix@}
1198 @end example
1200 @noindent
1201 in the main file. YaTeX automatically detects that the current
1202 edited text is not in includeonly list and prompts you
1204 @example
1205 A)dd R)eplace %)comment?
1206 @end example
1208 in the minibuffer. Type @kbd{a} if you want to add the current file name
1209 to @code{\includeonly} list, @kbd{r} to replace \@code{includeonly} list
1210 by the current file, and type @kbd{%} to comment out the
1211 @code{\includeonly} line.
1213 @node What column?, Intelligent newline, Updation of @code{\includeonly}, Top
1214 @comment node-name, next, previous, up
1215 @chapter What column?
1216 @cindex what column
1217 @cindex complex tabular
1218 @cindex prefix &
1220 We are often get tired of finding the corresponding column in
1221 large tabulars. For example,
1223 @example
1224 \begin@{tabular@}@{|c|c|c|c|c|c|c|c|@}\hline
1225 Name&Position&Post No.&Addr.&Phone No.&FAX No.&
1226 Home Addr.&Home Phone\\ \hline
1227 Thunder Bird & 6 & 223 & LA & xxx-yyy &
1228 zzz-www & Japan & 9876-54321 \\
1229 & 2 & \multicolumn@{2@}@{c|@}@{Unknown@}
1230 &&&(???)
1231 \\ \hline
1232 \end@{tabular@}
1233 @end example
1235 Suppose you have the cursor located at @code{(???)} mark, can you tell
1236 which column it is belonging at once? Maybe no. In such case,
1237 type
1239 @table @kbd
1240 @item [prefix] &
1241 @dots{} What column
1242 @end table
1244 @noindent
1245 in that position. YaTeX tells you the column header of the
1246 current field. Since YaTeX assumes the first line of tabular
1247 environment as a row of column headers, you can create a row of
1248 virtual column headers by putting them in the first line and
1249 commenting that line with @code{%}.
1251 @node Intelligent newline, Online help, What column?, Top
1252 @comment node-name, next, previous, up
1253 @chapter Intelligent newline
1254 @cindex Intelligent newline
1255 @cindex ESC RET
1256 @cindex M-C-m
1258 In tabular[*], array, itemize, enumerate or tabbing environment,
1260 @table @kbd
1261 @item ESC RET
1262 @dots{} Intelligent newline
1263 @end table
1265 @noindent
1266 inserts the contents corresponding to the current environment in the next
1267 line. In @code{tabular} environment, for example, @kbd{ESC RET} inserts
1268 the certain number of @code{&} and trailing @code{\\}, and @code{\hline}
1269 if other @code{\hline} is found in backward. Here are the list of
1270 contents v.s. environments.
1272 @itemize
1273 @item @code{tabular}, @code{tabular*}, @code{array}
1275 Corresponding number of @code{&} and @code{\\}.
1276 And @code{\hline} if needed.
1278 @item @code{tabbing}
1280 The same number of @code{\>} as @code{\=} in the first line.
1282 @item @code{itemize}, @code{enumerate}, @code{description}, @code{list}
1284 @code{\item} or @code{item[]}.
1285 @end itemize
1287 Note that since this function works seeing the contents of the first
1288 line, please call this after the second line if possible.
1290 If you want to apply these trick to other environments, @code{foo}
1291 environment for example, define the function named
1292 @code{YaTeX-intelligent-newline-foo} to insert corresponding contents.
1293 That function will be called at the beginning of the next line after the
1294 newline is inserted to the current line. Since the function
1295 @code{YaTeX-indent-line} is designed to indent the current line properly,
1296 calling this function before your code to insert certain contents must be
1297 useful. See the definition of the function
1298 @code{YaTeX-intelligent-newline-itemize} as an example.
1300 @node Online help, Cooperation with other packages, Intelligent newline, Top
1301 @comment node-name, next, previous, up
1302 @chapter Online help
1303 @cindex online help
1304 @cindex prefix ?
1305 @cindex prefix /
1306 @cindex apropos
1307 @cindex keyword search
1309 YaTeX provides you the online help with popular La@TeX{} commands.
1311 Here are the key strokes for the online help.
1313 @table @kbd
1314 @item [prefix] ?
1315 @dots{} Online help
1316 @item [prefix] /
1317 @dots{} Online apropos
1318 @end table
1320 @section Online help
1322 `Online help' shows the documentation for the popular La@TeX{}
1323 commands(defaults to the commands on the cursor) in the next buffer.
1324 There are two help file, `global help' and `private help'. The former
1325 file contains the descriptions on the standard La@TeX{} command and is
1326 specified its name by variable @code{YaTeX-help-file}. Usually, the
1327 global help file should be located in public space (@code{$EMACSEXECPATH}
1328 by default) and should be world writable so that anyone can update it to
1329 enrich its contents. The latter file contains descriptions on
1330 non-standard or personal command definitions and is specified by
1331 @code{YaTeX-help-file-private}. This file should be put into private
1332 directory.
1334 @section Online apropos
1336 `Online apropos' is an equivalent of GNU Emacs's apropos. It
1337 shows all the documentations that contains the keyword entered by
1338 the user.
1340 @section When no descriptions are found...
1342 If there is no description on a command in help files, YaTeX
1343 requires you to write a description on that command. If you are
1344 willing to do, determine which help file to add and write the
1345 description on it referring your manual of (La)TeX. Please send
1346 me your additional descriptions if you describe the help on some
1347 standard commands. I might want to include it in the next
1348 distribution.
1350 @node Cooperation with other packages, Customizations, Online help, Top
1351 @comment node-name, next, previous, up
1352 @chapter Cooperation with other packages
1354 YaTeX works better with other brilliant packages.
1356 @section gmhist
1357 @cindex gmhist
1358 @cindex command history
1359 @cindex minibuffer history
1361 When you are loading @file{gmhist.el} and @file{gmhist-mh.el}, you can
1362 use independent command history list at the prompt of preview command
1363 (@kbd{[prefix] tp}) and print command (@kbd{[prefix] tl}). On each
1364 prompt, you can enter the previous command line string repeatedly by
1365 typing @kbd{M-p}.
1367 @section min-out
1368 @cindex min-out
1370 @file{min-out}, the outline minor mode, can be used in yatex-mode
1371 buffers. If you want to use it with YaTeX, please refer the
1372 file @file{yatexm-o.el} as an example.
1374 @node Customizations, Etcetera, Cooperation with other packages, Top
1375 @comment node-name, next, previous, up
1376 @chapter Customizations
1377 @cindex customizations
1379 You can customize YaTeX by setting Emacs-Lisp variables and by making
1380 add-in functions.
1382 @menu
1383 * Lisp variables::
1384 * Add-in functions::
1385 * Add-in generator::
1386 @end menu
1388 @node Lisp variables, Add-in functions, Customizations, Customizations
1389 @comment node-name, next, previous, up
1390 @section Lisp variables
1391 @cindex customizable variables
1393 You can change the key assignments or make completion more
1394 comfortable by setting the values of various variables which
1395 control the movement of yatex-mode.
1397 For example, if you want to change the prefix key stroke from @kbd{C-c}
1398 to any other sequence, set YaTeX-prefix to whatever you want to use. If
1399 you don't want to use the key sequence @kbd{C-c letter} which is assumed
1400 to be the user reserved sequence in Emacs world, set
1401 @code{YaTeX-inhibit-prefix-letter} to @code{t}, and all of the default key
1402 bind of @kbd{C-c letter} will turn to the corresponding @kbd{C-c C-letter}
1403 (but the region based completions that is invoked with @kbd{C-c
1404 Capital-letter} remain valid, if you want to disable those bindings, set
1405 that variable to 1 instead of @code{t}).
1407 @menu
1408 * All customizable variables::
1409 * Sample definitions::
1410 * Hook variables::
1411 * Hook file::
1412 @end menu
1414 @node All customizable variables, Sample definitions, Lisp variables, Lisp variables
1415 @comment node-name, next, previous, up
1416 @subsection All customizable variables
1417 @cindex all customizable variables
1419 Here are the customizable variables of yatex-mode. Each value setq-ed
1420 in @file{~/.emacs} is preferred and that of defined in @file{yatex.el} is
1421 neglected. Parenthesized contents stands for the default value. When you
1422 are to change some of these variables, see more detailed documentation of
1423 the variable by @kbd{M-x describe-variable}.
1425 @defvar YaTeX-prefix
1426 Prefix key stroke (@kbd{C-c})
1427 @end defvar
1429 @defvar YaTeX-inhibit-prefix-letter
1430 Change key stroke from @kbd{C-c letter} to @kbd{C-c C-letter}
1431 (@code{nil})
1432 @end defvar
1434 @defvar YaTeX-fill-prefix
1435 Fill-prefix used in yatex-mode (@code{nil})
1436 @end defvar
1438 @defvar YaTeX-open-lines
1439 Number of blank lines between cursor and @code{\begin@{@}},
1440 @code{\@code{end}@{@}} (0)
1441 @end defvar
1443 @defvar YaTeX-user-completion-table
1444 Name of user dictionary where learned completion table will be stored.
1445 (@code{"~/.yatexrc"})
1446 @end defvar
1448 @defvar YaTeX-item-regexp
1449 Regular expression of item command(@code{"\\\\item"})
1450 @end defvar
1452 @defvar tex-command
1453 La@TeX{} typesetter command (@code{"latex"})
1454 @end defvar
1456 @defvar dvi2-command
1457 Preview command
1458 (@code{"xdvi -geo +0+0 -s 4 -display (getenv"DISPLAY")"})
1459 @end defvar
1461 @defvar dviprint-command-format
1462 Command format to print dvi file (@code{"dvi2ps %f %t %s | lpr"})
1463 @end defvar
1465 @defvar dviprint-from-format
1466 Start page format of above %f. %b will turn to start page
1467 (@code{"-f %b"})
1468 @end defvar
1470 @defvar dviprint-to-format
1471 End page format of above %t. %e will turn to @code{end} page
1472 (@code{"-t %e"})
1473 @end defvar
1475 @defvar section-name
1476 Initial default value at the first section-type completion
1477 (@code{"documentstyle"})
1478 @end defvar
1480 @defvar env-name
1481 Initial default value at the first begin-type completion
1482 (@code{"document"})
1483 @end defvar
1485 @defvar fontsize-name
1486 Ditto of large-type (@code{"large"})
1487 @end defvar
1489 @defvar single-command
1490 Ditto of maketitle-type (@code{"maketitle"})
1491 @end defvar
1493 @defvar YaTeX-need-nonstop
1494 Put @code{\nonstopmode@{@}} or not (@code{nil})
1495 @end defvar
1497 @defvar latex-warning-regexp
1498 Regular expression of warning message latex command puts out
1499 (@code{"line.* [0-9]*"})
1500 @end defvar
1502 @defvar latex-error-regexp
1503 Regular expression of error message (@code{"l\\.[1-9][0-9]*"})
1504 @end defvar
1506 @defvar latex-dos-emergency-message
1507 Message latex command running on DOS puts at abort
1508 (@code{"Emergency stop"})
1509 @end defvar
1511 @defvar YaTeX-item-regexp
1512 Regexp of La@TeX{} itemization command (@code{"\\\\(sub\\)*item"})
1513 @end defvar
1515 @defvar YaTeX-verb-regexp
1516 Regexp of La@TeX{} verb command family. Omit \\\\.
1517 (@code{"verb\\*?\\|path"})
1518 @end defvar
1520 @defvar YaTeX-nervous
1521 T for using local dictionary (@code{t})
1522 @end defvar
1524 @defvar YaTeX-sectioning-regexp
1525 Regexp of La@TeX{} sectioning command
1527 (@code{"part\\|chapter\\|\\(sub\\)*\\(section\\|paragraph\\)"})
1528 @end defvar
1530 @defvar YaTeX-fill-inhibit-environments
1531 Inhibit fill in these environments (@code{'("verbatim" "tabular")})
1532 @end defvar
1534 @defvar YaTeX-uncomment-once
1535 @code{T} for deleting all preceding @code{%} (@code{nil})
1536 @end defvar
1538 @defvar YaTeX-close-paren-always
1539 @code{T} for always close all parenthesis automatically,
1540 @code{nil} for only eol(@code{t})
1541 @end defvar
1543 @defvar YaTeX-auto-math-mode
1544 Switch math-mode automatically(@code{t})
1545 @end defvar
1547 @defvar YaTeX-math-key-list-private
1548 User defined alist, math-mode-prefix vs completion alist
1549 used in image completion(@code{nil}). See @file{yatexmth.el}
1550 for the information about how to define a completion alist.
1551 @end defvar
1553 @defvar YaTeX-default-pop-window-height
1554 Initial height of typesetting buffer when one-window.
1555 Number for the lines of the buffer, numerical string for
1556 the percentage of the screen-height.
1557 @code{nil} for half height(10)
1558 @end defvar
1560 @defvar YaTeX-help-file
1561 Global online help file name (@file{$EMACS/etc/YATEXHLP.jp})
1562 @end defvar
1564 @defvar YaTeX-help-file-private
1565 Private online help file name (@file{"~/YATEXHLP.jp"})
1566 @end defvar
1568 @defvar YaTeX-no-begend-shortcut
1569 Disable [prefix] b ?? shortcut (@code{nil)}
1570 @end defvar
1572 @defvar YaTeX-hilit-pattern-adjustment-private
1573 List of the list that contain the regular expression and the symbol of
1574 logical meaning of the string that matches the pattern. See also the
1575 value from @code{(assq 'yatex-mode hilit-patterns-alist)} and the value of
1576 @code{YaTeX-hilit-pattern-adjustment-default} (and even the document of
1577 hilit19.el).
1578 @end defvar
1580 @defvar YaTeX-sectioning-level
1581 Alist of LaTeX's sectioning command vs its height.
1582 @end defvar
1584 @node Sample definitions, Hook variables, All customizable variables, Lisp variables
1585 @comment node-name, next, previous, up
1586 @subsection Sample definitions
1587 @cindex prefix key stroke
1588 @cindex fill-prefix
1590 For instance, to change the prefix key stroke to @kbd{ESC}, and name of
1591 the user dictionary @file{~/src/emacs/yatexrc}, and set @code{fill-prefix}
1592 to single TAB character, add the following @code{setq} to @file{~/.emacs}.
1594 @lisp
1595 (setq YaTeX-prefix "\e"
1596 YaTeX-user-completion-table "~/src/emacs/yatexrc"
1597 YaTeX-fill-prefix " ")
1598 @end lisp
1600 @node Hook variables, Hook file, Sample definitions, Lisp variables
1601 @comment node-name, next, previous, up
1602 @subsection Hook variables
1603 @cindex hook variables
1605 More customizations will be done by the hook-function defined in
1606 hook-variable @code{yatex-mode-hook}. This is useful to define a shortcut
1607 key sequence to enter some environments other than @code{document} and
1608 @code{enumerate} etc. The following statement defines @code{[prefix] ba}
1609 to enter @code{\begin@{abstract@}} ... @code{=end@{abstract@}}
1610 immediately.
1612 @lisp
1613 (setq yatex-mode-hook
1614 '(lambda() (YaTeX-define-begend-key "ba" "abstract")))
1615 @end lisp
1617 You should use functions @code{YaTeX-define-key}, or
1618 @code{YaTeX-define-begend-key} to define all the key sequences of
1619 yatex-mode.
1621 @node Hook file, , Hook variables, Lisp variables
1622 @comment node-name, next, previous, up
1623 @subsection Hook file
1624 @cindex hook file
1626 You can stuff all of YaTeX relating expressions into a file named
1627 @file{yatexhks.el} if you have a lot of codes. YaTeX automatically load
1628 this file at the initialization of itself. Using @file{yatexhks.el}
1629 makes @code{yatex-mode-load-hook} unnecessary.
1631 @node Add-in functions, Add-in generator, Lisp variables, Customizations
1632 @comment node-name, next, previous, up
1633 @section Add-in functions
1634 @cindex add-in functions
1635 @cindex yatexadd.el
1637 You can easily define a function to input detailed arguments
1638 with completion according to La@TeX{} environments or commands.
1640 @c @node What is add-in functions?, , Add-in functions, Add-in functions
1641 @comment node-name, next, previous, up
1642 @subsection What is add-in functions?
1643 @cindex tabular
1645 When you input @code{tabular} environment, don't you think ``I want
1646 YaTeX to complete its argument toward my favorite one such as
1647 @code{@{|c|c|c|@}}...''? Yes, you can define the function to complete
1648 arguments for any environment and any La@TeX{} commands.
1650 @subsection Procedure
1652 Here is the procedure to define add-in functions.
1653 @enumerate
1654 @item
1655 Define the function
1656 @item
1657 Put the function into @file{yatexhks.el}
1658 @end enumerate
1660 @menu
1661 * How the add-in function works?::
1662 * How the function is called::
1663 * Useful functions for creating add-in::
1664 * Contribution::
1665 @end menu
1667 @node How the add-in function works?, How the function is called, Add-in functions, Add-in functions
1668 @comment node-name, next, previous, up
1669 @subsection How the add-in function works?
1671 There are two kinds of add-in. @dfn{Option add-in} returns the
1672 La@TeX{}'s optional parameters such as optional strings after
1673 @code{\begin@{ENV@}}, optional strings between a section-type command
1674 and its first argument, and optional strings just after type
1675 maketitle-type command. The following illustrates the name of add-in
1676 functions, where underlined strings are generated by add-in functions.
1678 @display
1679 \begin{table}[ht] (Function name: YaTeX:table)
1680 ~~~~
1681 \put(100,200){} (Function name: YaTeX:put)
1682 ~~~~~~~~~
1683 \sum_{i=0}^{n} (Function name: YaTeX:sum)
1684 ~~~~~~~~~~
1685 @end display
1687 Obviously, the function name is decided by concatenating the prefix
1688 `YaTeX:' and La@TeX{} command's name.
1690 Another add-in type is @dfn{argument add-in}, which completes arguments
1691 for section-type commands.
1693 @display
1694 \newcommand{\foo}{bar} (Function name: YaTeX::newcommand)
1695 ~~~~ ~~~
1696 @end display
1698 When the section-type command is inputted, the function named by
1699 concatenating `YaTeX::' and section-type command, is called automatically
1700 with an integer argument which indicates which argument of section-type
1701 command is being read. Thus the add-in should determine the
1702 job referring the value of its argument.
1704 @menu
1705 * Defining `option add-in'::
1706 * Defining `argument add-in'::
1707 @end menu
1709 @node Defining `option add-in', Defining `argument add-in', How the add-in function works?, How the add-in function works?
1710 @comment node-name, next, previous, up
1711 @subsubsection Defining `option add-in'
1713 If you want @code{@{|c|c|c|@}} for all @code{tabular} environment,
1715 @lisp
1716 (defun YaTeX:tabular ()
1717 "{|c|c|c|}")
1718 @end lisp
1720 @noindent
1721 is enough. If you want more complicated format, define as below.
1723 @lisp
1724 (defun YaTeX:tabular ()
1725 "@{@@@{\\vrule width 1pt\\ @}|||@@@{\\ \\vrule width 1pt@}@}")
1726 @end lisp
1728 @noindent
1729 Note that the character @code{\} must be described as @code{\\} in
1730 Emacs-Lisp. The next example reads the tabular format from keyboard.
1731 @lisp
1732 (defun YaTeX:tabular ()
1733 (concat "{" (read-string "Rule: ") "}"))
1734 @end lisp
1736 @node Defining `argument add-in', , Defining `option add-in', How the add-in function works?
1737 @comment node-name, next, previous, up
1738 @subsubsection Defining `argument add-in'
1740 This section describes how to define the add-in function for
1741 @code{\newcommand}.
1743 The first argument of @code{\newcommand} begins always with @code{\}.
1744 The second argument is usually so complex that we can not edit them in the
1745 minibuffer. Here is the created function considering this.
1747 @lisp
1748 (defun YaTeX::newcommand (n) ;n is argument position
1749 (cond
1750 ((= n 1) ;1st argument is macro name
1751 (read-string "Command: " "\\")) ;initial input `\'
1752 ((= n 2) "") ;do nothing when reading arg#2
1753 (t nil)))
1754 @end lisp
1756 Note that when the `argument add-in' function return `nil', normal
1757 argument reader will be called.
1759 @node How the function is called, Useful functions for creating add-in, How the add-in function works?, Add-in functions
1760 @comment node-name, next, previous, up
1761 @subsection How the function is called
1763 YaTeX calls the add-in functions for specified begin-type, section-type,
1764 and maketitle-type command, if any. `Option add-in' functions for
1765 begin-type are called when @code{\begin@{ENV@}} has been inserted,
1766 functions for section-type are called just before input of the first
1767 argument, and functions for maketitle-type is called after maketitle-type
1768 command has been inserted. `Argument add-in' functions are called at each
1769 entry of arguments for section-type commands.
1771 @node Useful functions for creating add-in, Contribution, How the function is called, Add-in functions
1772 @comment node-name, next, previous, up
1773 @subsection Useful functions for creating add-in
1775 Many add-in functions for typical La@TeX{} commands are defined in
1776 @file{yatexadd.el}. Those are also useful as references. Here are the
1777 short descriptions on useful functions, where [F] means function, [A]
1778 means arguments, [D] means description.
1780 @itemize
1781 @item [F]
1782 YaTeX:read-position
1783 @itemx [A]
1784 Character list which can show up in the brackets
1785 @itemx [D]
1786 Return the location specifier such as `[htb]'. When
1787 nothing is entered, omit [] itself. If the possible characters
1788 are "htbp", call this function as
1789 @code{(YaTeX:read-position "htbp")}
1791 @item [F]
1792 YaTeX:read-coordinates
1793 @itemx [A]
1794 Base prompt, X-axis prompt, Y-axis prompt (each optional)
1795 @itemx [D]
1796 Read the coordinates with the prompt ``BasePrompt X-axisPrompt:'' for
1797 X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form
1798 of ``(X,Y)''. The default prompts are @code{Dimension}, @code{X},
1799 @code{Y} respectively.
1801 @item [F]
1802 YaTeX:check-completion-type
1803 @itemx [A]
1804 One of the symbols: 'begin, 'section, or 'maketitle
1805 @itemx [D]
1806 Check the current completion type is specified one and cause error if
1807 not. The variable @code{YaTeX-current-completion-type} holds the symbol
1808 according to the current completion type.
1809 @end itemize
1811 @node Contribution, , Useful functions for creating add-in, Add-in functions
1812 @comment node-name, next, previous, up
1813 @subsection Contribution
1815 If you make your own pretty function and you let it be in public, please
1816 send me the function. I'm going to include it in the next release.
1818 @node Add-in generator, , Add-in functions, Customizations
1819 @comment node-name, next, previous, up
1820 @section Add-in generator
1822 First, don't forget to read the section of add-in functions @ref{Add-in
1823 functions}. If you easily understand how to define them, there's no need
1824 to read this section. But being not familiar with Emacs-Lisp, when you
1825 don't have clear idea what to do, this section describes how to get YaTeX
1826 make add-in function.
1828 There are two methods of generation. One is for fully interactive
1829 generator for beginners and another requires little knowledge of
1830 Emacs-Lisp.
1832 @subsection Generator for beginners
1833 The former generator is called by
1834 @center @kbd{M-x YaTeX-generate}
1836 @noindent
1837 strokes. All you have to do is follow the guidances. Defying them may cases
1838 the disaster (I wonder what is it???). So when you make some mistake, it
1839 is recommendable to type @kbd{C-g} and start afresh.
1841 @subsection Simple generator
1843 The latter generator is invoked by the next sequence.
1844 @center @kbd{M-x YaTeX-generate-simple}
1845 This generator can make both ``option add-in'' and ``argument add-in''
1846 (@emph{refer the section add-in functions}
1847 @ref{How the add-in function works?}), whereas @code{YaTeX-generate}
1848 cannot make ``argument addin''.
1850 For example, assume you have the LaTeX command as follows.
1852 @example
1853 \epsinput[t](250,50){hoge.eps}{plain}{Picture of foo}
1854 (A) (B) (1) (2) (3)
1855 (A)Optional parameter to specify the position
1856 One of t(top), b(bottom), l(left), r(right)
1857 (B)Maximum size of frame
1858 (1)1st argument is filename of EPS file
1859 (2)2nd argument indicates
1860 plain do nothing
1861 frame make frame around image
1862 dframe make double-frame around image
1863 for included EPS file.
1864 (3)Caption for the picture
1865 @end example
1867 Now get start with generation. Typing @kbd{M-x YaTeX-generate-simple}
1868 brings the prompt:
1869 @display
1870 (O)ption? (A)rgument?
1871 @end display
1873 @subsubsection Generating ``option add-in''
1874 @cindex option add-in
1876 Since (A), (B) above are optional argument, all we have to do to
1877 complete them is define the option add-in for them. Let's generate the
1878 function to complete (A).
1880 @display
1881 M-x YaTeX-generate-simple RET
1882 epsinput RET
1884 @end display
1886 @noindent
1887 Typing as above leads the next prompt.
1889 @display
1890 Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit
1891 @end display
1893 @noindent
1894 This asks that ``Which type is the completion style of 1st argument?''.
1895 Here are the possible completion style.
1897 @table @code
1898 @item String
1899 read plain string
1900 @item Complete
1901 read with completion
1902 @item File
1903 read file name
1904 @item Option
1905 read optional string (if string omitted, omit [] too)
1906 @item Position
1907 read positional option (like [htbp])
1908 @item Coord.
1909 read coordinates
1910 @item Quit
1911 quit from generating
1912 @end table
1914 Since (A) is the optional argument to specify the location of included
1915 EPS file, the completion style is @code{Position}, and the possible
1916 characters are t, b, l, and r. To tell these information to generator,
1917 operate as follows.
1919 @display
1920 Read type(1).... p
1921 Acceptable characters: tblr RET
1922 @end display
1924 (B) is coordinate. So its completion style is coOrd. We want a prompt
1925 meaning ``Maximum size'' when completion.
1927 @display
1928 Read type(2).... o
1929 Prompt for coordinates: Max size RET
1930 @end display
1932 That's all for optional argument. Select quit.
1934 @display
1935 Read type(3).... q
1936 @end display
1938 Then the generated option add-in function for \epsinput will be shown in
1939 the next window.
1941 @subsubsection Generating ``argument add-in''
1942 @cindex argument add-in
1944 Next, create the argument add-in. The arguments for \epsinput are EPS
1945 file name, framing style, and caption string in sequence.
1947 @display
1948 M-x YaTeX-generate-simple RET
1949 epsinput RET
1951 @end display
1953 Above key strokes bring the prompt that asks the number of argument.
1954 Answer it with 3.
1956 @display
1957 How many arguments?: 3 RET
1958 @end display
1960 Then the generator asks the completion style and prompt for completion.
1961 Answer them. @kbd{f} for FileName and prompt string.
1963 @display
1964 Read type(1).... f
1965 Prompt for argument#1 EPS file name RET
1966 @end display
1968 The second argument is one of selected symbol. So the completion type
1969 is @code{Completion}.
1971 @display
1972 Read type(2).... c
1973 Prompt for argument#2 Include style RET
1974 @end display
1976 Then all the candidates ready to be read. Type single RET after
1977 entering all.
1979 @display
1980 Item[1](RET to exit): plain RET
1981 Item[2](RET to exit): frame RET
1982 Item[3](RET to exit): dframe RET
1983 Item[4](RET to exit): RET
1984 @end display
1986 The following prompt asks whether the entered string must belong to
1987 candidates or not. In this case, since the argument must be one of
1988 @code{plain}, @code{frame}, and @code{dframe}, type @code{y}.
1990 @display
1991 Require match? (y or n) y
1992 @end display
1994 The last argument is the caption string for which any completion is
1995 needed.
1997 @display
1998 Read type(3).... s
1999 Prompt for argument#3 Caption RET
2000 default: Figure of RET
2001 @end display
2003 Finally we'll get the argument add-in in the next window.
2005 @subsection Contribution
2007 If you get your own pretty function and you let it be in public, please
2008 steel yourself in the happy atmosphere and do not send me the function.
2009 I do know it is not fine because it is generated by yatexgen:-p.
2011 @node Etcetera, Copying, Customizations, Top
2012 @comment node-name, next, previous, up
2013 @chapter Etcetera
2015 The standard completion tables provided in @file{yatex.el} contain a
2016 few La@TeX{} commands I frequently use. This is to lessen the key
2017 strokes to complete entire word, because too many candidates
2018 rarely used often cause too many hits. Therefore always try to
2019 use completion in order to enrich your dictionary, and you will
2020 also find `Wild Bird' growing suitable for your La@TeX{} style.
2022 The package name `Wild Bird' is the English translation of Japanese
2023 title `Yachou', which is a trick on words of Japanese.
2025 @node Copying, , Etcetera, Top
2026 @comment node-name, next, previous, up
2027 @chapter Copying
2029 This program is distributed as a free software. You can
2030 redistribute this software freely but with NO warranty to anything
2031 as a result of using this software. However, any reports and
2032 suggestions are welcome as long as I feel interests in this
2033 software. My possible e-mail address is `yuuji@@ae.keio.ac.jp'.
2034 (up to Mar.1995 at least)
2036 The specification of this software will be surely modified
2037 (depending on my feelings) without notice :-p.
2040 @flushright
2041 HIROSE Yuuji
2042 @end flushright
2043 @bye
2045 Local variables:
2046 mode: texinfo
2047 fill-prefix: nil
2048 fill-column: 74
2049 End: