yatex

view docs/yatexe.tex @ 56:a9653fbd1c1c

Bug fix version
author yuuji
date Thu, 29 Jun 1995 13:46:57 +0000
parents 2d45e43fb35f
children 18f4939986e6
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 includeonly:: Free from maintaining includeonly
40 * What column?:: Guidance to tabular column
41 * Intelligent newline:: Guess requisites of new line
42 * Online help:: On-line documentation of LaTeX
43 * Browsing file hierarchy:: Walking through file hierarchy
44 * Cooperation with other packages:: Work well with gmhist, min-out
45 * Customizations:: How to breed `Wild Bird'
46 * Etcetera:: YaTeX is acquisitive.
47 * Copying:: Redistribution
49 --- The Detailed Node Listing ---
51 %# notation
53 * Changing typesetter::
54 * Static region for typesetting::
55 * Lpr format::
56 * Editing %# notation::
58 Completion
60 * Begin-type completion::
61 * Section-type completion::
62 * Large-type completion::
63 * Maketitle-type completion::
64 * Arbitrary completion::
65 * End completion::
66 * Accent completion::
67 * Image completion::
68 * Greek letters completion::
70 Section-type completion
72 * view-sectioning::
74 Changing and Deleting
76 * Changing La@TeX{} commands::
77 * Killing La@TeX{} commands::
79 Customizations
81 * Lisp variables::
82 * Add-in functions::
83 * Add-in generator::
85 Lisp variables
87 * All customizable variables::
88 * Sample definitions::
89 * Hook variables::
90 * Hook file::
92 Procedure
94 * How the add-in function works?::
95 * How the function is called::
96 * Useful functions for creating add-in::
97 * Contribution::
99 How the add-in function works?
101 * Defining `option add-in'::
102 * Defining `argument add-in'::
103 @end menu
105 @node What is YaTeX?, Main features, Top, Top
106 @comment node-name, next, previous, up
107 @chapter What is YaTeX?
109 YaTeX automates typesetting and previewing of LaTeX and enables
110 completing input of LaTeX mark-up command such as
111 @code{\begin@{@}}..@code{\end@{@}}.
113 YaTeX also supports Demacs which runs on MS-DOS(386), Mule (Multi
114 Language Enhancement to GNU Emacs), and latex on DOS.
116 @node Main features, Installation, What is YaTeX?, Top
117 @comment node-name, next, previous, up
118 @chapter Main features
120 @itemize
121 @item Invocation of typesetter, previewer and related programs(@kbd{C-c t})
122 @item Typesetting on static region which is independent from point
123 @item Semiautomatic replacing of @code{\include only}
124 @item Jumping to error line(@kbd{C-c '})
125 @item Completing-read of La@TeX{} commands such as @code{\begin@{@}},
126 @code{\section} etc.
127 (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m})
128 @item Enclosing text into La@TeX{} environments or commands
129 (@kbd{C-u} @var{AboveKeyStrokes})
130 @item Displaying the structure of text at entering sectioning delimiters
131 @item Learning unknown/new La@TeX{} commands for the next completion
132 @item Argument reading with a guide for complicated La@TeX{} commands
133 @item Generating argument-readers for new/unsupported commands(@file{yatexgen})
134 @item Quick changing or deleting of La@TeX{} commands(@kbd{C-c c}, @kbd{C-c k})
135 @item Jumping from and to inter-file, begin<->end, ref<->label(@kbd{C-c g})
136 @item Blanket commenting out or uncommenting
137 (@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
138 @item Easy input of accent mark, math-mode's commands and Greek letters
139 (@kbd{C-c a}, @kbd{;}, @kbd{:})
140 @item Online help for the popular La@TeX{} commands
141 (@kbd{C-c ?}, @kbd{C-c /})(English help is not yet supported)
142 @item Document files hierarchy browser (@kbd{C-c d})
143 @end itemize
145 @node Installation, Typesetting, Main features, Top
146 @comment node-name, next, previous, up
147 @chapter Installation
148 @cindex installation
149 @cindex .emacs
150 @cindex auto-mode-alist
151 @cindex autoload
153 Put next two expressions into your @file{~/.emacs}.
155 @lisp
156 (setq auto-mode-alist
157 (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
158 (autoload 'yatex-mode "yatex" "Yet Another La@TeX{} mode" t)
159 @end lisp
161 Next, add certain path name where you put files of YaTeX to your
162 load-path. If you want to put them in @file{~/src/emacs}, write
164 @lisp
165 (setq load-path
166 (cons (expand-file-name "~/src/emacs") load-path))
167 @end lisp
169 @noindent
170 in your @file{~/.emacs}
172 Then, yatex-mode will be automatically loaded when you visit a
173 file which has extension @file{.tex}. If yatex-mode is successfully
174 loaded, mode string on mode line will be turned to "YaTeX".
177 @node Typesetting, %# notation, Installation, Top
178 @comment node-name, next, previous, up
179 @chapter Typesetting
180 @cindex typesetting
181 @cindex previewer
182 @cindex typesetter
183 @cindex latex
184 @cindex printing out
186 The prefix key stroke of yatex-mode is @kbd{C-c} (Press 'C' with Control
187 key) by default. If you don't intend to change the prefix key stroke,
188 assume all @kbd{[prefix]} as @kbd{C-c} in this document. These key
189 strokes execute typeset or preview command.
191 @table @kbd
192 @item [prefix] tj
193 @dots{} invoke latex
194 @item [prefix] tr
195 @dots{} invoke latex on region
196 @item [prefix] tk
197 @dots{} kill current typesetting process
198 @item [prefix] tb
199 @dots{} invoke bibtex
200 @item [prefix] tp
201 @dots{} preview
202 @item [prefix] tl
203 @dots{} lpr dvi-file
204 @end table
206 The current editing window will be divided horizontally when you
207 invoke latex command, and log message of La@TeX{} typesetting will be
208 displayed in the other window; called typesetting buffer. The
209 typesetting buffer automatically scrolls up and traces La@TeX{}
210 warnings and error messages. If you see latex stopping by an
211 error, you can send string to latex in the typesetting buffer.
213 If an error stops the La@TeX{} typesetting, this key stroke will
214 move the cursor to the line where La@TeX{} error is detected.
216 @table @kbd
217 @item [prefix] '
218 @itemx ([prefix]+single quotation)
220 @dots{} jump to the previous error or warning
221 @end table
223 If you find a noticeable error, move to the typesetting buffer and move
224 the cursor on the line of error message and type @kbd{SPACE} key. This
225 makes the cursor move to corresponding source line.
227 Since @kbd{[prefix] tr} pastes the region into the file
228 @file{texput.tex} in the current directory, you should be careful of
229 overwriting. The method of specification of the region is shown in the
230 section @xref{%#NOTATION}.
232 The documentstyle for typeset-region is the same as that of editing
233 file if you edit one file, and is the same as main file's if you
234 edit splitting files.
236 YaTeX asks you the range of dvi-printing by default. You can
237 skip this by invoking it with universal-argument as follows:
239 @example
240 C-u [prefix] tl
241 @end example
243 @node %# notation, Completion, Typesetting, Top
244 @comment node-name, next, previous, up
245 @chapter %# notation
246 @cindex %# notation
248 You can control the typesetting process by describing @code{%#}
249 notations in the source text.
251 @menu
252 * Changing typesetter::
253 * Static region for typesetting::
254 * Lpr format::
255 * Editing %# notation::
256 @end menu
258 @node Changing typesetter, Static region for typesetting, %# notation, %# notation
259 @comment node-name, next, previous, up
260 @section To change the `latex' command or to split a source text.
261 @cindex typesetter
263 To change the typesetting command, write
265 @example
266 %#!latex-big
267 @end example
269 @noindent
270 anywhere in the source text. This is useful for changing
271 typesetter.
273 @node Splitting input files, Static region for typesetting, Changing typesetter, %# notation
274 @comment node-name, next, previous, up
276 And if you split the source text and
277 edit subfile that should be included from main text.
279 @example
280 %#!latex main.tex
281 @end example
283 @noindent
284 will be helpful to execute latex on main file from sub text buffer. Since
285 this command line after @kbd{%#!} will be sent to shell literally, next
286 description makes it convenient to use ghostview as dvi-previewer.
288 @example
289 %#!latex main ; dvi2ps main.dvi > main
290 @end example
292 @noindent
293 Note that YaTeX assumes the component before the last period of
294 the last word in this line as base name of the main La@TeX{} source.
296 To make best use of the feature of inter-file jumping by
297 @kbd{[prefix] g} (see @ref{Cursor jump}), take described below into
298 consideration.
300 @itemize
301 @item You can put split texts in sub directory, but not in
302 sub directory of sub directory.
303 @item In the main text, specify the child file name with relative path name
304 such as \include{chap1/sub}, when you include the file in
305 a sub-directory.
306 @item In a sub-text, write @code{%#!latex main.tex} even if @file{main.tex}
307 is in the parent directory(not %#!latex ../main.tex).
308 @end itemize
310 @node Static region for typesetting, Lpr format, Changing typesetter, %# notation
311 @comment node-name, next, previous, up
312 @section Static region
313 @cindex static region
314 @cindex Fixed region
316 Typeset-region by @kbd{[prefix] tr} passes the region between point and
317 mark to typesetting command by default. But when you want to typeset
318 static region, enclose the region by @code{%#BEGIN} and @code{%#END} as
319 follows.
321 @example
322 %#BEGIN
323 TheRegionYouWantToTypesetManyTimes
324 %#END
325 @end example
327 This is the rule of deciding the region.
329 @enumerate
330 @item
331 If there exists %#BEGIN before point,
333 @enumerate
334 @item
335 If there exists %#END after %#BEGIN,
336 @itemize
337 @item From %#BEGIN to %#END.
338 @end itemize
340 @item
341 If %#END does not exist after %#BEGIN,
342 @itemize
343 @item From %#BEGIN to the end of buffer.
344 @end itemize
345 @end enumerate
347 @item
348 If there does not exist %#BEGIN before point,
349 @itemize
350 @item Between point and mark(standard method of Emacs).
351 @end itemize
352 @end enumerate
354 It is useful to write @code{%#BEGIN} in the previous line of \begin and
355 @code{%#END} in the next line of \@code{end} when you try complex
356 environment such as `tabular' many times. It is also useful to put only
357 @code{%#BEGIN} alone at the middle of very long text. Do not forget to
358 erase @code{%#BEGIN} @code{%#END} pair.
360 @node Lpr format, Editing %# notation, Static region for typesetting, %# notation
361 @comment node-name, next, previous, up
362 @section Lpr format
363 @cindex lpr format
365 Lpr format is specified by three Lisp variables. Here are the
366 default values of them.
368 @table @code
369 @item (1)dviprint-command-format
370 @code{"dvi2ps %f %t %s | lpr"}
371 @item (2)dviprint-from-format
372 @code{"-f %b"}
373 @item (3)dviprint-to-format
374 @code{"-t %e"}
375 @end table
377 On YaTeX-lpr, @code{%s} in (1) is replaced by the file name of main
378 text, @code{%f} by contents of (2), %t by contents of (3). At these
379 replacements, @code{%b} in (2) is also replaced by the number of beginning
380 page, @code{%e} in (3) is replaced by the number of ending page. But
381 @code{%f} and @code{%t} are ignored when you omit the range of print-out
382 by @kbd{C-u [prefix] tl}.
384 If you want to change this lpr format temporarily, put a command
385 such as follows somewhere in the text:
387 @example
388 %#LPR dvi2ps %f %t %s | 4up -page 4 | texfix | lpr -Plp2
389 @end example
391 And if you want YaTeX not to ask you the range of printing
392 out, the next example may be helpful.
394 @example
395 %#LPR dvi2ps %s | lpr
396 @end example
398 @node Editing %# notation, , Lpr format, %# notation
399 @comment node-name, next, previous, up
400 @section Editing %# notation
402 To edit @code{%#} notation described above, type
404 @table @kbd
405 @item [prefix] %
406 @dots{} editing %# notation menu
407 @end table
409 @noindent
410 and select one of the entry of the menu as follows.
412 @example
413 !)Edit-%#! B)EGIN-END-region L)Edit-%#LPR
414 @end example
416 @noindent
417 Type @kbd{!} to edit @code{%#!} entry, @code{b} to enclose the region with
418 @code{%#BEGIN} and @code{%#END}, and @code{l} to edit @code{%#LPR} entry.
419 When you type @kbd{b}, all @code{%#BEGIN} and @code{%#END} are
420 automatically erased.
422 @node Completion, Local dictionaries, %# notation, Top
423 @comment node-name, next, previous, up
424 @chapter Completion
425 @cindex completion
427 YaTeX makes it easy to input the La@TeX{} commands. There are several
428 kinds of completion type, begin-type, section-type, large-type, etc...
430 @menu
431 * Begin-type completion::
432 * Section-type completion::
433 * Large-type completion::
434 * Maketitle-type completion::
435 * Arbitrary completion::
436 * End completion::
437 * Accent completion::
438 * Image completion::
439 * Greek letters completion::
440 @end menu
442 @node Begin-type completion, Section-type completion, Completion, Completion
443 @comment node-name, next, previous, up
444 @section Begin-type completion
445 @cindex begin-type completion
446 @cindex environment
447 @cindex prefix b
449 "Begin-type completion" completes commands of @code{\begin@{env@}} ...
450 @code{\end@{env@}}. All of the begin-type completions begin with this key
451 sequence.
453 @table @kbd
454 @item [prefix] b
455 @dots{} start begin-type completion
456 @end table
458 @noindent
459 An additional key stroke immediately completes a frequently used
460 La@TeX{} @code{\begin@{@}}...@code{\@code{end}@{@}} environment.
462 @table @kbd
463 @item [prefix] b c
464 @dots{} @code{\begin@{center@}...\end@{center@}}
465 @item [prefix] b d
466 @dots{} @code{\begin@{document@}...\end@{document@}}
467 @item [prefix] b D
468 @dots{} @code{\begin@{description@}...\end@{description@}}
469 @item [prefix] b e
470 @dots{} @code{\begin@{enumerate@}...\end@{enumerate@}}
471 @item [prefix] b E
472 @dots{} @code{\begin@{equation@}...\end@{equation@}}
473 @item [prefix] b i
474 @dots{} @code{\begin@{itemize@}...\end@{itemize@}}
475 @item [prefix] b l
476 @dots{} @code{\begin@{flushleft@}...\end@{flushleft@}}
477 @item [prefix] b m
478 @dots{} @code{\begin@{minipage@}...\end@{minipage@}}
479 @item [prefix] b t
480 @dots{} @code{\begin@{tabbing@}...\end@{tabbing@}}
481 @item [prefix] b T
482 @dots{} @code{\begin@{tabular@}...\end@{tabular@}}
483 @item [prefix] b^T
484 @dots{} @code{\begin@{table@}...\end@{table@}}
485 @item [prefix] b p
486 @dots{} @code{\begin@{picture@}...\end@{picture@}}
487 @item [prefix] b q
488 @dots{} @code{\begin@{quote@}...\end@{quote@}}
489 @item [prefix] b Q
490 @dots{} @code{\begin@{quotation@}...\end@{quotation@}}
491 @item [prefix] b r
492 @dots{} @code{\begin@{flushright@}...\end@{flushright@}}
493 @item [prefix] b v
494 @dots{} @code{\begin@{verbatim@}...\end@{verbatim@}}
495 @item [prefix] b V
496 @dots{} @code{\begin@{verse@}...\end@{verse@}}
497 @end table
499 Any other La@TeX{} environments are made by completing-read of the
500 Emacs function.
502 @table @kbd
503 @item [prefix] b SPACE
504 @dots{} begin-type completion
505 @end table
507 @noindent
508 The next message will show up in the minibuffer
510 @example
511 Begin environment(default document):
512 @end example
514 @noindent
515 by typing @kbd{[prefix] b}. Put the wishing environment with completion
516 in the minibuffer, and @code{\begin@{env@}}...\@code{\end@{env@}} will be
517 inserted in the La@TeX{} source text. If the environment you want to put
518 does not exist in the YaTeX completion table, it will be registered in the
519 user completion table. YaTeX automatically saves the user completion
520 table in the user dictionary file at exiting of emacs.
522 If you want to enclose some paragraphs which have already been
523 written, invoke the begin-type completion with changing the case
524 of @kbd{b} of key sequence upper(or invoke it with universal argument
525 by @kbd{C-u} prefix).
526 @cindex enclose region into environment
528 The following example encloses a region with `description'
529 environment.
531 @table @kbd
532 @item [prefix] B D
533 @itemx (or ESC 1 [prefix] b D)
534 @itemx (or C-u [prefix] b D)
536 @dots{} begin-type completion for region
537 @end table
539 This enclosing holds good for the completing input by @kbd{[prefix] b
540 SPC}. @kbd{[prefix] B SPC} enclose a region with the environment selected
541 by completing-read.
543 @node Section-type completion, Large-type completion, Begin-type completion, Completion
544 @comment node-name, next, previous, up
545 @section Section-type completion
546 @cindex section-type completion
547 @cindex prefix s
549 "Section-type completion" completes section-type commands which take an
550 argument or more such as @code{\section@{foo@}}. To invoke section-type
551 completion, type
553 @table @kbd
554 @item [prefix] s
555 @dots{} section-type completion
556 @end table
558 @noindent
559 then the prompt
561 @example
562 (C-v for view) \???@{@} (default documentstyle):
563 @end example
565 @noindent
566 will show up in the minibuffer. Section-type La@TeX{} commands are
567 completed by space key, and the default value is selected when you
568 type nothing in the minibuffer.
570 Next,
572 @example
573 \section@{???@}:
574 @end example
576 @noindent
577 prompts you the argument of section-type La@TeX{} command. For
578 example, the following inputs
580 @example
581 \???@{@} (default documentstyle): section
582 \section{???}: Hello world.
583 @end example
585 @noindent
586 will insert the string
588 @example
589 \section@{Hello world.@}
590 @end example
592 in your La@TeX{} source. When you neglect argument such as
594 @example
595 (C-v for view) \???@{@} (default section): vspace*
596 \vspace*@{???@}:
597 @end example
599 YaTeX puts
601 @example
602 \vspace*@{@}
603 @end example
605 @noindent
606 and move the cursor in the braces.
608 In La@TeX{} command, there are commands which take more than one
609 arguments such as @code{\addtolength{\topmargin}{8mm}}. To complete these
610 commands, invoke section-type completion with universal argument as,
611 @cindex number of argument
613 @example
614 C-u 2 [prefix] s (or ESC 2 [prefix] s)
615 @end example
617 @noindent
618 and make answers in minibuffer like this.
620 @example
621 (C-v for view) \???@{@} (default vspace*): addtolength
622 \addtolength@{???@}: \topmargin
623 Argument 2: 8mm
624 @end example
626 @code{\addtolength} and the first argument @code{\topmargin} can be typed
627 easily by completing read. Since YaTeX also learns the number of
628 arguments of section-type command and will ask that many arguments in
629 future completion, you had better tell the number of arguments to YaTeX at
630 the first completion of the new word. But you can change the number of
631 arguments by calling the completion with different universal argument
632 again.
635 Invoking section-type completion with @code{[Prefix] S} (Capital `S')
636 includes the region as the first argument of section-type command.
638 The section/large/maketitle type completion can work at the
639 prompt for the argument of other section-type completion.
640 Nested La@TeX{} commands are efficiently read with the recursive
641 completion by typing YaTeX's completion key sequence in the
642 minibuffer.
644 @menu
645 * view-sectioning::
646 @end menu
648 @node view-sectioning, , Section-type completion, Section-type completion
649 @comment node-name, next, previous, up
650 @subsection view-sectioning
651 @cindex view sectioning
652 @cindex outline
654 In the minibuffer at the prompt of section-type command completion,
655 typing @kbd{C-v} shows a list of sectioning commands in source text(The
656 line with @code{<<--} mark is the nearest sectioning command). Then,
657 default sectioning command appears in the minibuffer. You can go up/down
658 sectioning command by typing @kbd{C-p}/@kbd{C-n}, can scrolls up/down the
659 listing buffer by @kbd{C-v}/@kbd{M-v}, and can hide sectioning commands
660 under certain level by 0 through 6. Type @kbd{?} in the minibuffer of
661 sectioning prompt for more information.
663 @node Large-type completion, Maketitle-type completion, Section-type completion, Completion
664 @comment node-name, next, previous, up
665 @section Large-type completion
667 "Large-type completion" inputs the font or size changing
668 descriptions such as @code{@{\large @}}. When you type
670 @table @kbd
671 @item [prefix] l
672 @dots{} large-type completion
673 @end table
675 @noindent
676 the message in the minibuffer
678 @example
679 @{\??? @} (default large):
680 @end example
682 prompts prompts you large-type command with completing-read. There are
683 TeX commands to change fonts or sizes, @code{it}, @code{huge} and so on,
684 in the completion table.
686 Region-based completion is also invoked by changing the letter after
687 prefix key stroke as @kbd{[prefix] L}. It encloses the region by braces
688 with large-type command.
690 @node Maketitle-type completion, Arbitrary completion, Large-type completion, Completion
691 @comment node-name, next, previous, up
692 @section Maketitle-type completion
693 @cindex maketitle-type completion
695 We call it "maketitle-type completion" which completes commands such as
696 @code{\maketitle}. Take notice that maketitle-type commands take no
697 arguments. Then, typing
699 @table @kbd
700 @item [prefix] m
701 @dots{} maketitle-type completion
702 @end table
704 @noindent
705 begins maketitle-completion. Above mentioned method is true for
706 maketitle-completion, and there are La@TeX{} commands with no
707 arguments in completion table.
709 @node Arbitrary completion, End completion, Maketitle-type completion, Completion
710 @comment node-name, next, previous, up
711 @section Arbitrary completion
712 @cindex arbitrary completion
714 @noindent
715 You can complete certain La@TeX{} command anywhere without typical
716 completing method as described, by typing
718 @table @kbd
719 @item [prefix] SPC
720 @dots{} arbitrary completion
721 @end table
723 @noindent
724 after the initial string of La@TeX{} command that is preceded by @code{\}.
726 @node End completion, Accent completion, Arbitrary completion, Completion
727 @comment node-name, next, previous, up
728 @section End completion
729 @cindex end completion
731 @noindent
732 YaTeX automatically detects the opened environment and close it with
733 \@code{\end@{environment@}}. Though proficient YaTeX users never fail to
734 make environment with begin-type completion, some may begin an environment
735 manually. In that case, type
737 @table @kbd
738 @item [prefix] e
739 @dots{} @code{end} completion
740 @end table
742 @noindent
743 at the end of the opened environment.
745 @node Accent completion, Image completion, End completion, Completion
746 @comment node-name, next, previous, up
747 @section Accent completion
748 @cindex accent completion
750 When you want to write the European accent marks(like @code{\`@{o@}}),
752 @table @kbd
753 @item [prefix] a
754 @dots{} accent completion
755 @end table
757 @noindent
758 shows the menu
760 @example
761 1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b
762 @end example
764 @noindent
765 in the minibuffer. Chose one character or corresponding numeric,
766 and you will see
768 @example
769 \`{}
770 @end example
772 @noindent
773 in the editing buffer with the cursor positioned in braces. Type
774 one more character `o' for example, then
776 @example
777 \`{o}
778 @end example
780 @noindent
781 will be completed, and the cursor gets out from braces.
783 @node Image completion, Greek letters completion, Accent completion, Completion
784 @comment node-name, next, previous, up
785 @section Image completion of mathematical sign
786 @cindex image completion
787 @cindex math-mode
788 @cindex sigma
789 @cindex leftarrow
790 @cindex ;
792 Arrow marks, sigma mark and those signs mainly used in the
793 TeX's math environment are completed by key sequences which
794 imitate the corresponding symbols graphically. This completion
795 only works in the math environment. YaTeX automatically detects
796 whether the cursor located in math environment or not, and
797 change the behavior of key strokes @kbd{;} and @kbd{:}.
799 By the way, we often express the leftarrow mark by `<-' for example.
800 Considering such image, you can write @code{\leftarrow} by typing @kbd{<-}
801 after @kbd{;} (semicolon) as a prefix. In the same way,
802 @code{\longleftarrow} (@code{<--}) is completed by typing @kbd{;<--},
803 infinity mark which is imitated by @code{oo} is completed by typing
804 @kbd{;oo}.
806 Here are the sample operations in YaTeX math-mode.
808 @example
809 INPUT Completed La@TeX{} commands
810 ; < - @code{\leftarrow}
811 ; < - - @code{\longleftarrow}
812 ; < - - > @code{\longleftrightarrow}
813 ; o @code{\circ}
814 ; o o @code{\infty}
815 @end example
817 In any case, you can quit from image completion and can move
818 to the next editing operation if the La@TeX{} command you want is
819 shown in the buffer.
821 @code{;} itself in math-environment is inserted by @kbd{;;}. Typing
822 @kbd{TAB} in the midst of image completion shows all of the La@TeX{}
823 commands that start with the same name as string you previously typed in.
824 In this menu buffer, press @kbd{RET} after moving the cursor (by @kbd{n},
825 @kbd{p}, @kbd{b}, @kbd{f}) to insert the La@TeX{} command.
827 To know all of the completion table, type @kbd{TAB} just after @kbd{;}.
828 And here is the sample menu by @kbd{TAB} after @kbd{;<}.
830 @example
831 KEY LaTeX sequence sign
832 < \leq <
833 ~
834 << \ll <<
835 <- \leftarrow <-
836 <= \Leftarrow <=
837 @end example
839 You can define your favorite key-vs-sequence completion table in the
840 Emacs-Lisp variable @code{YaTeX-math-sign-alist-private}. See also
841 @file{yatexmth.el} for the information of the structure of this variable.
843 @node Greek letters completion, , Image completion, Completion
844 @comment node-name, next, previous, up
845 @section Greek letters completion
846 @cindex Greek letters completion
847 @cindex :
849 Math-mode of YaTeX provides another image completion, Greek letters
850 completion in the same method. After prefix @kbd{:}, typing @kbd{a} makes
851 @code{\alpha}, @kbd{b} makes @code{\beta} and @kbd{g} makes @code{\gamma}
852 and so on. First, type @kbd{/TAB} to know all the correspondence of
853 alphabets v.s. Greek letters.
855 If you will find @kbd{;} or @kbd{:} doesn't work in correct position of
856 math environment, it may be a bug of YaTeX. Please send me a bug report
857 with the configuration of your text, and avoid it temporarily by typing
858 @kbd{;} or @kbd{:} after universal-argument(@kbd{C-u}) which forces
859 @kbd{;} and @kbd{:} to work as math-prefix.
861 @node Local dictionaries, Commenting out, Completion, Top
862 @comment node-name, next, previous, up
863 @chapter Local dictionaries
864 @cindex local dictionaries
865 @cindex nervous users
867 Tables for completion consist of three dictionaries; `standard
868 dictionary' built in @file{yatex.el}, `user dictionary' for your common
869 private commands, and `local dictionary' that is effective in a certain
870 directory.
872 When you input the command unknown to YaTeX at a completion in the
873 minibuffer, YaTeX asks you with the following prompt;
875 @example
876 `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscad
877 @end example
879 @noindent
880 In this menu, typing @kbd{u} updates your `user dictionary', @kbd{l}
881 updates your local dictionary, @kbd{n} updates only on-memory dictionary
882 which go through only current Emacs session, and @kbd{d} updates no
883 dictionary and throws the new word away.
885 If you find this switching feature meaningless and bothersome, put the
886 next expression into your @file{~/.emacs}
888 @lisp
889 (setq YaTeX-nervous nil)
890 @end lisp
892 @node Commenting out, Cursor jump, Local dictionaries, Top
893 @comment node-name, next, previous, up
894 @chapter Commenting out
895 @cindex commenting out
896 @cindex prefix >
897 @cindex prefix <
898 @cindex prefix ,
899 @cindex prefix .
901 You may want to comment out some region.
903 @table @kbd
904 @item [prefix] >
905 @dots{} comment out region by %
906 @item [prefix] <
907 @dots{} uncomment region
908 @end table
910 @noindent
911 cause an operation to the region between point and mark.
913 @table @kbd
914 @item [prefix] .
915 @dots{} comment out current paragraph
916 @item [prefix] ,
917 @dots{} uncomment current paragraph
918 @end table
920 @noindent
921 comments or uncomments the paragraph where the cursor belongs.
922 This `paragraph' means the region marked by the function
923 mark-paragraph, bound to @kbd{ESC h} by default. It is NOT
924 predictable what will happen when you continuously comment out
925 some paragraph many times.
927 You can also comment out an environment between @code{\begin} and
928 @code{\end}, or a @code{\begin}-\@code{\end} pair themselves, by making the
929 following key strokes on the line where @code{\begin@{@}} or
930 @code{\end@{@}} exists.
932 @table @kbd
933 @item [prefix] >
934 @dots{} comment out from \begin to \@code{end}
935 @item [prefix] <
936 @dots{} uncomment from \begin to \@code{end}
937 @end table
939 @noindent
940 comment whole the contents of environment. Moreover,
942 @table @kbd
943 @item [prefix] .
944 @dots{} comment out \begin and \@code{end}
945 @item [prefix] ,
946 @dots{} uncomment \begin and \@code{end}
947 @end table
949 @noindent
950 (un)comments out only environment declaration: @code{\begin@{@}} and
951 @code{\end@{@}}. NOTE that even if you intend to comment out some region,
952 invoking @kbd{[prefix] >} on the @code{\begin},@code{\end} line decides to
953 work in `commenting out from @code{\begin} to @code{\end}' mode.
956 @node Cursor jump, Changing and Deleting, Commenting out, Top
957 @comment node-name, next, previous, up
958 @chapter Cursor jump
959 @cindex cursor jump
960 @cindex prefix g
962 @section Jump to corresponding object
964 Typing
966 @table @kbd
967 @item [prefix] g
968 @dots{} go to corresponding object
969 @end table
971 @noindent
972 in a certain place move the cursor to the place corresponding to the
973 La@TeX{} command of last place. YaTeX recognize the followings as pairs
974 that have relation each other.
976 @itemize @bullet
977 @item @code{\begin@{@}} <-> @code{\end@{@}}
978 @item @code{%#BEGIN} <-> @code{%#END}
979 @item @code{\label@{@}} <-> @code{\ref@{@}}
980 @item @code{\include(\input)} -> included file
981 @item @code{\bibitem@{@}} <-> @code{\cite@{@}}
982 @end itemize
984 On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the
985 cursor to the corresponding @code{\end},@code{\begin} line, if its partner
986 really exists. The behavior on the line @code{%#BEGIN} and @code{%#END}
987 are the same. Note that if the correspondent of @code{label/ref} or
988 @code{cite/bibitem} exists in another file, that file have to be opened to
989 make a round trip between references by @kbd{[prefix] g}.
991 If you type @code{[prefix] g} on the line of @code{\include@{chap1@}},
992 typically in the main text, YaTeX switches buffer to @file{chap1.tex}.
994 @table @kbd
995 @item [prefix] 4 g
996 @dots{} go to corresponding object in other window
997 @end table
999 @noindent
1000 do the same job as @kbd{[prefix] g} except it's done in other window.
1001 Note that this function doesn't work on @code{begin/end},
1002 @code{%#BEGIN/%#END} pairs because it is meaningless.
1004 @section Jump to main file
1006 Typing
1008 @table @kbd
1009 @item [prefix] ^
1010 @dots{} visit main file
1011 @item [prefix] 4^
1012 @dots{} visit main file in other buffer
1013 @end table
1014 @cindex prefix ^
1015 @cindex prefix 4 ^
1017 in a sub text switch the buffer to the main text specified by
1018 @code{%#!} notation.
1020 @section Other jumping features
1022 And these are the functions which work on the current La@TeX{}
1023 environment:
1025 @table @kbd
1026 @item M-C-a
1027 @dots{} beginning of environment
1028 @item M-C-e
1029 @dots{} @code{end} of environment
1030 @item M-C-@@
1031 @dots{} mark environment
1032 @end table
1033 @cindex M-C-a
1034 @cindex M-C-e
1035 @cindex M-C-@@
1037 @node Changing and Deleting, Filling, Cursor jump, Top
1038 @comment node-name, next, previous, up
1039 @chapter Changing and Deleting
1041 These functions are for change or deletion of La@TeX{} commands
1042 already entered.
1044 @table @kbd
1045 @item [prefix] c
1046 @dots{} change La@TeX{} command
1047 @item [prefix] k
1048 @dots{} kill La@TeX{} command
1049 @end table
1050 @cindex prefix c
1051 @cindex prefix k
1053 @menu
1054 * Changing La@TeX{} commands::
1055 * Killing La@TeX{} commands::
1056 @end menu
1058 @node Changing La@TeX{} commands, Killing La@TeX{} commands, Changing and Deleting, Changing and Deleting
1059 @comment node-name, next, previous, up
1060 @section Changing La@TeX{} commands
1062 @kbd{[prefix] c} can change the various (La)@TeX{} commands. This can
1063 change the followings.
1064 @itemize @bullet
1065 @item Environment names
1066 @item Section-type commands
1067 @item Argument of section-type commands
1068 @item Optional parameters (enclosed by []) of section-type commands
1069 @item Font/size designators
1070 @item Math-mode's maketitle-type commands that can be inputted with
1071 image completion
1072 @end itemize
1074 Typing @kbd{[prefix] c} on one of above objects you want to change
1075 brings a suitable reading function sometimes with completion.
1076 Note: If you want to change the argument of section-type command that
1077 contains other La@TeX{} commands, type @kbd{[prefix] c} either of
1078 surrounding braces of the argument in order to make YaTeX ignore the
1079 internal La@TeX{} sequences as an object of changing. Anyway, it is
1080 very difficult to know which argument position the cursor belongs because
1081 the La@TeX{} commands can be nested and braces can freely emerge. So keep
1082 it mind to put the cursor on a brace when you are thinking of changing a
1083 complicated argument.
1085 @node Killing La@TeX{} commands, , Changing La@TeX{} commands, Changing and Deleting
1086 @comment node-name, next, previous, up
1087 @section Killing La@TeX{} commands
1088 @cindex Killing La@TeX{} commands
1090 @kbd{[prefix] k} kills the La@TeX{} commands sometimes with their
1091 arguments. Following table illustrates the correspondence of the invoking
1092 position and what is killed.
1094 @example
1095 [Invoking position] [action]
1096 \begin, \end line kill \begin,\end pairs
1097 %#BEGIN, %#END line kill %#BEGIN,%#END pairs
1098 on a Section-type command kill section-type command
1099 on a parenthesis kill parentheses
1100 @end example
1102 Note that when killing @code{\begin, \end} or @code{%#BEGIN, %#END} pair,
1103 the lines @code{\begin, \end} or @code{%#BEGIN, %#END} exist will be
1104 killed entirely. So take care not to create any line that contains more
1105 than one @code{\begin} or so.
1107 While all operations above are to kill `containers' which surround some
1108 text, universal argument (@kbd{C-u}) for these commands kills not only
1109 `containers' but also `contents' of them. See below as a sample.
1111 @example
1112 Original text: [prefix] k C-u [prefix] k
1113 Main \footnote@{note@} here. Main note here. Main here.
1114 ~(cursor)
1115 @end example
1117 @node Filling, Updation of @code{\includeonly}, Changing and Deleting, Top
1118 @comment node-name, next, previous, up
1119 @chapter Filling
1120 @cindex filling
1122 @section Filling an item
1123 @cindex filling an item
1124 @cindex prefix i
1126 To fill a term (descriptive sentences) of @code{\item}, type
1128 @table @kbd
1129 @item [prefix] i
1130 @dots{} fill item
1131 @end table
1133 @noindent
1134 on that item.
1136 YaTeX uses the value of the variable @code{YaTeX-item-regexp} as the
1137 regular expression to search item header in itemize environment.
1138 If you make a newcommand to itemize terms(e.g. @code{\underlineitem}), put
1140 @lisp
1141 (setq YaTeX-item-regexp
1142 "\\(\\\\item\\)\\|\\(\\\\underlineitem\\)")
1143 @end lisp
1144 @cindex YaTeX-item-regexp
1146 in your @file{~/.emacs}. If you are not familiar with regular expression
1147 for Emacs-Lisp, name a newcommand for `itemize' beginning with
1148 @code{\item} such as @code{\itembf}, not @code{\bfitem}.
1150 This function -- YaTeX-fill-item -- reformats the @code{\item} into
1151 `hang-indented' style. When you separate the topic word and its
1152 description, use @kbd{M-q} instead. For example:
1154 @example
1155 Hang indentation:
1157 >\item[foo] `foo' is the typical word for describing an
1158 > arbitrarily written....
1160 Normal indentation:
1162 > \item bar
1164 > When the word `for' is used as an arbitrarily word, `bar'
1165 > is bound to follow it.
1166 @end example
1168 Note that the indent depth of an @code{\item} word and its descriptive
1169 paragraph are the same in latter case. If you want to use different
1170 depth, invoke fill-paragraph at the beginning of non-whitespace
1171 character(see below).
1173 @section Filling paragraph
1174 @cindex Filling paragraph
1175 @cindex M-q
1177 Fill-paragraph is little bit adapted for La@TeX{} sources. It retains from
1178 filling in certain environments where formatting leads to a disaster such
1179 as verbatim, tabular, or so. And it protects @code{\verb} expressions
1180 from being folded (The variable @code{YaTeX-verb-regexp} controls this).
1181 Besides, putting cursor on the first occurrence of non-whitespace
1182 character on a line changes the fill-prefix temporarily to the depth of
1183 the line.
1185 @node Updation of includeonly, What column?, Filling, Top
1186 @comment node-name, next, previous, up
1187 @chapter Updation of @code{\includeonly}
1188 @cindex includeonly
1190 When you edit splitting source texts, the notation
1192 @example
1193 \includeonly@{CurrentEditingFileName@}
1194 @end example
1196 @noindent
1197 in the main file reduces the time of typesetting. If you want
1198 to hack other file a little however, you have to rewrite it to
1200 @example
1201 \includeonly@{OtherFileNameYouWantToFix@}
1202 @end example
1204 @noindent
1205 in the main file. YaTeX automatically detects that the current
1206 edited text is not in includeonly list and prompts you
1208 @example
1209 A)dd R)eplace %)comment?
1210 @end example
1212 in the minibuffer. Type @kbd{a} if you want to add the current file name
1213 to @code{\includeonly} list, @kbd{r} to replace \@code{includeonly} list
1214 by the current file, and type @kbd{%} to comment out the
1215 @code{\includeonly} line.
1217 @node What column?, Intelligent newline, Updation of @code{\includeonly}, Top
1218 @comment node-name, next, previous, up
1219 @chapter What column?
1220 @cindex what column
1221 @cindex complex tabular
1222 @cindex prefix &
1224 We are often get tired of finding the corresponding column in
1225 large tabulars. For example,
1227 @example
1228 \begin@{tabular@}@{|c|c|c|c|c|c|c|c|@}\hline
1229 Name&Position&Post No.&Addr.&Phone No.&FAX No.&
1230 Home Addr.&Home Phone\\ \hline
1231 Thunder Bird & 6 & 223 & LA & xxx-yyy &
1232 zzz-www & Japan & 9876-54321 \\
1233 & 2 & \multicolumn@{2@}@{c|@}@{Unknown@}
1234 &&&(???)
1235 \\ \hline
1236 \end@{tabular@}
1237 @end example
1239 Suppose you have the cursor located at @code{(???)} mark, can you tell
1240 which column it is belonging at once? Maybe no. In such case,
1241 type
1243 @table @kbd
1244 @item [prefix] &
1245 @dots{} What column
1246 @end table
1248 @noindent
1249 in that position. YaTeX tells you the column header of the
1250 current field. Since YaTeX assumes the first line of tabular
1251 environment as a row of column headers, you can create a row of
1252 virtual column headers by putting them in the first line and
1253 commenting that line with @code{%}.
1255 @node Intelligent newline, Online help, What column?, Top
1256 @comment node-name, next, previous, up
1257 @chapter Intelligent newline
1258 @cindex Intelligent newline
1259 @cindex ESC RET
1260 @cindex M-C-m
1262 In tabular[*], array, itemize, enumerate or tabbing environment,
1264 @table @kbd
1265 @item ESC RET
1266 @dots{} Intelligent newline
1267 @end table
1269 @noindent
1270 inserts the contents corresponding to the current environment in the next
1271 line. In @code{tabular} environment, for example, @kbd{ESC RET} inserts
1272 the certain number of @code{&} and trailing @code{\\}, and @code{\hline}
1273 if other @code{\hline} is found in backward. Here are the list of
1274 contents v.s. environments.
1276 @itemize
1277 @item @code{tabular}, @code{tabular*}, @code{array}
1279 Corresponding number of @code{&} and @code{\\}.
1280 And @code{\hline} if needed.
1282 @item @code{tabbing}
1284 The same number of @code{\>} as @code{\=} in the first line.
1286 @item @code{itemize}, @code{enumerate}, @code{description}, @code{list}
1288 @code{\item} or @code{item[]}.
1289 @end itemize
1291 Note that since this function works seeing the contents of the first
1292 line, please call this after the second line if possible.
1294 If you want to apply these trick to other environments, @code{foo}
1295 environment for example, define the function named
1296 @code{YaTeX-intelligent-newline-foo} to insert corresponding contents.
1297 That function will be called at the beginning of the next line after the
1298 newline is inserted to the current line. Since the function
1299 @code{YaTeX-indent-line} is designed to indent the current line properly,
1300 calling this function before your code to insert certain contents must be
1301 useful. See the definition of the function
1302 @code{YaTeX-intelligent-newline-itemize} as an example.
1304 @node Online help, Browsing file hierarchy, Intelligent newline, Top
1305 @comment node-name, next, previous, up
1306 @chapter Online help
1307 @cindex online help
1308 @cindex prefix ?
1309 @cindex prefix /
1310 @cindex apropos
1311 @cindex keyword search
1313 YaTeX provides you the online help with popular La@TeX{} commands.
1315 Here are the key strokes for the online help.
1317 @table @kbd
1318 @item [prefix] ?
1319 @dots{} Online help
1320 @item [prefix] /
1321 @dots{} Online apropos
1322 @end table
1324 @section Online help
1326 `Online help' shows the documentation for the popular La@TeX{}
1327 commands(defaults to the commands on the cursor) in the next buffer.
1328 There are two help file, `global help' and `private help'. The former
1329 file contains the descriptions on the standard La@TeX{} command and is
1330 specified its name by variable @code{YaTeX-help-file}. Usually, the
1331 global help file should be located in public space (@code{$EMACSEXECPATH}
1332 by default) and should be world writable so that anyone can update it to
1333 enrich its contents. The latter file contains descriptions on
1334 non-standard or personal command definitions and is specified by
1335 @code{YaTeX-help-file-private}. This file should be put into private
1336 directory.
1338 @section Online apropos
1340 `Online apropos' is an equivalent of GNU Emacs's apropos. It
1341 shows all the documentations that contains the keyword entered by
1342 the user.
1344 @section When no descriptions are found...
1346 If there is no description on a command in help files, YaTeX
1347 requires you to write a description on that command. If you are
1348 willing to do, determine which help file to add and write the
1349 description on it referring your manual of (La)TeX. Please send
1350 me your additional descriptions if you describe the help on some
1351 standard commands. I might want to include it in the next
1352 distribution.
1354 @node Browsing file hierarchy, Cooperation with other packages, Online help, Top
1355 @comment node-name, next, previous, up
1356 @chapter Browsing file hierarchy
1357 @cindex hierarchy
1358 @cindex browsing
1360 When you are editing multi-file source, typing
1362 @table @kbd
1363 @item [prefix] d
1364 @dots{} browse file hierarchy
1365 @end table
1367 @noindent
1368 asks you the parent-most file (which may be defaulted) and displays the
1369 documentation hierarchy in the next window. In this buffer, the following
1370 commands are available.
1372 @table @kbd
1373 @item n
1374 @dots{} move to the next line and show its contents
1375 @item p
1376 @dots{} move to the previous line and show its contents
1377 @item N
1378 @dots{} move to the next file in the same inclusion level
1379 @item P
1380 @dots{} move to the previous file in the same inclusion level
1381 @item j
1382 @dots{} move to the next line
1383 @item k
1384 @dots{} move to the previous line
1385 @item u
1386 @dots{} move to the parent file
1387 @item .
1388 @dots{} show the current files contents in the next window
1389 @item SPC
1390 @dots{} scroll up the current file window
1391 @item DEL, b
1392 @dots{} scroll down the current file window
1393 @item <
1394 @dots{} show the beginning of the current file
1395 @item >
1396 @dots{} show the end of the current file
1397 @item >
1398 @dots{} return to the previous postion after @kbd{<} or @kbd{>}
1399 @item RET, g
1400 @dots{} open the current file in the next window
1401 @item mouse-2
1402 @dots{} same as RET(available only with window system)
1403 @item o
1404 @dots{} other window
1405 @item 1
1406 @dots{} delete other windows
1407 @item -
1408 @dots{} shrink hierarchy buffer window
1409 @item +
1410 @dots{} enlarge hierarchy buffer window
1411 @item ?
1412 @dots{} describe mode
1413 @item q
1414 @dots{} quit
1415 @end table
1417 Note that operations on the file contents in the next window do not work
1418 correctly when you close the corresponding file.
1420 @node Cooperation with other packages, Customizations, Browsing file hierarchy, Top
1421 @comment node-name, next, previous, up
1422 @chapter Cooperation with other packages
1424 YaTeX works better with other brilliant packages.
1426 @section gmhist
1427 @cindex gmhist
1428 @cindex command history
1429 @cindex minibuffer history
1431 When you are loading @file{gmhist.el} and @file{gmhist-mh.el}, you can
1432 use independent command history list at the prompt of preview command
1433 (@kbd{[prefix] tp}) and print command (@kbd{[prefix] tl}). On each
1434 prompt, you can enter the previous command line string repeatedly by
1435 typing @kbd{M-p}.
1437 @section min-out
1438 @cindex min-out
1440 @file{min-out}, the outline minor mode, can be used in yatex-mode
1441 buffers. If you want to use it with YaTeX, please refer the
1442 file @file{yatexm-o.el} as an example.
1444 @node Customizations, Etcetera, Cooperation with other packages, Top
1445 @comment node-name, next, previous, up
1446 @chapter Customizations
1447 @cindex customizations
1449 You can customize YaTeX by setting Emacs-Lisp variables and by making
1450 add-in functions.
1452 @menu
1453 * Lisp variables::
1454 * Add-in functions::
1455 * Add-in generator::
1456 @end menu
1458 @node Lisp variables, Add-in functions, Customizations, Customizations
1459 @comment node-name, next, previous, up
1460 @section Lisp variables
1461 @cindex customizable variables
1463 You can change the key assignments or make completion more
1464 comfortable by setting the values of various variables which
1465 control the movement of yatex-mode.
1467 For example, if you want to change the prefix key stroke from @kbd{C-c}
1468 to any other sequence, set YaTeX-prefix to whatever you want to use. If
1469 you don't want to use the key sequence @kbd{C-c letter} which is assumed
1470 to be the user reserved sequence in Emacs world, set
1471 @code{YaTeX-inhibit-prefix-letter} to @code{t}, and all of the default key
1472 bind of @kbd{C-c letter} will turn to the corresponding @kbd{C-c C-letter}
1473 (but the region based completions that is invoked with @kbd{C-c
1474 Capital-letter} remain valid, if you want to disable those bindings, set
1475 that variable to 1 instead of @code{t}).
1477 @menu
1478 * All customizable variables::
1479 * Sample definitions::
1480 * Hook variables::
1481 * Hook file::
1482 @end menu
1484 @node All customizable variables, Sample definitions, Lisp variables, Lisp variables
1485 @comment node-name, next, previous, up
1486 @subsection All customizable variables
1487 @cindex all customizable variables
1489 Here are the customizable variables of yatex-mode. Each value setq-ed
1490 in @file{~/.emacs} is preferred and that of defined in @file{yatex.el} is
1491 neglected. Parenthesized contents stands for the default value. When you
1492 are to change some of these variables, see more detailed documentation of
1493 the variable by @kbd{M-x describe-variable}.
1495 @defvar YaTeX-prefix
1496 Prefix key stroke (@kbd{C-c})
1497 @end defvar
1499 @defvar YaTeX-inhibit-prefix-letter
1500 Change key stroke from @kbd{C-c letter} to @kbd{C-c C-letter}
1501 (@code{nil})
1502 @end defvar
1504 @defvar YaTeX-fill-prefix
1505 Fill-prefix used in yatex-mode (@code{nil})
1506 @end defvar
1508 @defvar YaTeX-open-lines
1509 Number of blank lines between cursor and @code{\begin@{@}},
1510 @code{\@code{end}@{@}} (0)
1511 @end defvar
1513 @defvar YaTeX-user-completion-table
1514 Name of user dictionary where learned completion table will be stored.
1515 (@code{"~/.yatexrc"})
1516 @end defvar
1518 @defvar YaTeX-item-regexp
1519 Regular expression of item command(@code{"\\\\item"})
1520 @end defvar
1522 @defvar tex-command
1523 La@TeX{} typesetter command (@code{"latex"})
1524 @end defvar
1526 @defvar dvi2-command
1527 Preview command
1528 (@code{"xdvi -geo +0+0 -s 4 -display (getenv"DISPLAY")"})
1529 @end defvar
1531 @defvar dviprint-command-format
1532 Command format to print dvi file (@code{"dvi2ps %f %t %s | lpr"})
1533 @end defvar
1535 @defvar dviprint-from-format
1536 Start page format of above %f. %b will turn to start page
1537 (@code{"-f %b"})
1538 @end defvar
1540 @defvar dviprint-to-format
1541 End page format of above %t. %e will turn to @code{end} page
1542 (@code{"-t %e"})
1543 @end defvar
1545 @defvar section-name
1546 Initial default value at the first section-type completion
1547 (@code{"documentstyle"})
1548 @end defvar
1550 @defvar env-name
1551 Initial default value at the first begin-type completion
1552 (@code{"document"})
1553 @end defvar
1555 @defvar fontsize-name
1556 Ditto of large-type (@code{"large"})
1557 @end defvar
1559 @defvar single-command
1560 Ditto of maketitle-type (@code{"maketitle"})
1561 @end defvar
1563 @defvar YaTeX-need-nonstop
1564 Put @code{\nonstopmode@{@}} or not (@code{nil})
1565 @end defvar
1567 @defvar latex-warning-regexp
1568 Regular expression of warning message latex command puts out
1569 (@code{"line.* [0-9]*"})
1570 @end defvar
1572 @defvar latex-error-regexp
1573 Regular expression of error message (@code{"l\\.[1-9][0-9]*"})
1574 @end defvar
1576 @defvar latex-dos-emergency-message
1577 Message latex command running on DOS puts at abort
1578 (@code{"Emergency stop"})
1579 @end defvar
1581 @defvar YaTeX-item-regexp
1582 Regexp of La@TeX{} itemization command (@code{"\\\\(sub\\)*item"})
1583 @end defvar
1585 @defvar YaTeX-verb-regexp
1586 Regexp of La@TeX{} verb command family. Omit \\\\.
1587 (@code{"verb\\*?\\|path"})
1588 @end defvar
1590 @defvar YaTeX-nervous
1591 T for using local dictionary (@code{t})
1592 @end defvar
1594 @defvar YaTeX-sectioning-regexp
1595 Regexp of La@TeX{} sectioning command
1597 (@code{"part\\|chapter\\|\\(sub\\)*\\(section\\|paragraph\\)"})
1598 @end defvar
1600 @defvar YaTeX-fill-inhibit-environments
1601 Inhibit fill in these environments (@code{'("verbatim" "tabular")})
1602 @end defvar
1604 @defvar YaTeX-uncomment-once
1605 @code{T} for deleting all preceding @code{%} (@code{nil})
1606 @end defvar
1608 @defvar YaTeX-close-paren-always
1609 @code{T} for always close all parenthesis automatically,
1610 @code{nil} for only eol(@code{t})
1611 @end defvar
1613 @defvar YaTeX-auto-math-mode
1614 Switch math-mode automatically(@code{t})
1615 @end defvar
1617 @defvar YaTeX-math-key-list-private
1618 User defined alist, math-mode-prefix vs completion alist
1619 used in image completion(@code{nil}). See @file{yatexmth.el}
1620 for the information about how to define a completion alist.
1621 @end defvar
1623 @defvar YaTeX-default-pop-window-height
1624 Initial height of typesetting buffer when one-window.
1625 Number for the lines of the buffer, numerical string for
1626 the percentage of the screen-height.
1627 @code{nil} for half height(10)
1628 @end defvar
1630 @defvar YaTeX-help-file
1631 Global online help file name (@file{$EMACS/etc/YATEXHLP.jp})
1632 @end defvar
1634 @defvar YaTeX-help-file-private
1635 Private online help file name (@file{"~/YATEXHLP.jp"})
1636 @end defvar
1638 @defvar YaTeX-no-begend-shortcut
1639 Disable [prefix] b ?? shortcut (@code{nil)}
1640 @end defvar
1642 @defvar YaTeX-hilit-pattern-adjustment-private
1643 List of the list that contain the regular expression and the symbol of
1644 logical meaning of the string that matches the pattern. See also the
1645 value from @code{(assq 'yatex-mode hilit-patterns-alist)} and the value of
1646 @code{YaTeX-hilit-pattern-adjustment-default} (and even the document of
1647 hilit19.el).
1648 @end defvar
1650 @defvar YaTeX-sectioning-level
1651 Alist of LaTeX's sectioning command vs its height.
1652 @end defvar
1654 @defvar YaTeX-hierarchy-ignore-heading-regexp
1655 @code{YaTeX-display-hierarchy} searches for sectioning command first, and
1656 comment line secondary as a file headings. In latter case, ignore lines
1657 that match with regular expression of this variable. Default value of
1658 this variable is RCS header expressions and mode specifying line `-*- xxxx
1659 -*'.
1660 @end defvar
1662 @defvar YaTeX-skip-default-reader
1663 Non-nil for this variable skips the default argument reader of
1664 section-type command when add-in function for it is not defined.
1665 @end defvar
1667 @defvar YaTeX-create-file-prefix-g
1668 When typing @kbd{prefix g} on the @code{\include} line,
1669 open the target file even if the file doesn't exist(@code{nil}).
1670 @end defvar
1672 @defvar YaTeX-simple-messages
1673 Simplyfy messages of various completions(@code{nil})。
1674 @end defvar
1678 @node Sample definitions, Hook variables, All customizable variables, Lisp variables
1679 @comment node-name, next, previous, up
1680 @subsection Sample definitions
1681 @cindex prefix key stroke
1682 @cindex fill-prefix
1684 For instance, to change the prefix key stroke to @kbd{ESC}, and name of
1685 the user dictionary @file{~/src/emacs/yatexrc}, and set @code{fill-prefix}
1686 to single TAB character, add the following @code{setq} to @file{~/.emacs}.
1688 @lisp
1689 (setq YaTeX-prefix "\e"
1690 YaTeX-user-completion-table "~/src/emacs/yatexrc"
1691 YaTeX-fill-prefix " ")
1692 @end lisp
1694 @node Hook variables, Hook file, Sample definitions, Lisp variables
1695 @comment node-name, next, previous, up
1696 @subsection Hook variables
1697 @cindex hook variables
1699 More customizations will be done by the hook-function defined in
1700 hook-variable @code{yatex-mode-hook}. This is useful to define a shortcut
1701 key sequence to enter some environments other than @code{document} and
1702 @code{enumerate} etc. The following statement defines @code{[prefix] ba}
1703 to enter @code{\begin@{abstract@}} ... @code{=end@{abstract@}}
1704 immediately.
1706 @lisp
1707 (setq yatex-mode-hook
1708 '(lambda() (YaTeX-define-begend-key "ba" "abstract")))
1709 @end lisp
1711 You should use functions @code{YaTeX-define-key}, or
1712 @code{YaTeX-define-begend-key} to define all the key sequences of
1713 yatex-mode.
1715 @node Hook file, , Hook variables, Lisp variables
1716 @comment node-name, next, previous, up
1717 @subsection Hook file
1718 @cindex hook file
1720 You can stuff all of YaTeX relating expressions into a file named
1721 @file{yatexhks.el} if you have a lot of codes. YaTeX automatically load
1722 this file at the initialization of itself. Using @file{yatexhks.el}
1723 makes @code{yatex-mode-load-hook} unnecessary.
1725 @node Add-in functions, Add-in generator, Lisp variables, Customizations
1726 @comment node-name, next, previous, up
1727 @section Add-in functions
1728 @cindex add-in functions
1729 @cindex yatexadd.el
1731 You can easily define a function to input detailed arguments
1732 with completion according to La@TeX{} environments or commands.
1734 @c @node What is add-in functions?, , Add-in functions, Add-in functions
1735 @comment node-name, next, previous, up
1736 @subsection What is add-in functions?
1737 @cindex tabular
1739 When you input @code{tabular} environment, don't you think ``I want
1740 YaTeX to complete its argument toward my favorite one such as
1741 @code{@{|c|c|c|@}}...''? Yes, you can define the function to complete
1742 arguments for any environment and any La@TeX{} commands.
1744 @subsection Procedure
1746 Here is the procedure to define add-in functions.
1747 @enumerate
1748 @item
1749 Define the function
1750 @item
1751 Put the function into @file{yatexhks.el}
1752 @end enumerate
1754 @menu
1755 * How the add-in function works?::
1756 * How the function is called::
1757 * Useful functions for creating add-in::
1758 * Contribution::
1759 @end menu
1761 @node How the add-in function works?, How the function is called, Add-in functions, Add-in functions
1762 @comment node-name, next, previous, up
1763 @subsection How the add-in function works?
1765 There are two kinds of add-in. @dfn{Option add-in} returns the
1766 La@TeX{}'s optional parameters such as optional strings after
1767 @code{\begin@{ENV@}}, optional strings between a section-type command
1768 and its first argument, and optional strings just after type
1769 maketitle-type command. The following illustrates the name of add-in
1770 functions, where underlined strings are generated by add-in functions.
1772 @display
1773 \begin{table}[ht] (Function name: YaTeX:table)
1774 ~~~~
1775 \put(100,200){} (Function name: YaTeX:put)
1776 ~~~~~~~~~
1777 \sum_{i=0}^{n} (Function name: YaTeX:sum)
1778 ~~~~~~~~~~
1779 @end display
1781 Obviously, the function name is decided by concatenating the prefix
1782 `YaTeX:' and La@TeX{} command's name.
1784 Another add-in type is @dfn{argument add-in}, which completes arguments
1785 for section-type commands.
1787 @display
1788 \newcommand{\foo}{bar} (Function name: YaTeX::newcommand)
1789 ~~~~ ~~~
1790 @end display
1792 When the section-type command is inputted, the function named by
1793 concatenating `YaTeX::' and section-type command, is called automatically
1794 with an integer argument which indicates which argument of section-type
1795 command is being read. Thus the add-in should determine the
1796 job referring the value of its argument.
1798 @menu
1799 * Defining `option add-in'::
1800 * Defining `argument add-in'::
1801 @end menu
1803 @node Defining `option add-in', Defining `argument add-in', How the add-in function works?, How the add-in function works?
1804 @comment node-name, next, previous, up
1805 @subsubsection Defining `option add-in'
1807 If you want @code{@{|c|c|c|@}} for all @code{tabular} environment,
1809 @lisp
1810 (defun YaTeX:tabular ()
1811 "{|c|c|c|}")
1812 @end lisp
1814 @noindent
1815 is enough. If you want more complicated format, define as below.
1817 @lisp
1818 (defun YaTeX:tabular ()
1819 "@{@@@{\\vrule width 1pt\\ @}|||@@@{\\ \\vrule width 1pt@}@}")
1820 @end lisp
1822 @noindent
1823 Note that the character @code{\} must be described as @code{\\} in
1824 Emacs-Lisp. The next example reads the tabular format from keyboard.
1825 @lisp
1826 (defun YaTeX:tabular ()
1827 (concat "{" (read-string "Rule: ") "}"))
1828 @end lisp
1830 @node Defining `argument add-in', , Defining `option add-in', How the add-in function works?
1831 @comment node-name, next, previous, up
1832 @subsubsection Defining `argument add-in'
1834 This section describes how to define the add-in function for
1835 @code{\newcommand}.
1837 The first argument of @code{\newcommand} begins always with @code{\}.
1838 The second argument is usually so complex that we can not edit them in the
1839 minibuffer. Here is the created function considering this.
1841 @lisp
1842 (defun YaTeX::newcommand (n) ;n is argument position
1843 (cond
1844 ((= n 1) ;1st argument is macro name
1845 (read-string "Command: " "\\")) ;initial input `\'
1846 ((= n 2) "") ;do nothing when reading arg#2
1847 (t nil)))
1848 @end lisp
1850 Note that when the `argument add-in' function return `nil', normal
1851 argument reader will be called.
1853 @node How the function is called, Useful functions for creating add-in, How the add-in function works?, Add-in functions
1854 @comment node-name, next, previous, up
1855 @subsection How the function is called
1857 YaTeX calls the add-in functions for specified begin-type, section-type,
1858 and maketitle-type command, if any. `Option add-in' functions for
1859 begin-type are called when @code{\begin@{ENV@}} has been inserted,
1860 functions for section-type are called just before input of the first
1861 argument, and functions for maketitle-type is called after maketitle-type
1862 command has been inserted. `Argument add-in' functions are called at each
1863 entry of arguments for section-type commands.
1865 @node Useful functions for creating add-in, Contribution, How the function is called, Add-in functions
1866 @comment node-name, next, previous, up
1867 @subsection Useful functions for creating add-in
1869 Many add-in functions for typical La@TeX{} commands are defined in
1870 @file{yatexadd.el}. Those are also useful as references. Here are the
1871 short descriptions on useful functions, where [F] means function, [A]
1872 means arguments, [D] means description.
1874 @itemize
1875 @item [F]
1876 YaTeX:read-position
1877 @itemx [A]
1878 Character list which can show up in the brackets
1879 @itemx [D]
1880 Return the location specifier such as `[htb]'. When
1881 nothing is entered, omit [] itself. If the possible characters
1882 are "htbp", call this function as
1883 @code{(YaTeX:read-position "htbp")}
1885 @item [F]
1886 YaTeX:read-coordinates
1887 @itemx [A]
1888 Base prompt, X-axis prompt, Y-axis prompt (each optional)
1889 @itemx [D]
1890 Read the coordinates with the prompt ``BasePrompt X-axisPrompt:'' for
1891 X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form
1892 of ``(X,Y)''. The default prompts are @code{Dimension}, @code{X},
1893 @code{Y} respectively.
1895 @item [F]
1896 YaTeX:check-completion-type
1897 @itemx [A]
1898 One of the symbols: 'begin, 'section, or 'maketitle
1899 @itemx [D]
1900 Check the current completion type is specified one and cause error if
1901 not. The variable @code{YaTeX-current-completion-type} holds the symbol
1902 according to the current completion type.
1903 @end itemize
1905 @node Contribution, , Useful functions for creating add-in, Add-in functions
1906 @comment node-name, next, previous, up
1907 @subsection Contribution
1909 If you make your own pretty function and you let it be in public, please
1910 send me the function. I'm going to include it in the next release.
1912 @node Add-in generator, , Add-in functions, Customizations
1913 @comment node-name, next, previous, up
1914 @section Add-in generator
1916 First, don't forget to read the section of add-in functions @ref{Add-in
1917 functions}. If you easily understand how to define them, there's no need
1918 to read this section. But being not familiar with Emacs-Lisp, when you
1919 don't have clear idea what to do, this section describes how to get YaTeX
1920 make add-in function.
1922 There are two methods of generation. One is for fully interactive
1923 generator for beginners and another requires little knowledge of
1924 Emacs-Lisp.
1926 @subsection Generator for beginners
1927 The former generator is called by
1928 @center @kbd{M-x YaTeX-generate}
1930 @noindent
1931 strokes. All you have to do is follow the guidances. Defying them may cases
1932 the disaster (I wonder what is it???). So when you make some mistake, it
1933 is recommendable to type @kbd{C-g} and start afresh.
1935 @subsection Simple generator
1937 The latter generator is invoked by the next sequence.
1938 @center @kbd{M-x YaTeX-generate-simple}
1939 This generator can make both ``option add-in'' and ``argument add-in''
1940 (@emph{refer the section add-in functions}
1941 @ref{How the add-in function works?}), whereas @code{YaTeX-generate}
1942 cannot make ``argument addin''.
1944 For example, assume you have the LaTeX command as follows.
1946 @example
1947 \epsinput[t](250,50){hoge.eps}{plain}{Picture of foo}
1948 (A) (B) (1) (2) (3)
1949 (A)Optional parameter to specify the position
1950 One of t(top), b(bottom), l(left), r(right)
1951 (B)Maximum size of frame
1952 (1)1st argument is filename of EPS file
1953 (2)2nd argument indicates
1954 plain do nothing
1955 frame make frame around image
1956 dframe make double-frame around image
1957 for included EPS file.
1958 (3)Caption for the picture
1959 @end example
1961 Now get start with generation. Typing @kbd{M-x YaTeX-generate-simple}
1962 brings the prompt:
1963 @display
1964 (O)ption? (A)rgument?
1965 @end display
1967 @subsubsection Generating ``option add-in''
1968 @cindex option add-in
1970 Since (A), (B) above are optional argument, all we have to do to
1971 complete them is define the option add-in for them. Let's generate the
1972 function to complete (A).
1974 @display
1975 M-x YaTeX-generate-simple RET
1976 epsinput RET
1978 @end display
1980 @noindent
1981 Typing as above leads the next prompt.
1983 @display
1984 Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit
1985 @end display
1987 @noindent
1988 This asks that ``Which type is the completion style of 1st argument?''.
1989 Here are the possible completion style.
1991 @table @code
1992 @item String
1993 read plain string
1994 @item Complete
1995 read with completion
1996 @item File
1997 read file name
1998 @item Option
1999 read optional string (if string omitted, omit [] too)
2000 @item Position
2001 read positional option (like [htbp])
2002 @item Coord.
2003 read coordinates
2004 @item Quit
2005 quit from generating
2006 @end table
2008 Since (A) is the optional argument to specify the location of included
2009 EPS file, the completion style is @code{Position}, and the possible
2010 characters are t, b, l, and r. To tell these information to generator,
2011 operate as follows.
2013 @display
2014 Read type(1).... p
2015 Acceptable characters: tblr RET
2016 @end display
2018 (B) is coordinate. So its completion style is coOrd. We want a prompt
2019 meaning ``Maximum size'' when completion.
2021 @display
2022 Read type(2).... o
2023 Prompt for coordinates: Max size RET
2024 @end display
2026 That's all for optional argument. Select quit.
2028 @display
2029 Read type(3).... q
2030 @end display
2032 Then the generated option add-in function for \epsinput will be shown in
2033 the next window.
2035 @subsubsection Generating ``argument add-in''
2036 @cindex argument add-in
2038 Next, create the argument add-in. The arguments for \epsinput are EPS
2039 file name, framing style, and caption string in sequence.
2041 @display
2042 M-x YaTeX-generate-simple RET
2043 epsinput RET
2045 @end display
2047 Above key strokes bring the prompt that asks the number of argument.
2048 Answer it with 3.
2050 @display
2051 How many arguments?: 3 RET
2052 @end display
2054 Then the generator asks the completion style and prompt for completion.
2055 Answer them. @kbd{f} for FileName and prompt string.
2057 @display
2058 Read type(1).... f
2059 Prompt for argument#1 EPS file name RET
2060 @end display
2062 The second argument is one of selected symbol. So the completion type
2063 is @code{Completion}.
2065 @display
2066 Read type(2).... c
2067 Prompt for argument#2 Include style RET
2068 @end display
2070 Then all the candidates ready to be read. Type single RET after
2071 entering all.
2073 @display
2074 Item[1](RET to exit): plain RET
2075 Item[2](RET to exit): frame RET
2076 Item[3](RET to exit): dframe RET
2077 Item[4](RET to exit): RET
2078 @end display
2080 The following prompt asks whether the entered string must belong to
2081 candidates or not. In this case, since the argument must be one of
2082 @code{plain}, @code{frame}, and @code{dframe}, type @code{y}.
2084 @display
2085 Require match? (y or n) y
2086 @end display
2088 The last argument is the caption string for which any completion is
2089 needed.
2091 @display
2092 Read type(3).... s
2093 Prompt for argument#3 Caption RET
2094 default: Figure of RET
2095 @end display
2097 Finally we'll get the argument add-in in the next window.
2099 @subsection Contribution
2101 If you get your own pretty function and you let it be in public, please
2102 steel yourself in the happy atmosphere and do not send me the function.
2103 I do know it is not fine because it is generated by yatexgen:-p.
2105 @node Etcetera, Copying, Customizations, Top
2106 @comment node-name, next, previous, up
2107 @chapter Etcetera
2109 The standard completion tables provided in @file{yatex.el} contain a
2110 few La@TeX{} commands I frequently use. This is to lessen the key
2111 strokes to complete entire word, because too many candidates
2112 rarely used often cause too many hits. Therefore always try to
2113 use completion in order to enrich your dictionary, and you will
2114 also find `Wild Bird' growing suitable for your La@TeX{} style.
2116 The package name `Wild Bird' is the English translation of Japanese
2117 title `Yachou', which is a trick on words of Japanese.
2119 @node Copying, , Etcetera, Top
2120 @comment node-name, next, previous, up
2121 @chapter Copying
2123 This program is distributed as a free software. You can
2124 redistribute this software freely but with NO warranty to anything
2125 as a result of using this software. However, any reports and
2126 suggestions are welcome as long as I feel interests in this
2127 software. My possible e-mail address is `yuuji@@ae.keio.ac.jp'.
2128 (up to Mar.1995 at least) And there is mailing list for YaTeX.
2129 Although the common language is Japanese, questions in English will be
2130 welcome. To join the ML, send the mail whose subject is `append' to
2131 the address `yatex-control@@harvest.jaist.ac.jp'. If you have some
2132 question, please ask to `yatex-request@@harvest.jaist.ac.jp'.
2134 The specification of this software will be surely modified
2135 (depending on my feelings) without notice :-p.
2138 @flushright
2139 HIROSE Yuuji
2140 @end flushright
2141 @bye
2143 Local variables:
2144 mode: texinfo
2145 fill-prefix: nil
2146 fill-column: 74
2147 End: