yatex

view docs/yatexe.tex @ 52:5d94deabb9f9

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