yatex

view docs/yatexe.tex @ 49:eb0512bfcb7f

Abolish user-article table. Use normal read-string instead. Supply smart add-in function for documentstyle. Update user dictionary whenever new words entered. Enhance [prefix] c. Allow user defined sectioning commands in yatexsec.
author yuuji
date Fri, 25 Nov 1994 08:26:13 +0000
parents a0640ff3f72f
children b0371b6ed799
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?::
29 * Main features::
30 * Installation::
31 * Typesetting::
32 * %# notation::
33 * Completion::
34 * Local dictionaries::
35 * Commenting out::
36 * Cursor jump::
37 * Changing and Deleting::
38 * Filling an item::
39 * Updation of @code{\includeonly}::
40 * What column?::
41 * Intelligent newline::
42 * Online help::
43 * Cooperation with other packages::
44 * Customizations::
45 * Etcetera::
46 * Copying::
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. And if you split the source text and
269 edit subfile that should be included from main text.
271 @example
272 %#!latex main.tex
273 @end example
275 @noindent
276 will be helpful to execute latex on main file from sub text buffer. Since
277 this command line after @kbd{%#!} will be sent to shell literally, next
278 description makes it convenient to use ghostview as dvi-previewer.
280 @example
281 %#!latex main ; dvi2ps main.dvi > main
282 @end example
284 @noindent
285 Note that YaTeX assumes the component before the last period of
286 the last word in this line as base name of the main La@TeX{} source.
288 Here are the restrictions on splitting sources.
290 @itemize
291 @item All the file name should be different.
292 @item You can put split texts in sub directory, but not in
293 sub directory of sub directory.
294 @item In the main text,specify the file with relative path name
295 such as \include{chap1/sub}, when you include the file in
296 a sub-directory.
297 @item In a sub-text, write @code{%#!latex main.tex} even if @file{main.tex}
298 is in the parent directory(not %#!latex ../main.tex).
299 @end itemize
301 @node Static region for typesetting, Lpr format, Changing typesetter, %# notation
302 @comment node-name, next, previous, up
303 @section Static region
304 @cindex static region
305 @cindex Fixed region
307 Typeset-region by @kbd{[prefix] tr} passes the region between point and
308 mark to typesetting command by default. But when you want to typeset
309 static region, enclose the region by @code{%#BEGIN} and @code{%#END} as
310 follows.
312 @example
313 %#BEGIN
314 TheRegionYouWantToTypesetManyTimes
315 %#END
316 @end example
318 This is the rule of deciding the region.
320 @enumerate
321 @item
322 If there exists %#BEGIN before point,
324 @enumerate
325 @item
326 If there exists %#END after %#BEGIN,
327 @itemize
328 @item From %#BEGIN to %#END.
329 @end itemize
331 @item
332 If %#END does not exist after %#BEGIN,
333 @itemize
334 @item From %#BEGIN to the end of buffer.
335 @end itemize
336 @end enumerate
338 @item
339 If there does not exist %#BEGIN before point,
340 @itemize
341 @item Between point and mark(standard method of Emacs).
342 @end itemize
343 @end enumerate
345 It is useful to write @code{%#BEGIN} in the previous line of \begin and
346 @code{%#END} in the next line of \@code{end} when you try complex
347 environment such as `tabular' many times. It is also useful to put only
348 @code{%#BEGIN} alone at the middle of very long text. Do not forget to
349 erase @code{%#BEGIN} @code{%#END} pair.
351 @node Lpr format, Editing %# notation, Static region for typesetting, %# notation
352 @comment node-name, next, previous, up
353 @section Lpr format
354 @cindex lpr format
356 Lpr format is specified by three Lisp variables. Here are the
357 default values of them.
359 @table @code
360 @item (1)dviprint-command-format
361 @code{"dvi2ps %f %t %s | lpr"}
362 @item (2)dviprint-from-format
363 @code{"-f %b"}
364 @item (3)dviprint-to-format
365 @code{"-t %e"}
366 @end table
368 On YaTeX-lpr, @code{%s} in (1) is replaced by the file name of main
369 text, @code{%f} by contents of (2), %t by contents of (3). At these
370 replacements, @code{%b} in (2) is also replaced by the number of beginning
371 page, @code{%e} in (3) is replaced by the number of ending page. But
372 @code{%f} and @code{%t} are ignored when you omit the range of print-out
373 by @kbd{C-u [prefix] tl}.
375 If you want to change this lpr format temporarily, put a command
376 such as follows somewhere in the text:
378 @example
379 %#LPR dvi2ps %f %t %s | 4up -page 4 | texfix | lpr -Plp2
380 @end example
382 And if you want YaTeX not to ask you the range of printing
383 out, the next example may be helpful.
385 @example
386 %#LPR dvi2ps %s | lpr
387 @end example
389 @node Editing %# notation, , Lpr format, %# notation
390 @comment node-name, next, previous, up
391 @section Editing %# notation
393 To edit @code{%#} notation described above, type
395 @table @kbd
396 @item [prefix] %
397 @dots{} editing %# notation menu
398 @end table
400 @noindent
401 and select one of the entry of the menu as follows.
403 @example
404 !)Edit-%#! B)EGIN-END-region L)Edit-%#LPR
405 @end example
407 @noindent
408 Type @kbd{!} to edit @code{%#!} entry, @code{b} to enclose the region with
409 @code{%#BEGIN} and @code{%#END}, and @code{l} to edit @code{%#LPR} entry.
410 When you type @kbd{b}, all @code{%#BEGIN} and @code{%#END} are
411 automatically erased.
413 @node Completion, Local dictionaries, %# notation, Top
414 @comment node-name, next, previous, up
415 @chapter Completion
416 @cindex completion
418 YaTeX makes it easy to input the La@TeX{} commands. There are several
419 kinds of completion type, begin-type, section-type, large-type, etc...
421 @menu
422 * Begin-type completion::
423 * Section-type completion::
424 * Large-type completion::
425 * Maketitle-type completion::
426 * Arbitrary completion::
427 * End completion::
428 * Accent completion::
429 * Image completion::
430 * Greek letters completion::
431 @end menu
433 @node Begin-type completion, Section-type completion, Completion, Completion
434 @comment node-name, next, previous, up
435 @section Begin-type completion
436 @cindex begin-type completion
437 @cindex environment
438 @cindex prefix b
440 "Begin-type completion" completes commands of @code{\begin@{env@}} ...
441 @code{\end@{env@}}. All of the begin-type completions begin with this key
442 sequence.
444 @table @kbd
445 @item [prefix] b
446 @dots{} start begin-type completion
447 @end table
449 @noindent
450 An additional key stroke immediately completes a frequently used
451 La@TeX{} @code{\begin@{@}}...@code{\@code{end}@{@}} environment.
453 @table @kbd
454 @item [prefix] b c
455 @dots{} @code{\begin@{center@}...\end@{center@}}
456 @item [prefix] b d
457 @dots{} @code{\begin@{document@}...\end@{document@}}
458 @item [prefix] b D
459 @dots{} @code{\begin@{description@}...\end@{description@}}
460 @item [prefix] b e
461 @dots{} @code{\begin@{enumerate@}...\end@{enumerate@}}
462 @item [prefix] b E
463 @dots{} @code{\begin@{equation@}...\end@{equation@}}
464 @item [prefix] b i
465 @dots{} @code{\begin@{itemize@}...\end@{itemize@}}
466 @item [prefix] b l
467 @dots{} @code{\begin@{flushleft@}...\end@{flushleft@}}
468 @item [prefix] b m
469 @dots{} @code{\begin@{minipage@}...\end@{minipage@}}
470 @item [prefix] b t
471 @dots{} @code{\begin@{tabbing@}...\end@{tabbing@}}
472 @item [prefix] b T
473 @dots{} @code{\begin@{tabular@}...\end@{tabular@}}
474 @item [prefix] b^T
475 @dots{} @code{\begin@{table@}...\end@{table@}}
476 @item [prefix] b p
477 @dots{} @code{\begin@{picture@}...\end@{picture@}}
478 @item [prefix] b q
479 @dots{} @code{\begin@{quote@}...\end@{quote@}}
480 @item [prefix] b Q
481 @dots{} @code{\begin@{quotation@}...\end@{quotation@}}
482 @item [prefix] b r
483 @dots{} @code{\begin@{flushright@}...\end@{flushright@}}
484 @item [prefix] b v
485 @dots{} @code{\begin@{verbatim@}...\end@{verbatim@}}
486 @item [prefix] b V
487 @dots{} @code{\begin@{verse@}...\end@{verse@}}
488 @end table
490 Any other La@TeX{} environments are made by completing-read of the
491 Emacs function.
493 @table @kbd
494 @item [prefix] b SPACE
495 @dots{} begin-type completion
496 @end table
498 @noindent
499 The next message will show up in the minibuffer
501 @example
502 Begin environment(default document):
503 @end example
505 @noindent
506 by typing @kbd{[prefix] b}. Put the wishing environment with completion
507 in the minibuffer, and @code{\begin@{env@}}...\@code{\end@{env@}} will be
508 inserted in the La@TeX{} source text. If the environment you want to put
509 does not exist in the YaTeX completion table, it will be registered in the
510 user completion table. YaTeX automatically saves the user completion
511 table in the user dictionary file at exiting of emacs.
513 If you want to enclose some paragraphs which have already been
514 written, invoke the begin-type completion with changing the case
515 of @kbd{b} of key sequence upper(or invoke it with universal argument
516 by @kbd{C-u} prefix).
517 @cindex enclose region into environment
519 The following example encloses a region with `description'
520 environment.
522 @table @kbd
523 @item [prefix] B D
524 @itemx (or ESC 1 [prefix] b D)
525 @itemx (or C-u [prefix] b D)
527 @dots{} begin-type completion for region
528 @end table
530 This enclosing holds good for the completing input by @kbd{[prefix] b
531 SPC}. @kbd{[prefix] B SPC} enclose a region with the environment selected
532 by completing-read.
534 @node Section-type completion, Large-type completion, Begin-type completion, Completion
535 @comment node-name, next, previous, up
536 @section Section-type completion
537 @cindex section-type completion
538 @cindex prefix s
540 "Section-type completion" completes section-type commands which take an
541 argument or more such as @code{\section@{foo@}}. To invoke section-type
542 completion, type
544 @table @kbd
545 @item [prefix] s
546 @dots{} section-type completion
547 @end table
549 @noindent
550 then the prompt
552 @example
553 (C-v for view) \???@{@} (default documentstyle):
554 @end example
556 @noindent
557 will show up in the minibuffer. Section-type La@TeX{} commands are
558 completed by space key, and the default value is selected when you
559 type nothing in the minibuffer.
561 Next,
563 @example
564 \section@{???@}:
565 @end example
567 @noindent
568 prompts you the argument of section-type La@TeX{} command. For
569 example, the following inputs
571 @example
572 \???@{@} (default documentstyle): section
573 \section{???}: Hello world.
574 @end example
576 @noindent
577 will insert the string
579 @example
580 \section@{Hello world.@}
581 @end example
583 in your La@TeX{} source. When you neglect argument such as
585 @example
586 (C-v for view) \???@{@} (default section): vspace*
587 \vspace*@{???@}:
588 @end example
590 YaTeX puts
592 @example
593 \vspace*@{@}
594 @end example
596 @noindent
597 and move the cursor in the braces.
599 In La@TeX{} command, there are commands which take more than one
600 arguments such as @code{\addtolength{\topmargin}{8mm}}. To complete these
601 commands, invoke section-type completion with universal argument as,
602 @cindex number of argument
604 @example
605 C-u 2 [prefix] s (or ESC 2 [prefix] s)
606 @end example
608 @noindent
609 and make answers in minibuffer like this.
611 @example
612 (C-v for view) \???@{@} (default vspace*): addtolength
613 \addtolength@{???@}: \topmargin
614 Argument 2: 8mm
615 @end example
617 @code{\addtolength} and the first argument @code{\topmargin} can be typed
618 easily by completing read. Since YaTeX also learns the number of
619 arguments of section-type command and will ask that many arguments in
620 future completion, you had better tell the number of arguments to YaTeX at
621 the first completion of the new word. But you can change the number of
622 arguments by calling the completion with different universal argument
623 again.
626 Invoking section-type completion with @code{[Prefix] S} (Capital `S')
627 includes the region as the first argument of section-type command.
629 The section/large/maketitle type completion can work at the
630 prompt for the argument of other section-type completion.
631 Nested La@TeX{} commands are efficiently read with the recursive
632 completion by typing YaTeX's completion key sequence in the
633 minibuffer.
635 @menu
636 * view-sectioning::
637 @end menu
639 @node view-sectioning, , Section-type completion, Section-type completion
640 @comment node-name, next, previous, up
641 @subsection view-sectioning
642 @cindex view sectioning
643 @cindex outline
645 In the minibuffer at the prompt of section-type command completion,
646 typing @kbd{C-v} shows a list of sectioning commands in source text(The
647 line with @code{<<--} mark is the nearest sectioning command). Then,
648 default sectioning command appears in the minibuffer. You can go up/down
649 sectioning command by typing @kbd{C-p}/@kbd{C-n}, can scrolls up/down the
650 listing buffer by @kbd{C-v}/@kbd{M-v}, and can hide sectioning commands
651 under certain level by 0 through 6. Type @kbd{?} in the minibuffer of
652 sectioning prompt for more information.
654 @node Large-type completion, Maketitle-type completion, Section-type completion, Completion
655 @comment node-name, next, previous, up
656 @section Large-type completion
658 "Large-type completion" inputs the font or size changing
659 descriptions such as @code{@{\large @}}. When you type
661 @table @kbd
662 @item [prefix] l
663 @dots{} large-type completion
664 @end table
666 @noindent
667 the message in the minibuffer
669 @example
670 @{\??? @} (default large):
671 @end example
673 prompts prompts you large-type command with completing-read. There are
674 TeX commands to change fonts or sizes, @code{it}, @code{huge} and so on,
675 in the completion table.
677 Region-based completion is also invoked by changing the letter after
678 prefix key stroke as @kbd{[prefix] L}. It encloses the region by braces
679 with large-type command.
681 @node Maketitle-type completion, Arbitrary completion, Large-type completion, Completion
682 @comment node-name, next, previous, up
683 @section Maketitle-type completion
684 @cindex maketitle-type completion
686 We call it "maketitle-type completion" which completes commands such as
687 @code{\maketitle}. Take notice that maketitle-type commands take no
688 arguments. Then, typing
690 @table @kbd
691 @item [prefix] m
692 @dots{} maketitle-type completion
693 @end table
695 @noindent
696 begins maketitle-completion. Above mentioned method is true for
697 maketitle-completion, and there are La@TeX{} commands with no
698 arguments in completion table.
700 @node Arbitrary completion, End completion, Maketitle-type completion, Completion
701 @comment node-name, next, previous, up
702 @section Arbitrary completion
703 @cindex arbitrary completion
705 @noindent
706 You can complete certain La@TeX{} command anywhere without typical
707 completing method as described, by typing
709 @table @kbd
710 @item [prefix] SPC
711 @dots{} arbitrary completion
712 @end table
714 @noindent
715 after the initial string of La@TeX{} command that is preceded by @code{\}.
717 @node End completion, Accent completion, Arbitrary completion, Completion
718 @comment node-name, next, previous, up
719 @section End completion
720 @cindex end completion
722 @noindent
723 YaTeX automatically detects the opened environment and close it with
724 \@code{\end@{environment@}}. Though proficient YaTeX users never fail to
725 make environment with begin-type completion, some may begin an environment
726 manually. In that case, type
728 @table @kbd
729 @item [prefix] e
730 @dots{} @code{end} completion
731 @end table
733 @noindent
734 at the end of the opened environment.
736 @node Accent completion, Image completion, End completion, Completion
737 @comment node-name, next, previous, up
738 @section Accent completion
739 @cindex accent completion
741 When you want to write the European accent marks(like @code{\`@{o@}}),
743 @table @kbd
744 @item [prefix] a
745 @dots{} accent completion
746 @end table
748 @noindent
749 shows the menu
751 @example
752 1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b
753 @end example
755 @noindent
756 in the minibuffer. Chose one character or corresponding numeric,
757 and you will see
759 @example
760 \`{}
761 @end example
763 @noindent
764 in the editing buffer with the cursor positioned in braces. Type
765 one more character `o' for example, then
767 @example
768 \`{o}
769 @end example
771 @noindent
772 will be completed, and the cursor gets out from braces.
774 @node Image completion, Greek letters completion, Accent completion, Completion
775 @comment node-name, next, previous, up
776 @section Image completion of mathematical sign
777 @cindex image completion
778 @cindex math-mode
779 @cindex sigma
780 @cindex leftarrow
781 @cindex ;
783 Arrow marks, sigma mark and those signs mainly used in the
784 TeX's math environment are completed by key sequences which
785 imitate the corresponding symbols graphically. This completion
786 only works in the math environment. YaTeX automatically detects
787 whether the cursor located in math environment or not, and
788 change the behavior of key strokes @kbd{;} and @kbd{/}.
790 By the way, we often express the leftarrow mark by `<-' for example.
791 Considering such image, you can write @code{\leftarrow} by typing @kbd{<-}
792 after @kbd{;} (semicolon) as a prefix. In the same way,
793 @code{\longleftarrow} (@code{<--}) is completed by typing @kbd{;<--},
794 infinity mark which is imitated by @code{oo} is completed by typing
795 @kbd{;oo}.
797 Here are the sample operations in YaTeX math-mode.
799 @example
800 INPUT Completed La@TeX{} commands
801 ; < - @code{\leftarrow}
802 ; < - - @code{\longleftarrow}
803 ; < - - > @code{\longleftrightarrow}
804 ; o @code{\circ}
805 ; o o @code{\infty}
806 @end example
808 In any case, you can quit from image completion and can move
809 to the next editing operation if the La@TeX{} command you want is
810 shown in the buffer.
812 @code{;} itself in math-environment is inserted by @kbd{;;}. Typing
813 @kbd{TAB} in the midst of image completion shows all of the La@TeX{}
814 commands that start with the same name as string you previously typed in.
815 In this menu buffer, press @kbd{RET} after moving the cursor (by @kbd{n},
816 @kbd{p}, @kbd{b}, @kbd{f}) to insert the La@TeX{} command.
818 To know all of the completion table, type @kbd{TAB} just after @kbd{;}.
819 And here is the sample menu by @kbd{TAB} after @kbd{;<}.
821 @example
822 KEY LaTeX sequence sign
823 < \leq <
824 ~
825 << \ll <<
826 <- \leftarrow <-
827 <= \Leftarrow <=
828 @end example
830 You can define your favorite key-vs-sequence completion table in the
831 Emacs-Lisp variable @code{YaTeX-math-sign-alist-private}. See also
832 @file{yatexmth.el} for the information of the structure of this variable.
834 @node Greek letters completion, , Image completion, Completion
835 @comment node-name, next, previous, up
836 @section Greek letters completion
837 @cindex Greek letters completion
838 @cindex /
840 Math-mode of YaTeX provides another image completion, Greek letters
841 completion in the same method. After prefix @kbd{/}, typing @kbd{a} makes
842 @code{\alpha}, @kbd{b} makes @code{\beta} and @kbd{g} makes @code{\gamma}
843 and so on. First, type @kbd{/TAB} to know all the correspondence of
844 alphabets v.s. Greek letters.
846 If you will find @kbd{;} or @kbd{/} doesn't work in correct position of
847 math environment, it may be a bug of YaTeX. Please send me a bug report
848 with the configuration of your text, and avoid it temporarily by typing
849 @kbd{;} or @kbd{/} after universal-argument(@kbd{C-u}) which forces
850 @kbd{;} and @kbd{/} to work as math-prefix.
852 @node Local dictionaries, Commenting out, Completion, Top
853 @comment node-name, next, previous, up
854 @chapter Local dictionaries
855 @cindex local dictionaries
856 @cindex nervous users
858 Tables for completion consist of three dictionaries; `standard
859 dictionary' built in @file{yatex.el}, `user dictionary' for your common
860 private commands, and `local dictionary' that is effective in a certain
861 directory.
863 When you input the command unknown to YaTeX at a completion in the
864 minibuffer, YaTeX asks you with the following prompt;
866 @example
867 `foo' is not in table. Register into: U)serTable L)ocal N)one
868 @end example
870 @noindent
871 In this menu, typing `u' updates your `user dictionary', `l' updates your
872 local dictionary, and `n' updates no dictionary and throws the word away.
874 If you find this switching feature meaningless and bothersome, put the
875 next expression into your @file{~/.emacs}
877 @lisp
878 (setq YaTeX-nervous nil)
879 @end lisp
881 @node Commenting out, Cursor jump, Local dictionaries, Top
882 @comment node-name, next, previous, up
883 @chapter Commenting out
884 @cindex commenting out
885 @cindex prefix >
886 @cindex prefix <
887 @cindex prefix ,
888 @cindex prefix .
890 You may want to comment out some region.
892 @table @kbd
893 @item [prefix] >
894 @dots{} comment out region by %
895 @item [prefix] <
896 @dots{} uncomment region
897 @end table
899 @noindent
900 cause an operation to the region between point and mark.
902 @table @kbd
903 @item [prefix] .
904 @dots{} comment out current paragraph
905 @item [prefix] ,
906 @dots{} uncomment current paragraph
907 @end table
909 @noindent
910 comments or uncomments the paragraph where the cursor belongs.
911 This `paragraph' means the region marked by the function
912 mark-paragraph, bound to @kbd{ESC h} by default. It is NOT
913 predictable what will happen when you continuously comment out
914 some paragraph many times.
916 You can also comment out an environment between @code{\begin} and
917 @code{\end}, or a @code{\begin}-\@code{\end} pair themselves, by making the
918 following key strokes on the line where @code{\begin@{@}} or
919 @code{\end@{@}} exists.
921 @table @kbd
922 @item [prefix] >
923 @dots{} comment out from \begin to \@code{end}
924 @item [prefix] <
925 @dots{} uncomment from \begin to \@code{end}
926 @end table
928 @noindent
929 comment whole the contents of environment. Moreover,
931 @table @kbd
932 @item [prefix] .
933 @dots{} comment out \begin and \@code{end}
934 @item [prefix] ,
935 @dots{} uncomment \begin and \@code{end}
936 @end table
938 @noindent
939 (un)comments out only environment declaration: @code{\begin@{@}} and
940 @code{\end@{@}}. NOTE that even if you intend to comment out some region,
941 invoking @kbd{[prefix] >} on the @code{\begin},@code{\end} line decides to
942 work in `commenting out from @code{\begin} to @code{\end}' mode.
945 @node Cursor jump, Changing and Deleting, Commenting out, Top
946 @comment node-name, next, previous, up
947 @chapter Cursor jump
948 @cindex cursor jump
949 @cindex prefix g
951 Typing
953 @table @kbd
954 @item [prefix] g
955 @dots{} go to corresponding object
956 @end table
958 @noindent
959 in a certain place move the cursor to the place corresponding to the
960 La@TeX{} command of last place. YaTeX recognize the followings as pairs
961 that have relation each other.
963 @itemize @bullet
964 @item @code{\begin@{@}} <-> @code{\end@{@}}
965 @item @code{%#BEGIN} <-> @code{%#END}
966 @item @code{\label@{@}} <-> @code{\ref@{@}}
967 @item @code{\include(\input)} -> included file
968 @item @code{\bibitem@{@}} <-> @code{\cite@{@}}
969 @end itemize
971 On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the
972 cursor to the corresponding @code{\end},@code{\begin} line, if its partner
973 really exists. The behaviour on the line @code{%#BEGIN} and @code{%#END}
974 are the same. Note that if the correspondent of @code{label/ref} or
975 @code{cite/bibitem} exists in another file, that file have to be opend to
976 make a round trip between references by @kbd{[prefix] g}.
978 If you type @code{[prefix] g} on the line of @code{\include@{chap1@}},
979 typically in the main text, YaTeX switches buffer to @file{chap1.tex}.
980 The key strokes below work to the contrary. Typing
982 @table @kbd
983 @item [prefix] ^
984 @dots{} visit main file
985 @item [prefix] 4^
986 @dots{} visit main file in other buffer
987 @end table
988 @cindex prefix ^
989 @cindex prefix 4 ^
991 in a sub text switch the buffer to the main text specified by
992 @code{%#!} notation.
994 And these are the functions which work on the current La@TeX{}
995 environment:
997 @table @kbd
998 @item M-C-a
999 @dots{} beginning of environment
1000 @item M-C-e
1001 @dots{} @code{end} of environment
1002 @item M-C-@@
1003 @dots{} mark environment
1004 @end table
1005 @cindex M-C-a
1006 @cindex M-C-e
1007 @cindex M-C-@@
1009 @node Changing and Deleting, Filling an item, Cursor jump, Top
1010 @comment node-name, next, previous, up
1011 @chapter Changing and Deleting
1013 These functions are for change or deletion of La@TeX{} commands
1014 already entered.
1016 @table @kbd
1017 @item [prefix] c
1018 @dots{} change La@TeX{} command
1019 @item [prefix] k
1020 @dots{} kill La@TeX{} command
1021 @end table
1022 @cindex prefix c
1023 @cindex prefix k
1025 @menu
1026 * Changing La@TeX{} commands::
1027 * Killing La@TeX{} commands::
1028 @end menu
1030 @node Changing La@TeX{} commands, Killing La@TeX{} commands, Changing and Deleting, Changing and Deleting
1031 @comment node-name, next, previous, up
1032 @section Changing La@TeX{} commands
1034 @kbd{[prefix] c} can change the various (La)@TeX{} commands. This can
1035 change the followings.
1036 @itemize @bullet
1037 @item Environment names
1038 @item Section-type commands
1039 @item Argument of section-type commands
1040 @item Optional parameters (enclosed by []) of section-type commands
1041 @item Font/size designators
1042 @end itemize
1044 Typing @kbd{[prefix] c} on one of above objects you want to change
1045 brings a suitable reading function sometimes with completion.
1046 Note: If you want to change the argument of section-type command that
1047 contains other La@TeX{} commands, type @kbd{[prefix] c} either of
1048 surrounding braces of the argument in order to make YaTeX ignore the
1049 internal La@TeX{} sequences as an object of changing. Anyway, it is
1050 very difficult to know which argument position the cursor belongs because
1051 the La@TeX{} commands can be nested and braces can freely emerge. So keep
1052 it mind to put the cursor on a brace when you are thinking of changing a
1053 complicated argument.
1055 @node Killing La@TeX{} commands, , Changing La@TeX{} commands, Changing and Deleting
1056 @comment node-name, next, previous, up
1057 @section Killing La@TeX{} commands
1058 @cindex Killing La@TeX{} commands
1060 @kbd{[prefix] k} kills the La@TeX{} commands sometimes with their
1061 arguments. Following table illustrates the correspondence of the invoking
1062 position and what is killed.
1064 @example
1065 [Invoking position] [action]
1066 \begin, \end line kill \begin,\end pairs
1067 %#BEGIN, %#END line kill %#BEGIN,%#END pairs
1068 on a Section-type command kill section-type command
1069 on a parenthesis kill parentheses
1070 @end example
1072 Note that when killing @code{\begin, \end} or @code{%#BEGIN, %#END} pair,
1073 the lines @code{\begin, \end} or @code{%#BEGIN, %#END} exist will be
1074 killed entirely. So take care not to create any line that contains more
1075 than one @code{\begin} or so.
1077 While all operations above are to kill `containers' which surround some
1078 text, universal argument (@kbd{C-u}) for these commands kills not only
1079 `containers' but also `contents' of them. See below as a sample.
1081 @example
1082 Original text: [prefix] k C-u [prefix] k
1083 Main \footnote@{note@} here. Main note here. Main here.
1084 ~(cursor)
1085 @end example
1087 @node Filling an item, Updation of @code{\includeonly}, Changing and Deleting, Top
1088 @comment node-name, next, previous, up
1089 @chapter Filling an item
1090 @cindex filling an item
1091 @cindex prefix i
1093 To fill a term (sentence) of @code{\item}, type
1095 @table @kbd
1096 @item [prefix] i
1097 @dots{} fill item
1098 @end table
1100 @noindent
1101 on that item.
1103 YaTeX uses the value of the variable @code{YaTeX-item-regexp} as the
1104 regular expression to search item header in itemize environment.
1105 If you make a newcommand to itemize terms(eg. @code{\underlineitem}), put
1107 @lisp
1108 (setq YaTeX-item-regexp
1109 "\\(\\\\item\\)\\|\\(\\\\underlineitem\\)")
1110 @end lisp
1111 @cindex YaTeX-item-regexp
1113 in your @file{~/.emacs}. If you are not familiar with regular expression
1114 for Emacs-Lisp, name a newcommand for `itemize' beginning with
1115 @code{\item} such as @code{\itembf}, not @code{\bfitem}.
1117 @node Updation of @code{\includeonly}, What column?, Filling an item, Top
1118 @comment node-name, next, previous, up
1119 @chapter Updation of @code{\includeonly}
1120 @cindex includeonly
1122 When you edit splitting source texts, the notation
1124 @example
1125 \includeonly@{CurrentEditingFileName@}
1126 @end example
1128 @noindent
1129 in the main file reduces the time of typesetting. If you want
1130 to hack other file a little however, you have to rewrite it to
1132 @example
1133 \includeonly@{OtherFileNameYouWantToFix@}
1134 @end example
1136 @noindent
1137 in the main file. YaTeX automatically detects that the current
1138 edited text is not in includeonly list and prompts you
1140 @example
1141 A)dd R)eplace %)comment?
1142 @end example
1144 in the minibuffer. Type @kbd{a} if you want to add the current file name
1145 to @code{\includeonly} list, @kbd{r} to replace \@code{includeonly} list
1146 by the current file, and type @kbd{%} to comment out the
1147 @code{\includeonly} line.
1149 @node What column?, Intelligent newline, Updation of @code{\includeonly}, Top
1150 @comment node-name, next, previous, up
1151 @chapter What column?
1152 @cindex what column
1153 @cindex complex tabular
1154 @cindex prefix &
1156 We are often get tired of finding the corresponding column in
1157 large tabulars. For example,
1159 @example
1160 \begin@{tabular@}@{|c|c|c|c|c|c|c|c|@}\hline
1161 Name&Position&Post No.&Addr.&Phone No.&FAX No.&
1162 Home Addr.&Home Phone\\ \hline
1163 Thunder Bird & 6 & 223 & LA & xxx-yyy &
1164 zzz-www & Japan & 9876-54321 \\
1165 & 2 & \multicolumn@{2@}@{c|@}@{Unknown@}
1166 &&&(???)
1167 \\ \hline
1168 \end@{tabular@}
1169 @end example
1171 Suppose you have the cursor located at @code{(???)} mark, can you tell
1172 which column it is belonging at once? Maybe no. In such case,
1173 type
1175 @table @kbd
1176 @item [prefix] &
1177 @dots{} What column
1178 @end table
1180 @noindent
1181 in that position. YaTeX tells you the column header of the
1182 current field. Since YaTeX assumes the first line of tabular
1183 environment as a row of column headers, you can create a row of
1184 virtual column headers by putting them in the first line and
1185 commenting that line with @code{%}.
1187 @node Intelligent newline, Online help, What column?, Top
1188 @comment node-name, next, previous, up
1189 @chapter Intelligent newline
1190 @cindex Intelligent newline
1191 @cindex ESC RET
1192 @cindex M-C-m
1194 In tabular[*], array, itemize, enumerate or tabbing environment,
1196 @table @kbd
1197 @item ESC RET
1198 @dots{} Intelligent newline
1199 @end table
1201 @noindent
1202 inserts the contents corresponding to the current environment in the next
1203 line. In @code{tabular} environment, for example, @kbd{ESC RET} inserts
1204 the certain number of @code{&} and trailing @code{\\}, and @code{\hline}
1205 if other @code{\hline} is found in backward. Here are the list of
1206 contents v.s. environments.
1208 @itemize
1209 @item @code{tabular}, @code{tabular*}, @code{array}
1211 Corresponding number of @code{&} and @code{\\}.
1212 And @code{\hline} if needed.
1214 @item @code{tabbing}
1216 The same number of @code{\>} as @code{\=} in the first line.
1218 @item @code{itemize}, @code{enumerate}, @code{description}, @code{list}
1220 @code{\item} or @code{item[]}.
1221 @end itemize
1223 Note that since this function works seeing the contents of the first
1224 line, please call this after the second line if possible.
1226 If you want to apply these trick to other environments, @code{foo}
1227 environment for example, define the function named
1228 @code{YaTeX-intelligent-newline-foo} to insert corresponding contents.
1229 That function will be called at the beginning of the next line after the
1230 newline is inserted to the current line. Since the function
1231 @code{YaTeX-indent-line} is designed to indent the current line properly,
1232 calling this function before your code to insert certain contents must be
1233 useful. See the definition of the function
1234 @code{YaTeX-intelligent-newline-itemize} as an example.
1236 @node Online help, Cooperation with other packages, Intelligent newline, Top
1237 @comment node-name, next, previous, up
1238 @chapter Online help
1239 @cindex online help
1240 @cindex prefix ?
1241 @cindex prefix /
1242 @cindex apropos
1243 @cindex keyword search
1245 YaTeX provides you the online help with popular La@TeX{} commands.
1247 Here are the key strokes for the online help.
1249 @table @kbd
1250 @item [prefix] ?
1251 @dots{} Online help
1252 @item [prefix] /
1253 @dots{} Online apropos
1254 @end table
1256 @section Online help
1258 `Online help' shows the documentation for the popular La@TeX{}
1259 commands(defaults to the commands on the cursor) in the next buffer.
1260 There are two help file, `global help' and `private help'. The former
1261 file contains the descriptions on the standard La@TeX{} command and is
1262 specified its name by variable @code{YaTeX-help-file}. Usually, the
1263 global help file should be located in public space (@code{$EMACSEXECPATH}
1264 by default) and should be world writable so that anyone can update it to
1265 enrich its contents. The latter file contains descriptions on
1266 non-standard or personal command definitions and is specified by
1267 @code{YaTeX-help-file-private}. This file should be put into private
1268 directory.
1270 @section Online apropos
1272 `Online apropos' is an equivalent of GNU Emacs's apropos. It
1273 shows all the documentations that contains the keyword entered by
1274 the user.
1276 @section When no descriptions are found...
1278 If there is no description on a command in help files, YaTeX
1279 requires you to write a description on that command. If you are
1280 willing to do, determine which help file to add and write the
1281 description on it referring your manual of (La)TeX. Please send
1282 me your additional descriptions if you describe the help on some
1283 standard commands. I might want to include it in the next
1284 distribution.
1286 @node Cooperation with other packages, Customizations, Online help, Top
1287 @comment node-name, next, previous, up
1288 @chapter Cooperation with other packages
1290 YaTeX works better with other brilliant packages.
1292 @section gmhist
1293 @cindex gmhist
1294 @cindex command history
1295 @cindex minibuffer history
1297 When you are loading @file{gmhist.el} and @file{gmhist-mh.el}, you can
1298 use independent command history list at the prompt of preview command
1299 (@kbd{[prefix] tp}) and print command (@kbd{[prefix] tl}). On each
1300 prompt, you can enter the previous command line string repeatedly by
1301 typing @kbd{M-p}.
1303 @section min-out
1304 @cindex min-out
1306 @file{min-out}, the outline minor mode, can be used in yatex-mode
1307 buffers. If you want to use it with YaTeX, please refer the
1308 file @file{yatexm-o.el} as an example.
1310 @node Customizations, Etcetera, Cooperation with other packages, Top
1311 @comment node-name, next, previous, up
1312 @chapter Customizations
1313 @cindex customizations
1315 You can customize YaTeX by setting Emacs-Lisp variables and by making
1316 add-in functions.
1318 @menu
1319 * Lisp variables::
1320 * Add-in functions::
1321 * Add-in generator::
1322 @end menu
1324 @node Lisp variables, Add-in functions, Customizations, Customizations
1325 @comment node-name, next, previous, up
1326 @section Lisp variables
1327 @cindex customizable variables
1329 You can change the key assignments or make completion more
1330 comfortable by setting the values of various variables which
1331 control the movement of yatex-mode.
1333 For example, if you want to change the prefix key stroke from @kbd{C-c}
1334 to any other sequence, set YaTeX-prefix to whatever you want to use. If
1335 you don't want to use the key sequence @kbd{C-c letter} which is assumed
1336 to be the user reserved sequence in Emacs world, set
1337 @code{YaTeX-inhibit-prefix-letter} to @code{t}, and all of the default key
1338 bind of @kbd{C-c letter} will turn to the corresponding @kbd{C-c C-letter}
1339 (but the region based completions that is invoked with @kbd{C-c
1340 Capital-letter} remain valid, if you want to disable those bindings, set
1341 that variable to 1 instead of @code{t}).
1343 @menu
1344 * All customizable variables::
1345 * Sample definitions::
1346 * Hook variables::
1347 * Hook file::
1348 @end menu
1350 @node All customizable variables, Sample definitions, Lisp variables, Lisp variables
1351 @comment node-name, next, previous, up
1352 @subsection All customizable variables
1353 @cindex all customizable variables
1355 Here are the customizable variables of yatex-mode. Each value setq-ed
1356 in @file{~/.emacs} is preferred and that of defined in @file{yatex.el} is
1357 neglected. Parenthesized contents stands for the default value. When you
1358 are to change some of these variables, see more detailed documentation of
1359 the variable by @kbd{M-x describe-variable}.
1361 @defvar YaTeX-prefix
1362 Prefix key stroke (@kbd{C-c})
1363 @end defvar
1365 @defvar YaTeX-inhibit-prefix-letter
1366 Change key stroke from @kbd{C-c letter} to @kbd{C-c C-letter}
1367 (@code{nil})
1368 @end defvar
1370 @defvar YaTeX-fill-prefix
1371 Fill-prefix used in yatex-mode (@code{nil})
1372 @end defvar
1374 @defvar YaTeX-open-lines
1375 Number of blank lines between cursor and @code{\begin@{@}},
1376 @code{\@code{end}@{@}} (0)
1377 @end defvar
1379 @defvar YaTeX-user-completion-table
1380 Name of user dictionary where learned completion table will be stored.
1381 (@code{"~/.yatexrc"})
1382 @end defvar
1384 @defvar YaTeX-item-regexp
1385 Regular expression of item command(@code{"\\\\item"})
1386 @end defvar
1388 @defvar tex-command
1389 La@TeX{} typesetter command (@code{"latex"})
1390 @end defvar
1392 @defvar dvi2-command
1393 Preview command
1394 (@code{"xdvi -geo +0+0 -s 4 -display (getenv"DISPLAY")"})
1395 @end defvar
1397 @defvar dviprint-command-format
1398 Command format to print dvi file (@code{"dvi2ps %f %t %s | lpr"})
1399 @end defvar
1401 @defvar dviprint-from-format
1402 Start page format of above %f. %b will turn to start page
1403 (@code{"-f %b"})
1404 @end defvar
1406 @defvar dviprint-to-format
1407 End page format of above %t. %e will turn to @code{end} page
1408 (@code{"-t %e"})
1409 @end defvar
1411 @defvar section-name
1412 Initial default value at the first section-type completion
1413 (@code{"documentstyle"})
1414 @end defvar
1416 @defvar env-name
1417 Initial default value at the first begin-type completion
1418 (@code{"document"})
1419 @end defvar
1421 @defvar fontsize-name
1422 Ditto of large-type (@code{"large"})
1423 @end defvar
1425 @defvar single-command
1426 Ditto of maketitle-type (@code{"maketitle"})
1427 @end defvar
1429 @defvar YaTeX-need-nonstop
1430 Put @code{\nonstopmode@{@}} or not (@code{nil})
1431 @end defvar
1433 @defvar latex-warning-regexp
1434 Regular expression of warning message latex command puts out
1435 (@code{"line.* [0-9]*"})
1436 @end defvar
1438 @defvar latex-error-regexp
1439 Regular expression of error message (@code{"l\\.[1-9][0-9]*"})
1440 @end defvar
1442 @defvar latex-dos-emergency-message
1443 Message latex command running on DOS puts at abort
1444 (@code{"Emergency stop"})
1445 @end defvar
1447 @defvar YaTeX-item-regexp
1448 Regexp of La@TeX{} itemization command (@code{"\\\\(sub\\)*item"})
1449 @end defvar
1451 @defvar YaTeX-nervous
1452 T for using local dictionary (@code{t})
1453 @end defvar
1455 @defvar YaTeX-sectioning-regexp
1456 Regexp of La@TeX{} sectioning command
1458 (@code{"part\\|chapter\\|\\(sub\\)*\\(section\\|paragraph\\)"})
1459 @end defvar
1461 @defvar YaTeX-fill-inhibit-environments
1462 Inhibit fill in these environments (@code{'("verbatim" "tabular")})
1463 @end defvar
1465 @defvar YaTeX-uncomment-once
1466 @code{T} for deleting all preceding @code{%} (@code{nil})
1467 @end defvar
1469 @defvar YaTeX-close-paren-always
1470 @code{T} for always close all parenthesis automatically,
1471 @code{nil} for only eol(@code{t})
1472 @end defvar
1474 @defvar YaTeX-auto-math-mode
1475 Switch math-mode automatically(@code{t})
1476 @end defvar
1478 @defvar YaTeX-default-pop-window-height
1479 Initial height of typesetting buffer when one-window.
1480 Number for the lines of the buffer, numerical string for
1481 the percentage of the screen-height.
1482 @code{nil} for half height(10)
1483 @end defvar
1485 @defvar YaTeX-help-file
1486 Global online help file name (@file{$EMACS/etc/YATEXHLP.jp})
1487 @end defvar
1489 @defvar YaTeX-help-file-private
1490 Private online help file name (@file{"~/YATEXHLP.jp"})
1491 @end defvar
1493 @defvar YaTeX-no-begend-shortcut
1494 Disable [prefix] b ?? shortcut (@code{nil)}
1495 @end defvar
1497 @defvar YaTeX-hilit-pattern-adjustment-private
1498 List of the list that contain the regular expression and the symbol of
1499 logical meaning of the string that matches the pattern. See also the
1500 value from @code{(assq 'yatex-mode hilit-patterns-alist)} and the value of
1501 @code{YaTeX-hilit-pattern-adjustment-default} (and even the document of
1502 hilit19.el).
1503 @end defvar
1505 @defvar YaTeX-sectioning-level
1506 Alist of LaTeX's sectioning command vs its height.
1507 @end defvar
1509 @node Sample definitions, Hook variables, All customizable variables, Lisp variables
1510 @comment node-name, next, previous, up
1511 @subsection Sample definitions
1512 @cindex prefix key stroke
1513 @cindex fill-prefix
1515 For instance, to change the prefix key stroke to @kbd{ESC}, and name of
1516 the user dictionary @file{~/src/emacs/yatexrc}, and set @code{fill-prefix}
1517 to single TAB character, add the following @code{setq} to @file{~/.emacs}.
1519 @lisp
1520 (setq YaTeX-prefix "\e"
1521 YaTeX-user-completion-table "~/src/emacs/yatexrc"
1522 YaTeX-fill-prefix " ")
1523 @end lisp
1525 @node Hook variables, Hook file, Sample definitions, Lisp variables
1526 @comment node-name, next, previous, up
1527 @subsection Hook variables
1528 @cindex hook variables
1530 More customizations will be done by the hook-function defined in
1531 hook-variable @code{yatex-mode-hook}. This is useful to define a shortcut
1532 key sequence to enter some environments other than @code{document} and
1533 @code{enumerate} etc. The following statement defines @code{[prefix] ba}
1534 to enter @code{\begin@{abstract@}} ... @code{=end@{abstract@}}
1535 immediately.
1537 @lisp
1538 (setq yatex-mode-hook
1539 '(lambda() (YaTeX-define-begend-key "ba" "abstract")))
1540 @end lisp
1542 You should use functions @code{YaTeX-define-key}, or
1543 @code{YaTeX-define-begend-key} to define all the key sequences of
1544 yatex-mode.
1546 @node Hook file, , Hook variables, Lisp variables
1547 @comment node-name, next, previous, up
1548 @subsection Hook file
1549 @cindex hook file
1551 You can stuff all of YaTeX relating expressions into a file named
1552 @file{yatexhks.el} if you have a lot of codes. YaTeX automatically load
1553 this file at the initialization of itself. Using @file{yatexhks.el}
1554 makes @code{yatex-mode-load-hook} unnecessary.
1556 @node Add-in functions, Add-in generator, Lisp variables, Customizations
1557 @comment node-name, next, previous, up
1558 @section Add-in functions
1559 @cindex add-in functions
1560 @cindex yatexadd.el
1562 You can easily define a function to input detailed arguments
1563 with completion according to La@TeX{} environments or commands.
1565 @c @node What is add-in functions?, , Add-in functions, Add-in functions
1566 @comment node-name, next, previous, up
1567 @subsection What is add-in functions?
1568 @cindex tabular
1570 When you input @code{tabular} environment, don't you think ``I want
1571 YaTeX to complete its argument toward my favorite one such as
1572 @code{@{|c|c|c|@}}...''? Yes, you can define the function to complete
1573 arguments for any environment and any La@TeX{} commands.
1575 @subsection Procedure
1577 Here is the procedure to define add-in functions.
1578 @enumerate
1579 @item
1580 Define the function
1581 @item
1582 Put the function into @file{yatexhks.el}
1583 @end enumerate
1585 @menu
1586 * How the add-in function works?::
1587 * How the function is called::
1588 * Useful functions for creating add-in::
1589 * Contribution::
1590 @end menu
1592 @node How the add-in function works?, How the function is called, Add-in functions, Add-in functions
1593 @comment node-name, next, previous, up
1594 @subsection How the add-in function works?
1596 There are two kinds of add-in. @dfn{Option add-in} returns the
1597 La@TeX{}'s optional parameters such as optional strings after
1598 @code{\begin@{ENV@}}, optional strings between a section-type command
1599 and its first argument, and optional strings just after type
1600 maketitle-type command. The following illustrates the name of add-in
1601 functions, where underlined strings are generated by add-in functions.
1603 @display
1604 \begin{table}[ht] (Function name: YaTeX:table)
1605 ~~~~
1606 \put(100,200){} (Function name: YaTeX:put)
1607 ~~~~~~~~~
1608 \sum_{i=0}^{n} (Function name: YaTeX:sum)
1609 ~~~~~~~~~~
1610 @end display
1612 Obviously, the function name is decided by concatenating the prefix
1613 `YaTeX:' and La@TeX{} command's name.
1615 Another add-in type is @dfn{argument add-in}, which completes arguments
1616 for section-type commands.
1618 @display
1619 \newcommand{\foo}{bar} (Function name: YaTeX::newcommand)
1620 ~~~~ ~~~
1621 @end display
1623 When the section-type command is inputted, the function named by
1624 concatenating `YaTeX::' and section-type command, is called automatically
1625 with an integer argument which indicates which argument of section-type
1626 command is being read. Thus the add-in should determine the
1627 job refering the value of its argument.
1629 @menu
1630 * Defining `option add-in'::
1631 * Defining `argument add-in'::
1632 @end menu
1634 @node Defining `option add-in', Defining `argument add-in', How the add-in function works?, How the add-in function works?
1635 @comment node-name, next, previous, up
1636 @subsubsection Defining `option add-in'
1638 If you want @code{@{|c|c|c|@}} for all @code{tabular} environment,
1640 @lisp
1641 (defun YaTeX:tabular ()
1642 "{|c|c|c|}")
1643 @end lisp
1645 @noindent
1646 is enough. If you want more complicated format, define as below.
1648 @lisp
1649 (defun YaTeX:tabular ()
1650 "@{@@@{\\vrule width 1pt\\ @}|||@@@{\\ \\vrule width 1pt@}@}")
1651 @end lisp
1653 @noindent
1654 Note that the character @code{\} must be described as @code{\\} in
1655 Emacs-Lisp. The next example reads the tabular format from keyboard.
1656 @lisp
1657 (defun YaTeX:tabular ()
1658 (concat "{" (read-string "Rule: ") "}"))
1659 @end lisp
1661 @node Defining `argument add-in', , Defining `option add-in', How the add-in function works?
1662 @comment node-name, next, previous, up
1663 @subsubsection Defining `argument add-in'
1665 This section describes how to define the add-in function for
1666 @code{\newcommand}.
1668 The first argument of @code{\newcommand} begins always with @code{\}.
1669 The second argument is usually so complex that we can not edit them in the
1670 minibuffer. Here is the created function considering this.
1672 @lisp
1673 (defun YaTeX::newcommand (n) ;n is argument position
1674 (cond
1675 ((= n 1) ;1st argument is macro name
1676 (read-string "Command: " "\\")) ;initial input `\'
1677 ((= n 2) "") ;do nothing when reading arg#2
1678 (t nil)))
1679 @end lisp
1681 Note that when the `argument add-in' function return `nil', normal
1682 argument reader will be called.
1684 @node How the function is called, Useful functions for creating add-in, How the add-in function works?, Add-in functions
1685 @comment node-name, next, previous, up
1686 @subsection How the function is called
1688 YaTeX calls the add-in functions for specified begin-type, section-type,
1689 and maketitle-type command, if any. `Option add-in' functions for
1690 begin-type are called when @code{\begin@{ENV@}} has been inserted,
1691 functions for section-type are called just before input of the first
1692 argument, and functions for maketitle-type is called after maketitle-type
1693 command has been inserted. `Argument add-in' functions are called at each
1694 entry of arguments for section-type commands.
1696 @node Useful functions for creating add-in, Contribution, How the function is called, Add-in functions
1697 @comment node-name, next, previous, up
1698 @subsection Useful functions for creating add-in
1700 Many add-in functions for typical La@TeX{} commands are defined in
1701 @file{yatexadd.el}. Those are also useful as references. Here are the
1702 short descriptions on useful functions, where [F] means function, [A]
1703 means arguments, [D] means description.
1705 @itemize
1706 @item [F]
1707 YaTeX:read-position
1708 @itemx [A]
1709 Character list which can show up in the brackets
1710 @itemx [D]
1711 Return the location specifier such as `[htb]'. When
1712 nothing is entered, omit [] itself. If the possible characters
1713 are "htbp", call this function as
1714 @code{(YaTeX:read-position "htbp")}
1716 @item [F]
1717 YaTeX:read-coordinates
1718 @itemx [A]
1719 Base prompt, X-axis prompt, Y-axis prompt (each optional)
1720 @itemx [D]
1721 Read the coodinates with the prompt ``BasePrompt X-axisPrompt:'' for
1722 X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form
1723 of ``(X,Y)''. The default prompts are @code{Dimention}, @code{X},
1724 @code{Y} respectively.
1726 @item [F]
1727 YaTeX:check-comletion-type
1728 @itemx [A]
1729 One of the symbols: 'begin, 'section, or 'maketitle
1730 @itemx [D]
1731 Check the current completion type is specified one and cause error if
1732 not. The variable @code{YaTeX-current-completion-type} holds the symbol
1733 according to the current completion type.
1734 @end itemize
1736 @node Contribution, , Useful functions for creating add-in, Add-in functions
1737 @comment node-name, next, previous, up
1738 @subsection Contribution
1740 If you make your own pretty function and you let it be in public, please
1741 send me the function. I'm going to include it in the next release.
1743 @node Add-in generator, , Add-in functions, Customizations
1744 @comment node-name, next, previous, up
1745 @section Add-in generator
1747 First, don't forget to read the section of add-in functions @ref{Add-in
1748 functions}. If you easily understand how to define them, there's no need
1749 to read this section. But being not familiar with Emacs-Lisp, when you
1750 don't have clear idea what to do, this section describes how to get YaTeX
1751 make add-in function.
1753 There are two methods of generation. One is for fully interactive
1754 generator for beginners and another requires little knowledge of
1755 Emacs-Lisp.
1757 @subsection Generator for beginners
1758 The former generator is called by
1759 @center @kbd{M-x YaTeX-generate}
1761 @noindent
1762 strokes. All you have to do is follow the guidances. Defying them may cases
1763 the disaster (I wonder what is it???). So when you make some mistake, it
1764 is recommendable to type @kbd{C-g} and start afresh.
1766 @subsection Simple generator
1768 The latter generator is invoked by the next sequence.
1769 @center @kbd{M-x YaTeX-generate-simple}
1770 This generator can make both ``option add-in'' and ``argument add-in''
1771 (@emph{refer the section add-in functions}
1772 @ref{How the add-in function works?}), whereas @code{YaTeX-generate}
1773 cannot make ``argument addin''.
1775 For example, assume you have the LaTeX command as follows.
1777 @example
1778 \epsinput[t](250,50){hoge.eps}{plain}{Picture of foo}
1779 (A) (B) (1) (2) (3)
1780 (A)Optional parameter to specify the position
1781 One of t(top), b(bottom), l(left), r(right)
1782 (B)Maximum size of frame
1783 (1)1st argument is filename of EPS file
1784 (2)2nd argument indicates
1785 plain do nothing
1786 frame make frame around image
1787 dframe make double-frame around image
1788 for included EPS file.
1789 (3)Caption for the picture
1790 @end example
1792 Now get start with generation. Typing @kbd{M-x YaTeX-generate-simple}
1793 brings the prompt:
1794 @display
1795 (O)ption? (A)rgument?
1796 @end display
1798 @subsubsection Generating ``option add-in''
1799 @cindex option add-in
1801 Since (A), (B) above are optional argument, all we have to do to
1802 complete them is define the option add-in for them. Let's generate the
1803 function to complete (A).
1805 @display
1806 M-x YaTeX-generate-simple RET
1807 epsinput RET
1809 @end display
1811 @noindent
1812 Typing as above leads the next prompt.
1814 @display
1815 Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit
1816 @end display
1818 @noindent
1819 This asks that ``Which type is the completion style of 1st argument?''.
1820 Here are the possible completion style.
1822 @table @code
1823 @item String
1824 read plain string
1825 @item Complete
1826 read with completion
1827 @item File
1828 read file name
1829 @item Option
1830 read optional string (if string omitted, omit [] too)
1831 @item Position
1832 read positional option (like [htbp])
1833 @item Coord.
1834 read coodinates
1835 @item Quit
1836 quit from genarating
1837 @end table
1839 Since (A) is the optional argument to specify the location of included
1840 EPS file, the completion style is @code{Position}, and the possible
1841 characters are t, b, l, and r. To tell these information to generator,
1842 operate as follows.
1844 @display
1845 Read type(1).... p
1846 Acceptable characters: tblr RET
1847 @end display
1849 (B) is coordinate. So its completion style is coOrd. We want a prompt
1850 meaning ``Maximum size'' when completion.
1852 @display
1853 Read type(2).... o
1854 Prompt for coordinates: Max size RET
1855 @end display
1857 That's all for optional argument. Select quit.
1859 @display
1860 Read type(3).... q
1861 @end display
1863 Then the generated option add-in function for \epsinput will be shown in
1864 the next window.
1866 @subsubsection Generating ``argument add-in''
1867 @cindex argument add-in
1869 Next, create the argument add-in. The arguments for \epsinput are EPS
1870 file name, framing style, and caption string in sequence.
1872 @display
1873 M-x YaTeX-generate-simple RET
1874 epsinput RET
1876 @end display
1878 Above key strokes bring the prompt that asks the number of argument.
1879 Answer it with 3.
1881 @display
1882 How many arguments?: 3 RET
1883 @end display
1885 Then the generator asks the completion style and prompt for completion.
1886 Answer them. @kbd{f} for FileName and prompt string.
1888 @display
1889 Read type(1).... f
1890 Prompt for argument#1 EPS file name RET
1891 @end display
1893 The second argument is one of selected symbol. So the completion type
1894 is @code{Completion}.
1896 @display
1897 Read type(2).... c
1898 Prompt for argument#2 Include style RET
1899 @end display
1901 Then all the candidates ready to be read. Type single RET after
1902 entering all.
1904 @display
1905 Item[1](RET to exit): plain RET
1906 Item[2](RET to exit): frame RET
1907 Item[3](RET to exit): dframe RET
1908 Item[4](RET to exit): RET
1909 @end display
1911 The following prompt asks whether the entered string must belong to
1912 candidates or not. In this case, since the argument must be one of
1913 @code{plain}, @code{frame}, and @code{dframe}, type @code{y}.
1915 @display
1916 Require match? (y or n) y
1917 @end display
1919 The last argument is the caption string for which any completion is
1920 needed.
1922 @display
1923 Read type(3).... s
1924 Prompt for argument#3 Caption RET
1925 default: Figure of RET
1926 @end display
1928 Finally we'll get the argument add-in in the next window.
1930 @subsection Contribution
1932 If you get your own pretty function and you let it be in public, please
1933 steel yourself in the happy atomospher and do not send me the function.
1934 I do know it is not fine because it is generated by yatexgen:-p.
1936 @node Etcetera, Copying, Customizations, Top
1937 @comment node-name, next, previous, up
1938 @chapter Etcetera
1940 The standard completion tables provided in @file{yatex.el} contain a
1941 few La@TeX{} commands I frequently use. This is to lessen the key
1942 strokes to complete entire word, because too many candidates
1943 rarely used often cause too many hits. Therefore always try to
1944 use completion in order to enrich your dictionary, and you will
1945 also find `Wild Bird' growing suitable for your La@TeX{} style.
1948 @node Copying, , Etcetera, Top
1949 @comment node-name, next, previous, up
1950 @chapter Copying
1952 This program is distributed as a free software. You can
1953 redistribute this software freely but with NO warranty to anything
1954 as a result of using this software. However, any reports and
1955 suggestions are welcome as long as I feel interests in this
1956 software. My possible e-mail address is `yuuji@@ae.keio.ac.jp'.
1957 (up to Mar.1995 at least)
1959 The specification of this software will be surely modified
1960 (depending on my feelings) without notice :-p.
1963 @flushright
1964 HIROSE Yuuji
1965 @end flushright
1966 @bye
1968 Local variables:
1969 mode: texinfo
1970 fill-prefix: nil
1971 fill-column: 74
1972 End: