yatex

view docs/yatexe.tex @ 79:0734be649cb8

Do not care file-coding-system when YaTeX-kanji-code is nil. New completion yatexpkg.el is introduced.
author yuuji
date Thu, 25 Dec 2003 04:10:32 +0000
parents f41b01fef5d6
children 9b4354af748c
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 @c Last modified Fri Sep 12 12:04:11 2003 on firestorm
9 @syncodeindex vr cp
10 @end iftex
12 @titlepage
13 @sp 10
14 @center
15 @subtitle Yet Another tex-mode for emacs
16 @title Wild Bird
17 @subtitle // YaTeX //
18 @author @copyright{} 1991-2003 by HIROSE, Yuuji [yuuji@@yatex.org]
19 @end titlepage
21 @node Top, What is YaTeX?, (dir), (dir)
22 @comment node-name, next, previous, up
23 @cindex Demacs
24 @cindex Mule
25 @cindex LaTeX
26 @cindex YaTeX
28 @menu
29 * What is YaTeX?::
30 * Main features:: What YaTeX can do
31 * Installation:: Guide to install
32 * Typesetting:: Call typesetting processes
33 * %#notation:: Meta-keyword `%#'
34 * Completion:: Input LaTeX commands with completion
35 * Local dictionaries:: Directory dependent completion
36 * Commenting out:: Commenting/uncommenting text
37 * Cursor jump:: Jumping to related position
38 * Changing and Deleting:: Changing/deleting certain unit of text
39 * Filling:: Filling an item or paragraph
40 * Updation of includeonly:: Free from maintaining includeonly
41 * What column:: Check what table-column the cursor belong
42 * Intelligent newline:: Guess requisites of new line
43 * Usepackage checker:: Selecting correct \usepackage is YaTeX's job
44 * Online help:: On-line documentation of LaTeX
45 * Browsing file hierarchy:: Walking through file hierarchy
46 * Cooperation with other packages:: Work well with gmhist, min-out
47 * Customizations:: How to breed `Wild Bird'
48 * Etcetera:: YaTeX is acquisitive.
49 * Copying:: Redistribution
52 @node What is YaTeX?, Main features, Top, Top
53 @comment node-name, next, previous, up
54 @chapter What is YaTeX?
56 YaTeX automates typesetting and previewing of LaTeX and enables
57 completing input of LaTeX mark-up command such as
58 @code{\begin@{@}}..@code{\end@{@}}.
60 YaTeX also supports Demacs which runs on MS-DOS(386), Mule (Multi
61 Language Enhancement to GNU Emacs), and latex on DOS.
63 @node Main features, Installation, What is YaTeX?, Top
64 @comment node-name, next, previous, up
65 @chapter Main features
67 @itemize
68 @item Invocation of typesetter, previewer and related programs(@kbd{C-c t})
69 @item Typesetting on static region which is independent from point
70 @item Semiautomatic replacing of @code{\includeonly}
71 @item Jumping to error line(@kbd{C-c '})
72 @item Completing-read of La@TeX{} commands such as @code{\begin@{@}},
73 @code{\section} etc.
74 (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m})
75 @item Enclosing text into La@TeX{} environments or commands
76 (@kbd{C-u} @var{AboveKeyStrokes})
77 @item Displaying the structure of text at entering sectioning commands
78 @item Lump shifting of sectioning commands (@ref{view-sectioning})
79 @item Learning unknown/new La@TeX{} commands for the next completion
80 @item Argument reading with a guide for complicated La@TeX{} commands
81 @item Generating argument-readers for new/unsupported commands(@file{yatexgen})
82 @item Quick changing or deleting of La@TeX{} commands(@kbd{C-c c}, @kbd{C-c k})
83 @item Jumping from and to inter-file, begin<->end, ref<->label(@kbd{C-c g})
84 @item Blanket commenting out or uncommenting
85 (@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
86 @item Easy input of accent mark, math-mode's commands and Greek letters
87 (@kbd{C-c a}, @kbd{;}, @kbd{:})
88 @item Online help for the popular La@TeX{} commands
89 (@kbd{C-c ?}, @kbd{C-c /})
90 @item Document files hierarchy browser (@kbd{C-c d})
91 @end itemize
93 @node Installation, Typesetting, Main features, Top
94 @comment node-name, next, previous, up
95 @chapter Installation
96 @cindex installation
97 @cindex .emacs
98 @cindex auto-mode-alist
99 @cindex autoload
101 Put next two expressions into your @file{~/.emacs}.
103 @lisp
104 (setq auto-mode-alist
105 (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
106 (autoload 'yatex-mode "yatex" "Yet Another La@TeX{} mode" t)
107 @end lisp
109 Next, add certain path name where you put files of YaTeX to your
110 load-path. If you want to put them in @file{~/src/emacs}, write
112 @lisp
113 (setq load-path
114 (cons (expand-file-name "~/src/emacs") load-path))
115 @end lisp
117 @noindent
118 in your @file{~/.emacs}
120 Then, yatex-mode will be automatically loaded when you visit a
121 file which has extension @file{.tex}. If yatex-mode is successfully
122 loaded, mode string on mode line will be turned to "YaTeX".
125 @node Typesetting, %#notation, Installation, Top
126 @comment node-name, next, previous, up
127 @chapter Typesetting
128 @cindex typesetting
129 @cindex previewer
130 @cindex typesetter
131 @cindex latex
132 @cindex printing out
134 The prefix key stroke of yatex-mode is @kbd{C-c} (Press 'C' with Control
135 key) by default. If you don't intend to change the prefix key stroke,
136 assume all @kbd{[prefix]} as @kbd{C-c} in this document. These key
137 strokes execute typeset or preview command.
139 @table @kbd
140 @item [prefix] t j
141 @dots{} invoke latex
142 @item [prefix] t r
143 @dots{} invoke latex on region
144 @item [prefix] t k
145 @dots{} kill current typesetting process
146 @item [prefix] t b
147 @dots{} invoke bibtex
148 @item [prefix] t p
149 @dots{} preview
150 @item [prefix] t l
151 @dots{} lpr dvi-file
152 @item [prefix] t s
153 @dots{} search current string on xdvi-remote
154 @end table
156 @menu
157 * Calling typesetter::
158 * Calling previewer::
159 * Printing out::
160 @end menu
162 @node Calling typesetter, Calling previewer, Typesetting, Typesetting
163 @comment node-name, next, previous, up
164 @section Calling typesetter
166 Typing @kbd{[prefix] t j}, the current editing window will be divided
167 horizontally when you invoke latex command, and log message of La@TeX{}
168 typesetting will be displayed in the other window; called typesetting
169 buffer. The typesetting buffer automatically scrolls up and traces
170 La@TeX{} warnings and error messages. If you see latex stopping by an
171 error, you can send string to latex in the typesetting buffer.
173 If an error stops the La@TeX{} typesetting, this key stroke will
174 move the cursor to the line where La@TeX{} error is detected.
176 @table @kbd
177 @item [prefix] '
178 @itemx ([prefix]+single quotation)
180 @dots{} jump to the previous error or warning
181 @end table
183 If you find a noticeable error, move to the typesetting buffer and move
184 the cursor on the line of error message and type @kbd{SPACE} key. This
185 makes the cursor move to corresponding source line.
187 Since @kbd{[prefix] tr} pastes the region into the file
188 @file{texput.tex} in the current directory, you should be careful of
189 overwriting. The method of specification of the region is shown in the
190 section @xref{%#notation}.
192 The documentclass for typeset-region is the same as that of editing
193 file if you edit one file, and is the same as main file's if you
194 edit splitting files.
196 @node Calling previewer, Printing out, Calling typesetter, Typesetting
197 @comment node-name, next, previous, up
198 @section Calling previewer
200 @kbd{[prefix] t p} invokes the TeX previewer. And if you are using
201 xdvi-remote, which can be controled from other terminals, @kbd{[prefix] t
202 s} enables you to search current string at the cursor on the running xdvi
203 window.
205 @node Printing out, , Calling previewer, Typesetting
206 @comment node-name, next, previous, up
207 @section Printing out
209 When you type @code{[preifx] t l}, YaTeX asks you the range of
210 dvi-printing by default. You can skip this by invoking it with
211 universal-argument as follows:
213 @example
214 C-u [prefix] tl
215 @end example
217 @node %#notation, Completion, Typesetting, Top
218 @comment node-name, next, previous, up
219 @chapter %# notation
220 @cindex %# notation
222 You can control the typesetting process by describing @code{%#}
223 notations in the source text.
225 @menu
226 * Changing typesetter::
227 * Splitting input files::
228 * Static region for typesetting::
229 * Lpr format::
230 * Editing %# notation::
231 @end menu
233 @node Changing typesetter, Splitting input files, %#notation, %#notation
234 @comment node-name, next, previous, up
235 @section To change the `latex' command or to split a source text.
236 @cindex typesetter
238 To change the typesetting command, write
240 @example
241 %#!latex-big
242 @end example
244 @noindent
245 anywhere in the source text. This is useful for changing
246 typesetter.
248 @node Splitting input files, Static region for typesetting, Changing typesetter, %#notation
249 @comment node-name, next, previous, up
250 @section Splitting input files
252 And if you split the source text and
253 edit subfile that should be included from main text.
255 @example
256 %#!latex main.tex
257 @end example
259 @noindent
260 will be helpful to execute latex on main file from sub text buffer. Since
261 this command line after @kbd{%#!} will be sent to shell literally, next
262 description makes it convenient to use ghostview as dvi-previewer.
264 @example
265 %#!latex main ; dvi2ps main.dvi > main
266 @end example
268 @noindent
269 Note that YaTeX assumes the component before the last period of
270 the last word in this line as base name of the main La@TeX{} source.
272 To make best use of the feature of inter-file jumping by
273 @kbd{[prefix] g} (see @ref{Cursor jump}), take described below into
274 consideration.
276 @itemize
277 @item You can put split texts in sub directory, but not in
278 sub directory of sub directory.
279 @item In the main text, specify the child file name with relative path name
280 such as \include@{chap1/sub@}, when you include the file in
281 a sub-directory.
282 @item In a sub-text, write @code{%#!latex main.tex} even if @file{main.tex}
283 is in the parent directory(not %#!latex ../main.tex).
284 @end itemize
286 @node Static region for typesetting, Lpr format, Splitting input files, %#notation
287 @comment node-name, next, previous, up
288 @section Static region
289 @cindex static region
290 @cindex Fixed region
292 Typeset-region by @kbd{[prefix] tr} passes the region between point and
293 mark to typesetting command by default. But when you want to typeset
294 static region, enclose the region by @code{%#BEGIN} and @code{%#END} as
295 follows.
297 @example
298 %#BEGIN
299 TheRegionYouWantToTypesetManyTimes
300 %#END
301 @end example
303 This is the rule of deciding the region.
305 @enumerate
306 @item
307 If there exists %#BEGIN before point,
309 @enumerate
310 @item
311 If there exists %#END after %#BEGIN,
312 @itemize
313 @item From %#BEGIN to %#END.
314 @end itemize
316 @item
317 If %#END does not exist after %#BEGIN,
318 @itemize
319 @item From %#BEGIN to the end of buffer.
320 @end itemize
321 @end enumerate
323 @item
324 If there does not exist %#BEGIN before point,
325 @itemize
326 @item Between point and mark(standard method of Emacs).
327 @end itemize
328 @end enumerate
330 It is useful to write @code{%#BEGIN} in the previous line of \begin and
331 @code{%#END} in the next line of \@code{end} when you try complex
332 environment such as `tabular' many times. It is also useful to put only
333 @code{%#BEGIN} alone at the middle of very long text. Do not forget to
334 erase @code{%#BEGIN} @code{%#END} pair.
336 @node Lpr format, Editing %# notation, Static region for typesetting, %#notation
337 @comment node-name, next, previous, up
338 @section Lpr format
339 @cindex lpr format
341 Lpr format is specified by three Lisp variables. Here are the
342 default values of them.
344 @table @code
345 @item (1)dviprint-command-format
346 @code{"dvi2ps %f %t %s | lpr"}
347 @item (2)dviprint-from-format
348 @code{"-f %b"}
349 @item (3)dviprint-to-format
350 @code{"-t %e"}
351 @end table
353 On YaTeX-lpr, @code{%s} in (1) is replaced by the file name of main
354 text, @code{%f} by contents of (2), %t by contents of (3). At these
355 replacements, @code{%b} in (2) is also replaced by the number of beginning
356 page, @code{%e} in (3) is replaced by the number of ending page. But
357 @code{%f} and @code{%t} are ignored when you omit the range of print-out
358 by @kbd{C-u [prefix] tl}.
360 If you want to change this lpr format temporarily, put a command
361 such as follows somewhere in the text:
363 @example
364 %#LPR dvi2ps %f %t %s | 4up -page 4 | texfix | lpr -Plp2
365 @end example
367 And if you want YaTeX not to ask you the range of printing
368 out, the next example may be helpful.
370 @example
371 %#LPR dvi2ps %s | lpr
372 @end example
374 @node Editing %# notation, , Lpr format, %#notation
375 @comment node-name, next, previous, up
376 @section Editing %# notation
378 To edit @code{%#} notation described above, type
380 @table @kbd
381 @item [prefix] %
382 @dots{} editing %# notation menu
383 @end table
385 @noindent
386 and select one of the entry of the menu as follows.
388 @example
389 !)Edit-%#! B)EGIN-END-region L)Edit-%#LPR
390 @end example
392 @noindent
393 Type @kbd{!} to edit @code{%#!} entry, @code{b} to enclose the region with
394 @code{%#BEGIN} and @code{%#END}, and @code{l} to edit @code{%#LPR} entry.
395 When you type @kbd{b}, all @code{%#BEGIN} and @code{%#END} are
396 automatically erased.
398 @node Completion, Local dictionaries, %#notation, Top
399 @comment node-name, next, previous, up
400 @chapter Completion
401 @cindex completion
403 YaTeX makes it easy to input the La@TeX{} commands. There are several
404 kinds of completion type, begin-type, section-type, large-type, etc...
406 @menu
407 * Begin-type completion::
408 * Section-type completion::
409 * Large-type completion::
410 * Maketitle-type completion::
411 * Arbitrary completion::
412 * End completion::
413 * Accent completion::
414 * Image completion::
415 * Greek letters completion::
416 @end menu
418 @node Begin-type completion, Section-type completion, Completion, Completion
419 @comment node-name, next, previous, up
420 @section Begin-type completion
421 @cindex begin-type completion
422 @cindex environment
423 @cindex prefix b
425 "Begin-type completion" completes commands of @code{\begin@{env@}} ...
426 @code{\end@{env@}}. All of the begin-type completions begin with this key
427 sequence.
429 @table @kbd
430 @item [prefix] b
431 @dots{} start begin-type completion
432 @end table
434 @noindent
435 An additional key stroke immediately completes a frequently used
436 La@TeX{} @code{\begin@{@}}...@code{\@code{end}@{@}} environment.
438 @table @kbd
439 @item [prefix] b c
440 @dots{} @code{\begin@{center@}...\end@{center@}}
441 @item [prefix] b d
442 @dots{} @code{\begin@{document@}...\end@{document@}}
443 @item [prefix] b D
444 @dots{} @code{\begin@{description@}...\end@{description@}}
445 @item [prefix] b e
446 @dots{} @code{\begin@{enumerate@}...\end@{enumerate@}}
447 @item [prefix] b E
448 @dots{} @code{\begin@{equation@}...\end@{equation@}}
449 @item [prefix] b i
450 @dots{} @code{\begin@{itemize@}...\end@{itemize@}}
451 @item [prefix] b l
452 @dots{} @code{\begin@{flushleft@}...\end@{flushleft@}}
453 @item [prefix] b m
454 @dots{} @code{\begin@{minipage@}...\end@{minipage@}}
455 @item [prefix] b t
456 @dots{} @code{\begin@{tabbing@}...\end@{tabbing@}}
457 @item [prefix] b T
458 @dots{} @code{\begin@{tabular@}...\end@{tabular@}}
459 @item [prefix] b^T
460 @dots{} @code{\begin@{table@}...\end@{table@}}
461 @item [prefix] b p
462 @dots{} @code{\begin@{picture@}...\end@{picture@}}
463 @item [prefix] b q
464 @dots{} @code{\begin@{quote@}...\end@{quote@}}
465 @item [prefix] b Q
466 @dots{} @code{\begin@{quotation@}...\end@{quotation@}}
467 @item [prefix] b r
468 @dots{} @code{\begin@{flushright@}...\end@{flushright@}}
469 @item [prefix] b v
470 @dots{} @code{\begin@{verbatim@}...\end@{verbatim@}}
471 @item [prefix] b V
472 @dots{} @code{\begin@{verse@}...\end@{verse@}}
473 @end table
475 Any other La@TeX{} environments are made by completing-read of the
476 Emacs function.
478 @table @kbd
479 @item [prefix] b SPACE
480 @dots{} begin-type completion
481 @end table
483 @noindent
484 The next message will show up in the minibuffer
486 @example
487 Begin environment(default document):
488 @end example
490 @noindent
491 by typing @kbd{[prefix] b}. Put the wishing environment with completion
492 in the minibuffer, and @code{\begin@{env@}}...\@code{\end@{env@}} will be
493 inserted in the La@TeX{} source text. If the environment you want to put
494 does not exist in the YaTeX completion table, it will be registered in the
495 user completion table. YaTeX automatically saves the user completion
496 table in the user dictionary file at exiting of emacs.
498 At the completion of certain environments, the expected initial entry will
499 automatically inserted such as @code{\item} for @code{itemize}
500 environment. If you don't want the entry, it can be removed by undoing.
502 If you want to enclose some paragraphs which have already been
503 written, invoke the begin-type completion with changing the case
504 of @kbd{b} of key sequence upper(or invoke it with universal argument
505 by @kbd{C-u} prefix).
506 @cindex enclose region into environment
508 The following example encloses a region with `description'
509 environment.
511 @table @kbd
512 @item [prefix] B D
513 @itemx (or ESC 1 [prefix] b D)
514 @itemx (or C-u [prefix] b D)
516 @dots{} begin-type completion for region
517 @end table
519 This enclosing holds good for the completing input by @kbd{[prefix] b
520 SPC}. @kbd{[prefix] B SPC} enclose a region with the environment selected
521 by completing-read.
523 @node Section-type completion, Large-type completion, Begin-type completion, Completion
524 @comment node-name, next, previous, up
525 @section Section-type completion
526 @cindex section-type completion
527 @cindex prefix s
529 "Section-type completion" completes section-type commands which take an
530 argument or more such as @code{\section@{foo@}}. To invoke section-type
531 completion, type
533 @table @kbd
534 @item [prefix] s
535 @dots{} section-type completion
536 @end table
538 @noindent
539 then the prompt
541 @example
542 (C-v for view) \???@{@} (default documentclass):
543 @end example
545 @noindent
546 will show up in the minibuffer. Section-type La@TeX{} commands are
547 completed by space key, and the default value is selected when you
548 type nothing in the minibuffer.
550 Next,
552 @example
553 \section@{???@}:
554 @end example
556 @noindent
557 prompts you the argument of section-type La@TeX{} command. For
558 example, the following inputs
560 @example
561 \???@{@} (default documentclass): section
562 \section@{???@}: Hello world.
563 @end example
565 @noindent
566 will insert the string
568 @example
569 \section@{Hello world.@}
570 @end example
572 in your La@TeX{} source. When you neglect argument such as
574 @example
575 (C-v for view) \???@{@} (default section): vspace*
576 \vspace*@{???@}:
577 @end example
579 YaTeX puts
581 @example
582 \vspace*@{@}
583 @end example
585 @noindent
586 and move the cursor in the braces.
588 In La@TeX{} command, there are commands which take more than one
589 arguments such as @code{\addtolength@{\topmargin@}@{8mm@}}. To complete these
590 commands, invoke section-type completion with universal argument as,
591 @cindex number of argument
593 @example
594 C-u 2 [prefix] s (or ESC 2 [prefix] s)
595 @end example
597 @noindent
598 and make answers in minibuffer like this.
600 @example
601 (C-v for view) \???@{@} (default vspace*): addtolength
602 \addtolength@{???@}: \topmargin
603 Argument 2: 8mm
604 @end example
606 @code{\addtolength} and the first argument @code{\topmargin} can be typed
607 easily by completing read. Since YaTeX also learns the number of
608 arguments of section-type command and will ask that many arguments in
609 future completion, you had better tell the number of arguments to YaTeX at
610 the first completion of the new word. But you can change the number of
611 arguments by calling the completion with different universal argument
612 again.
615 Invoking section-type completion with @code{[Prefix] S} (Capital `S')
616 includes the region as the first argument of section-type command.
618 The section/large/maketitle type completion can work at the
619 prompt for the argument of other section-type completion.
620 Nested La@TeX{} commands are efficiently read with the recursive
621 completion by typing YaTeX's completion key sequence in the
622 minibuffer.
624 @menu
625 * view-sectioning::
626 @end menu
628 @node view-sectioning, , Section-type completion, Section-type completion
629 @comment node-name, next, previous, up
630 @subsection view-sectioning
631 @cindex view sectioning
632 @cindex outline
634 In the minibuffer at the prompt of section-type command completion,
635 typing @kbd{C-v} shows a list of sectioning commands in source text(The
636 line with @code{<<--} mark is the nearest sectioning command). Then,
637 default sectioning command appears in the minibuffer. You can go up/down
638 sectioning command by typing @kbd{C-p}/@kbd{C-n}, can scrolls up/down the
639 listing buffer by @kbd{C-v}/@kbd{M-v}, and can hide sectioning commands
640 under certain level by 0 through 6. Type @kbd{?} in the minibuffer of
641 sectioning prompt for more information.
643 You can generate this listing buffer (@code{*Sectioning Lines*} buffer)
644 by typing
645 @table @kbd
646 @item M-x YaTeX-section-overview
647 @dots{} Generate *Sectioning Lines* buffer
648 @end table
649 @cindex{Generate the listing of sectioning units}
650 from the LaTeX source buffer. In this listing buffer, typing @kbd{u} on
651 the sectioning command shifts up the corresponding sectioning command in
652 source text and @kbd{d} shifts down. After marking lines in the listing
653 buffer, typing @kbd{U} shifts up all sectioning commands in the region,
654 and @kbd{U} shifts down. Here are all the key bindings of
655 @code{*Sectioning Lines*} buffer.
657 @table @kbd
658 @item SPC
659 @dots{} Jump to corresponding source line
660 @item .
661 @dots{} Display corresponding source line
662 @item u
663 @dots{} Shift up a sectioning line
664 @item d
665 @dots{} Shift down a sectioning line
666 @item U
667 @dots{} Shift up sectioning lines in region
668 @item D
669 @dots{} Shift down sectioning lines in region
670 @item 0@dots{}6
671 @dots{} Hide sectioning commands whose level is lower than n
672 @end table
675 @node Large-type completion, Maketitle-type completion, Section-type completion, Completion
676 @comment node-name, next, previous, up
677 @section Large-type completion
679 "Large-type completion" inputs the font or size changing
680 descriptions such as @code{@{\large @}}. When you type
682 @table @kbd
683 @item [prefix] l
684 @dots{} large-type completion
685 @end table
687 @noindent
688 the message in the minibuffer
690 @example
691 @{\??? @} (default large):
692 @end example
694 prompts prompts you large-type command with completing-read. There are
695 TeX commands to change fonts or sizes, @code{it}, @code{huge} and so on,
696 in the completion table.
698 Region-based completion is also invoked by changing the letter after
699 prefix key stroke as @kbd{[prefix] L}. It encloses the region by braces
700 with large-type command.
702 @node Maketitle-type completion, Arbitrary completion, Large-type completion, Completion
703 @comment node-name, next, previous, up
704 @section Maketitle-type completion
705 @cindex maketitle-type completion
707 We call it "maketitle-type completion" which completes commands such as
708 @code{\maketitle}. Take notice that maketitle-type commands take no
709 arguments. Then, typing
711 @table @kbd
712 @item [prefix] m
713 @dots{} maketitle-type completion
714 @end table
716 @noindent
717 begins maketitle-completion. Above mentioned method is true for
718 maketitle-completion, and there are La@TeX{} commands with no
719 arguments in completion table.
721 @node Arbitrary completion, End completion, Maketitle-type completion, Completion
722 @comment node-name, next, previous, up
723 @section Arbitrary completion
724 @cindex arbitrary completion
726 @noindent
727 You can complete certain La@TeX{} command anywhere without typical
728 completing method as described, by typing
730 @table @kbd
731 @item [prefix] SPC
732 @dots{} arbitrary completion
733 @end table
735 @noindent
736 after the initial string of La@TeX{} command that is preceded by @code{\}.
738 @node End completion, Accent completion, Arbitrary completion, Completion
739 @comment node-name, next, previous, up
740 @section End completion
741 @cindex end completion
743 @noindent
744 YaTeX automatically detects the opened environment and close it with
745 \@code{\end@{environment@}}. Though proficient YaTeX users never fail to
746 make environment with begin-type completion, some may begin an environment
747 manually. In that case, type
749 @table @kbd
750 @item [prefix] e
751 @dots{} @code{end} completion
752 @end table
754 @noindent
755 at the end of the opened environment.
757 @node Accent completion, Image completion, End completion, Completion
758 @comment node-name, next, previous, up
759 @section Accent completion
760 @cindex accent completion
762 When you want to write the European accent marks(like @code{\`@{o@}}),
764 @table @kbd
765 @item [prefix] a
766 @dots{} accent completion
767 @end table
769 @noindent
770 shows the menu
772 @example
773 1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b
774 @end example
776 @noindent
777 in the minibuffer. Chose one character or corresponding numeric,
778 and you will see
780 @example
781 \`@{@}
782 @end example
784 @noindent
785 in the editing buffer with the cursor positioned in braces. Type
786 one more character `o' for example, then
788 @example
789 \`@{o@}
790 @end example
792 @noindent
793 will be completed, and the cursor gets out from braces.
795 @node Image completion, Greek letters completion, Accent completion, Completion
796 @comment node-name, next, previous, up
797 @section Image completion of mathematical sign
798 @cindex image completion
799 @cindex math-mode
800 @cindex sigma
801 @cindex leftarrow
802 @cindex ;
804 Arrow marks, sigma mark and those signs mainly used in the
805 TeX's math environment are completed by key sequences which
806 imitate the corresponding symbols graphically. This completion
807 only works in the math environment. YaTeX automatically detects
808 whether the cursor located in math environment or not, and
809 change the behavior of key strokes @kbd{;} and @kbd{:}.
811 By the way, we often express the leftarrow mark by `<-' for example.
812 Considering such image, you can write @code{\leftarrow} by typing @kbd{<-}
813 after @kbd{;} (semicolon) as a prefix. In the same way,
814 @code{\longleftarrow} (@code{<--}) is completed by typing @kbd{;<--},
815 infinity mark which is imitated by @code{oo} is completed by typing
816 @kbd{;oo}.
818 Here are the sample operations in YaTeX math-mode.
820 @example
821 INPUT Completed La@TeX{} commands
822 ; < - @code{\leftarrow}
823 ; < - - @code{\longleftarrow}
824 ; < - - > @code{\longleftrightarrow}
825 ; o @code{\circ}
826 ; o o @code{\infty}
827 @end example
829 In any case, you can quit from image completion and can move
830 to the next editing operation if the La@TeX{} command you want is
831 shown in the buffer.
833 @code{;} itself in math-environment is inserted by @kbd{;;}. Typing
834 @kbd{TAB} in the midst of image completion shows all of the La@TeX{}
835 commands that start with the same name as string you previously typed in.
836 In this menu buffer, press @kbd{RET} after moving the cursor (by @kbd{n},
837 @kbd{p}, @kbd{b}, @kbd{f}) to insert the La@TeX{} command.
839 To know all of the completion table, type @kbd{TAB} just after @kbd{;}.
840 And here is the sample menu by @kbd{TAB} after @kbd{;<}.
842 @example
843 KEY LaTeX sequence sign
844 < \leq <
845 ~
846 << \ll <<
847 <- \leftarrow <-
848 <= \Leftarrow <=
849 @end example
851 You can define your favorite key-vs-sequence completion table in the
852 Emacs-Lisp variable @code{YaTeX-math-sign-alist-private}. See also
853 @file{yatexmth.el} for the information of the structure of this variable.
855 @node Greek letters completion, , Image completion, Completion
856 @comment node-name, next, previous, up
857 @section Greek letters completion
858 @cindex Greek letters completion
859 @cindex :
861 Math-mode of YaTeX provides another image completion, Greek letters
862 completion in the same method. After prefix @kbd{:}, typing @kbd{a} makes
863 @code{\alpha}, @kbd{b} makes @code{\beta} and @kbd{g} makes @code{\gamma}
864 and so on. First, type @kbd{:TAB} to know all the correspondence of
865 alphabets vs. Greek letters.
867 If you will find @kbd{;} or @kbd{:} doesn't work in correct position of
868 math environment, it may be a bug of YaTeX. Please send me a bug report
869 with the configuration of your text, and avoid it temporarily by typing
870 @kbd{;} or @kbd{:} after universal-argument(@kbd{C-u}) which forces
871 @kbd{;} and @kbd{:} to work as math-prefix.
873 @node Local dictionaries, Commenting out, Completion, Top
874 @comment node-name, next, previous, up
875 @chapter Local dictionaries
876 @cindex local dictionaries
877 @cindex nervous users
879 Tables for completion consist of three dictionaries; `standard
880 dictionary' built in @file{yatex.el}, `user dictionary' for your common
881 private commands, and `local dictionary' that is effective in a certain
882 directory.
884 When you input the command unknown to YaTeX at a completion in the
885 minibuffer, YaTeX asks you with the following prompt;
887 @example
888 `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscard
889 @end example
891 @noindent
892 In this menu, typing @kbd{u} updates your `user dictionary', @kbd{l}
893 updates your local dictionary, @kbd{n} updates only on-memory dictionary
894 which go through only current Emacs session, and @kbd{d} updates no
895 dictionary and throws the new word away.
897 If you find this switching feature meaningless and bothersome, put the
898 next expression into your @file{~/.emacs}
900 @lisp
901 (setq YaTeX-nervous nil)
902 @end lisp
904 @node Commenting out, Cursor jump, Local dictionaries, Top
905 @comment node-name, next, previous, up
906 @chapter Commenting out
907 @cindex commenting out
908 @cindex prefix >
909 @cindex prefix <
910 @cindex prefix ,
911 @cindex prefix .
913 You may want to comment out some region.
915 @table @kbd
916 @item [prefix] >
917 @dots{} comment out region by %
918 @item [prefix] <
919 @dots{} uncomment region
920 @end table
922 @noindent
923 cause an operation to the region between point and mark.
925 @table @kbd
926 @item [prefix] .
927 @dots{} comment out current paragraph
928 @item [prefix] ,
929 @dots{} uncomment current paragraph
930 @end table
932 @noindent
933 comments or uncomments the paragraph where the cursor belongs.
934 This `paragraph' means the region marked by the function
935 mark-paragraph, bound to @kbd{ESC h} by default. It is NOT
936 predictable what will happen when you continuously comment out
937 some paragraph many times.
939 You can also comment out an environment between @code{\begin} and
940 @code{\end}, or a @code{\begin}-\@code{\end} pair themselves, by making the
941 following key strokes on the line where @code{\begin@{@}} or
942 @code{\end@{@}} exists.
944 @table @kbd
945 @item [prefix] >
946 @dots{} comment out from \begin to \@code{end}
947 @item [prefix] <
948 @dots{} uncomment from \begin to \@code{end}
949 @end table
951 @noindent
952 comment whole the contents of environment. Moreover,
954 @table @kbd
955 @item [prefix] .
956 @dots{} comment out \begin and \@code{end}
957 @item [prefix] ,
958 @dots{} uncomment \begin and \@code{end}
959 @end table
961 @noindent
962 (un)comments out only environment declaration: @code{\begin@{@}} and
963 @code{\end@{@}}. NOTE that even if you intend to comment out some region,
964 invoking @kbd{[prefix] >} on the @code{\begin},@code{\end} line decides to
965 work in `commenting out from @code{\begin} to @code{\end}' mode.
968 @node Cursor jump, Changing and Deleting, Commenting out, Top
969 @comment node-name, next, previous, up
970 @chapter Cursor jump
971 @cindex cursor jump
972 @cindex prefix g
975 @menu
976 * Jump to corresponding object::
977 * Invoking image processor::
978 * Jump to main file::
979 * Jumping around the environment::
980 * Jumping to last completion position::
981 @end menu
983 @node Jump to corresponding object, Invoking image processor, Cursor jump, Cursor jump
984 @comment node-name, next, previous, up
985 @section Jump to corresponding object
987 Typing
989 @table @kbd
990 @item [prefix] g
991 @dots{} go to corresponding object
992 @end table
994 @noindent
995 in a certain place move the cursor to the place corresponding to the
996 La@TeX{} command of last place. YaTeX recognize the followings as pairs
997 that have relation each other.
999 @itemize @bullet
1000 @item @code{\begin@{@}} <-> @code{\end@{@}}
1001 @item @code{%#BEGIN} <-> @code{%#END}
1002 @item On the image-including line -> corresponding viewer or drawing tool
1003 @item @code{\label@{@}} <-> @code{\ref@{@}}
1004 @item @code{\include(\input)} -> included file
1005 @item @code{\bibitem@{@}} <-> @code{\cite@{@}}
1006 @end itemize
1008 On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the
1009 cursor to the corresponding @code{\end},@code{\begin} line, if its partner
1010 really exists. The behavior on the line @code{%#BEGIN} and @code{%#END}
1011 are the same. Note that if the correspondent of @code{label/ref} or
1012 @code{cite/bibitem} exists in another file, that file have to be opened to
1013 make a round trip between references by @kbd{[prefix] g}.
1015 If you type @code{[prefix] g} on the line of @code{\include@{chap1@}},
1016 typically in the main text, YaTeX switches buffer to @file{chap1.tex}.
1018 @table @kbd
1019 @item [prefix] 4 g
1020 @dots{} go to corresponding object in other window
1021 @end table
1023 @noindent
1024 do the same job as @kbd{[prefix] g} except it's done in other window.
1025 Note that this function doesn't work on @code{begin/end},
1026 @code{%#BEGIN/%#END} pairs because it is meaningless.
1028 @node Invoking image processor, Jump to main file, Jump to corresponding object, Cursor jump
1029 @comment node-name, next, previous, up
1030 @section Invoking image processor
1031 @cindex{Drawing tool invocation}
1033 `image-including line' described above means such lines as
1034 @code{\epsfile@{file=foo.ps@}}. If you type @kbd{[prefix] g} on that
1035 line, YaTeX automatically searches source of `foo.ps' and invokes image
1036 viewer or drawing tool correspoinding to it. For example; if you draw
1037 an image foo.obj with Tgif and enclose its product named foo.eps by
1038 @code{\epsfile} command. Typing @kbd{[prefix] g} on @code{\epsfile} line
1039 make YaTeX invoke @code{tgif foo.obj}. How a processor is choosen is as
1040 follows.
1042 @enumerate
1043 @item
1044 If there is an expression matching with one of the pattern
1045 defined in @code{YaTeX-processed-file-regexp-alist}, extract file name
1046 from regexp group surrounded by \\(\\). (Which group corresponds is
1047 written in the cdr part of each list.) If no matches were found, do
1048 nothing.
1049 @item
1050 If there is a pattern as `%PROCESSOR' which is defined in the variable
1051 @code{YaTeX-file-processor-alist}, call that processor giving the
1052 file name with corresponding extension.
1053 @item
1054 If not, check the existence of each file which is supplied the
1055 extension in the cdr part of each list of
1056 @code{YaTeX-file-processor-alist}. If any, call the corresponding
1057 image viewer or drawing tool.
1058 @end enumerate
1060 @node Jump to main file, Jumping around the environment, Invoking image processor, Cursor jump
1061 @comment node-name, next, previous, up
1062 @section Jump to main file
1064 Typing
1066 @table @kbd
1067 @item [prefix] ^
1068 @dots{} visit main file
1069 @item [prefix] 4^
1070 @dots{} visit main file in other buffer
1071 @end table
1072 @cindex prefix ^
1073 @cindex prefix 4 ^
1075 in a sub text switch the buffer to the main text specified by
1076 @code{%#!} notation.
1078 @node Jumping around the environment, Jumping to last completion position, Jump to main file, Cursor jump
1079 @comment node-name, next, previous, up
1080 @section Jumping around the environment
1082 And these are the functions which work on the current La@TeX{}
1083 environment:
1085 @table @kbd
1086 @item M-C-a
1087 @dots{} beginning of environment
1088 @item M-C-e
1089 @dots{} @code{end} of environment
1090 @item M-C-@@
1091 @dots{} mark environment
1092 @end table
1093 @cindex M-C-a
1094 @cindex M-C-e
1095 @cindex M-C-@@
1097 @node Jumping to last completion position, , Jumping around the environment, Cursor jump
1098 @comment node-name, next, previous, up
1099 @section Jumping to last completion position
1101 YaTeX always memorize the position of completion into register @code{3}.
1102 So every time you make a trip to any other part of text other than you are
1103 writing, you can return to the editing paragraph by calling
1104 register-to-point with argument YaTeX-current-position-register, which is
1105 achieved by typing @kbd{C-x j 3}(by default).
1107 @node Changing and Deleting, Filling, Cursor jump, Top
1108 @comment node-name, next, previous, up
1109 @chapter Changing and Deleting
1111 These functions are for change or deletion of La@TeX{} commands
1112 already entered.
1114 @table @kbd
1115 @item [prefix] c
1116 @dots{} change La@TeX{} command
1117 @item [prefix] k
1118 @dots{} kill La@TeX{} command
1119 @end table
1120 @cindex prefix c
1121 @cindex prefix k
1123 @menu
1124 * Changing LaTeX commands::
1125 * Killing LaTeX commands::
1126 @end menu
1128 @node Changing LaTeX commands, Killing LaTeX commands, Changing and Deleting, Changing and Deleting
1129 @comment node-name, next, previous, up
1130 @section Changing La@TeX{} commands
1132 @kbd{[prefix] c} can change the various (La)@TeX{} commands. This can
1133 change the followings.
1134 @itemize @bullet
1135 @item Environment names
1136 @item Section-type commands
1137 @item Argument of section-type commands
1138 @item Optional parameters (enclosed by []) of section-type commands
1139 @item Font/size designators
1140 @item Math-mode's maketitle-type commands that can be inputted with
1141 image completion
1142 @end itemize
1144 Typing @kbd{[prefix] c} on one of above objects you want to change
1145 brings a suitable reading function sometimes with completion.
1146 Note: If you want to change the argument of section-type command that
1147 contains other La@TeX{} commands, type @kbd{[prefix] c} either of
1148 surrounding braces of the argument in order to make YaTeX ignore the
1149 internal La@TeX{} sequences as an object of changing. Anyway, it is
1150 very difficult to know which argument position the cursor belongs because
1151 the La@TeX{} commands can be nested and braces can freely emerge. So keep
1152 it mind to put the cursor on a brace when you are thinking of changing a
1153 complicated argument.
1155 @node Killing LaTeX commands, , Changing LaTeX commands, Changing and Deleting
1156 @comment node-name, next, previous, up
1157 @section Killing La@TeX{} commands
1158 @cindex Killing La@TeX{} commands
1160 @kbd{[prefix] k} kills the La@TeX{} commands sometimes with their
1161 arguments. Following table illustrates the correspondence of the invoking
1162 position and what is killed.
1164 @example
1165 [Invoking position] [action]
1166 \begin, \end line kill \begin,\end pairs
1167 %#BEGIN, %#END line kill %#BEGIN,%#END pairs
1168 on a Section-type command kill section-type command
1169 on a parenthesis kill parentheses
1170 @end example
1172 Note that when killing @code{\begin, \end} or @code{%#BEGIN, %#END} pair,
1173 the lines @code{\begin, \end} or @code{%#BEGIN, %#END} exist will be
1174 killed entirely. So take care not to create any line that contains more
1175 than one @code{\begin} or so.
1177 While all operations above are to kill `containers' which surround some
1178 text, universal argument (@kbd{C-u}) for these commands kills not only
1179 `containers' but also `contents' of them. See below as a sample.
1181 @example
1182 Original text: [prefix] k C-u [prefix] k
1183 Main \footnote@{note@} here. Main note here. Main here.
1184 ~(cursor)
1185 @end example
1187 @node Filling, Updation of includeonly, Changing and Deleting, Top
1188 @comment node-name, next, previous, up
1189 @chapter Filling
1190 @cindex filling
1192 @section Filling an item
1193 @cindex filling an item
1194 @cindex prefix i
1196 To fill a term (descriptive sentences) of @code{\item}, type
1198 @c @table @kbd
1199 @c @item [prefix] i
1200 @c @dots{} fill item
1201 @c @end table
1202 @table @kbd
1203 @item M-q
1204 @dots{} fill item
1205 @end table
1207 @noindent
1208 on that item.
1210 YaTeX uses the value of the variable @code{YaTeX-item-regexp} as the
1211 regular expression to search item header in itemize environment.
1212 If you make a newcommand to itemize terms(e.g. @code{\underlineitem}), put
1214 @lisp
1215 (setq YaTeX-item-regexp
1216 "\\(\\\\\\(sub\\)*item\\)\\|\\(\\\\underlineitem\\)")
1217 @end lisp
1218 @cindex YaTeX-item-regexp
1220 in your @file{~/.emacs}. If you are not familiar with regular expression
1221 for Emacs-Lisp, name a newcommand for `itemize' beginning with
1222 @code{\item} such as @code{\itembf}, not @code{\bfitem}.
1224 This function reformats the @code{\item} into `hang-indented' style.
1225 For example:
1227 @example
1228 itemize, enumerate environment:
1230 >\item[foo] `foo' is the typical word for describing an
1231 > arbitrarily written....
1232 description environment:
1233 > \item[bar] When the word `for' is used as an arbitrarily
1234 > word, `bar' is bound to follow it.
1235 @end example
1237 Note that the indent depth of an @code{\item} word and its descriptive
1238 paragraph are the same in latter case. If you want to use different
1239 depth, invoke fill-paragraph at the beginning of non-whitespace
1240 character(see below).
1242 @section Filling paragraph
1243 @cindex Filling paragraph
1244 @cindex M-q
1246 Fill-paragraph is little bit adapted for La@TeX{} sources. It retains from
1247 filling in certain environments where formatting leads to a disaster such
1248 as verbatim, tabular, or so. And it protects @code{\verb} expressions
1249 from being folded (The variable @code{YaTeX-verb-regexp} controls this).
1250 Besides, putting cursor on the first occurrence of non-whitespace
1251 character on a line changes the fill-prefix temporarily to the depth of
1252 the line.
1254 @node Updation of includeonly, What column, Filling, Top
1255 @comment node-name, next, previous, up
1256 @chapter Updation of @code{\includeonly}
1257 @cindex includeonly
1259 When you edit splitting source texts, the notation
1261 @example
1262 \includeonly@{CurrentEditingFileName@}
1263 @end example
1265 @noindent
1266 in the main file reduces the time of typesetting. If you want
1267 to hack other file a little however, you have to rewrite it to
1269 @example
1270 \includeonly@{OtherFileNameYouWantToFix@}
1271 @end example
1273 @noindent
1274 in the main file. YaTeX automatically detects that the current
1275 edited text is not in includeonly list and prompts you
1277 @example
1278 A)dd R)eplace %)comment?
1279 @end example
1281 in the minibuffer. Type @kbd{a} if you want to add the current file name
1282 to @code{\includeonly} list, @kbd{r} to replace \@code{includeonly} list
1283 with the current file, and type @kbd{%} to comment out the
1284 @code{\includeonly} line.
1286 @node What column, Intelligent newline, Updation of includeonly, Top
1287 @comment node-name, next, previous, up
1288 @chapter What column?
1289 @cindex what column
1290 @cindex complex tabular
1291 @cindex prefix &
1293 We are often get tired of finding the corresponding column in
1294 large tabulars. For example,
1296 @example
1297 \begin@{tabular@}@{|c|c|c|c|c|c|c|c|@}\hline
1298 Name&Position&Post No.&Addr.&Phone No.&FAX No.&
1299 Home Addr.&Home Phone\\ \hline
1300 Thunder Bird & 6 & 223 & LA & xxx-yyy &
1301 zzz-www & Japan & 9876-54321 \\
1302 & 2 & \multicolumn@{2@}@{c|@}@{Unknown@}
1303 &&&(???)
1304 \\ \hline
1305 \end@{tabular@}
1306 @end example
1308 Suppose you have the cursor located at @code{(???)} mark, can you tell
1309 which column it is belonging at once? Maybe no. In such case,
1310 type
1312 @table @kbd
1313 @item [prefix] &
1314 @dots{} What column
1315 @end table
1317 @noindent
1318 in that position. YaTeX tells you the column header of the
1319 current field. Since YaTeX assumes the first line of tabular
1320 environment as a row of column headers, you can create a row of
1321 virtual column headers by putting them in the first line and
1322 commenting that line with @code{%}.
1324 @node Intelligent newline, Usepackage checker, What column, Top
1325 @comment node-name, next, previous, up
1326 @chapter Intelligent newline
1327 @cindex Intelligent newline
1328 @cindex ESC RET
1329 @cindex M-C-m
1331 At the end of begin-type completion of tabular[*], array, itemize,
1332 enumerate or tabbing environment, or typing
1334 @table @kbd
1335 @item ESC RET
1336 @dots{} Intelligent newline
1337 @end table
1339 @noindent
1340 in these environments inserts the contents corresponding to the current
1341 environment in the next line. (At the begin-type completion, this
1342 contents can be removed by `undo'.) In @code{tabular} environment, for
1343 example, @kbd{ESC RET} inserts the certain number of @code{&} and trailing
1344 @code{\\}, and @code{\hline} if other @code{\hline} is found in backward.
1345 Here are the list of contents vs. environments.
1347 @itemize
1348 @item @code{tabular}, @code{tabular*}, @code{array}
1350 Corresponding number of @code{&} and @code{\\}.
1351 And @code{\hline} if needed.
1353 @item @code{tabbing}
1355 The same number of @code{\>} as @code{\=} in the first line.
1357 @item @code{itemize}, @code{enumerate}, @code{description}, @code{list}
1359 @code{\item} or @code{item[]}.
1360 @end itemize
1362 Note that since this function works seeing the contents of the first
1363 line, please call this after the second line if possible.
1365 If you want to apply these trick to other environments, @code{foo}
1366 environment for example, define the function named
1367 @code{YaTeX-intelligent-newline-foo} to insert corresponding contents.
1368 That function will be called at the beginning of the next line after the
1369 newline is inserted to the current line. Since the function
1370 @code{YaTeX-indent-line} is designed to indent the current line properly,
1371 calling this function before your code to insert certain contents must be
1372 useful. See the definition of the function
1373 @code{YaTeX-intelligent-newline-itemize} as an example.
1375 @node Usepackage checker, Online help, Intelligent newline, Top
1376 @comment node-name, next, previous, up
1377 @chapter Usepackage checker
1378 @cindex usepackage
1380 When you input begint-type, section-type, maketitle-type macros with
1381 completion, and it requires some LaTeX2e package, YaTeX examines
1382 the existence of correct @code{\usepackage}. If not, YaTeX inserts
1383 the @code{\usepackage@{@}} declaration corresponding to input macro.
1385 To activate the package completion for your favarite package,
1386 set the variable @code{YaTeX-package-alist-private} correctly.
1387 Please refere the value of @code{YaTeX-package-alist-default} as an
1388 example.
1390 @node Online help, Browsing file hierarchy, Usepackage checker, Top
1391 @comment node-name, next, previous, up
1392 @chapter Online help
1393 @cindex online help
1394 @cindex prefix ?
1395 @cindex prefix /
1396 @cindex apropos
1397 @cindex keyword search
1399 YaTeX provides you the online help with popular La@TeX{} commands.
1401 Here are the key strokes for the online help.
1403 @table @kbd
1404 @item [prefix] ?
1405 @dots{} Online help
1406 @item [prefix] /
1407 @dots{} Online apropos
1408 @end table
1410 @section Online help
1412 `Online help' shows the documentation for the popular La@TeX{}
1413 commands(defaults to the commands on the cursor) in the next buffer.
1414 There are two help file, `global help' and `private help'. The former
1415 file contains the descriptions on the standard La@TeX{} command and is
1416 specified its name by variable @code{YaTeX-help-file}. Usually, the
1417 global help file should be located in public space (@code{$EMACSEXECPATH}
1418 by default) and should be world writable so that anyone can update it to
1419 enrich its contents. The latter file contains descriptions on
1420 non-standard or personal command definitions and is specified by
1421 @code{YaTeX-help-file-private}. This file should be put into private
1422 directory.
1424 @section Online apropos
1426 `Online apropos' is an equivalent of GNU Emacs's apropos. It
1427 shows all the documentations that contains the keyword entered by
1428 the user.
1430 @section When no descriptions are found...
1432 If there is no description on a command in help files, YaTeX
1433 requires you to write a description on that command. If you are
1434 willing to do, determine which help file to add and write the
1435 description on it referring your manual of (La)TeX. Please send
1436 me your additional descriptions if you describe the help on some
1437 standard commands. I might want to include it in the next
1438 distribution.
1440 @node Browsing file hierarchy, Cooperation with other packages, Online help, Top
1441 @comment node-name, next, previous, up
1442 @chapter Browsing file hierarchy
1443 @cindex hierarchy
1444 @cindex browsing
1446 When you are editing multi-file source, typing
1448 @table @kbd
1449 @item [prefix] d
1450 @dots{} browse file hierarchy
1451 @end table
1453 @noindent
1454 asks you the parent-most file (which may be defaulted) and displays the
1455 documentation hierarchy in the next window. In this buffer, the following
1456 commands are available.
1458 @table @kbd
1459 @item n
1460 @dots{} move to the next line and show its contents
1461 @item p
1462 @dots{} move to the previous line and show its contents
1463 @item N
1464 @dots{} move to the next file in the same inclusion level
1465 @item P
1466 @dots{} move to the previous file in the same inclusion level
1467 @item j
1468 @dots{} move to the next line
1469 @item k
1470 @dots{} move to the previous line
1471 @item u
1472 @dots{} move to the parent file
1473 @item .
1474 @dots{} show the current files contents in the next window
1475 @item SPC
1476 @dots{} scroll up the current file window
1477 @item DEL, b
1478 @dots{} scroll down the current file window
1479 @item <
1480 @dots{} show the beginning of the current file
1481 @item >
1482 @dots{} show the end of the current file
1483 @item >
1484 @dots{} return to the previous postion after @kbd{<} or @kbd{>}
1485 @item RET, g
1486 @dots{} open the current file in the next window
1487 @item mouse-2
1488 @dots{} same as RET(available only with window system)
1489 @item o
1490 @dots{} other window
1491 @item 1
1492 @dots{} delete other windows
1493 @item -
1494 @dots{} shrink hierarchy buffer window
1495 @item +
1496 @dots{} enlarge hierarchy buffer window
1497 @item ?
1498 @dots{} describe mode
1499 @item q
1500 @dots{} quit
1501 @end table
1503 Note that operations on the file contents in the next window do not work
1504 correctly when you close the corresponding file.
1506 @node Cooperation with other packages, Customizations, Browsing file hierarchy, Top
1507 @comment node-name, next, previous, up
1508 @chapter Cooperation with other packages
1510 YaTeX works better with other brilliant packages.
1512 @section gmhist
1513 @cindex gmhist
1514 @cindex command history
1515 @cindex minibuffer history
1517 When you are loading @file{gmhist.el} and @file{gmhist-mh.el}, you can
1518 use independent command history list at the prompt of preview command
1519 (@kbd{[prefix] tp}) and print command (@kbd{[prefix] tl}). On each
1520 prompt, you can enter the previous command line string repeatedly by
1521 typing @kbd{M-p}.
1523 @section min-out
1524 @cindex min-out
1526 @file{min-out}, the outline minor mode, can be used in yatex-mode
1527 buffers. If you want to use it with YaTeX, please refer the
1528 file @file{yatexm-o.el} as an example.
1530 @node Customizations, Etcetera, Cooperation with other packages, Top
1531 @comment node-name, next, previous, up
1532 @chapter Customizations
1533 @cindex customizations
1535 You can customize YaTeX by setting Emacs-Lisp variables and by making
1536 add-in functions.
1538 @menu
1539 * Lisp variables::
1540 * Add-in functions::
1541 * Add-in generator::
1542 @end menu
1544 @node Lisp variables, Add-in functions, Customizations, Customizations
1545 @comment node-name, next, previous, up
1546 @section Lisp variables
1547 @cindex customizable variables
1549 You can change the key assignments or make completion more comfortable
1550 by setting the values of various variables which control the movement of
1551 yatex-mode.
1553 For example, if you want to change the prefix key stroke from @kbd{C-c}
1554 to any other sequence, set YaTeX-prefix to whatever you want to use. If
1555 you don't want to use the key sequence @kbd{C-c letter} which is assumed
1556 to be the user reserved sequence in Emacs world, set
1557 @code{YaTeX-inhibit-prefix-letter} to @code{t}, and all of the default key
1558 bind of @kbd{C-c letter} will turn to the corresponding @kbd{C-c C-letter}
1559 (but the region based completions that is invoked with @kbd{C-c
1560 Capital-letter} remain valid, if you want to disable those bindings, set
1561 that variable to 1 instead of @code{t}).
1563 @menu
1564 * All customizable variables::
1565 * Sample definitions::
1566 * Hook variables::
1567 * Hook file::
1568 @end menu
1570 @node All customizable variables, Sample definitions, Lisp variables, Lisp variables
1571 @comment node-name, next, previous, up
1572 @subsection All customizable variables
1573 @cindex all customizable variables
1575 Here are the customizable variables of yatex-mode. Each value setq-ed
1576 in @file{~/.emacs} is preferred and that of defined in @file{yatex.el} is
1577 neglected. Parenthesized contents stands for the default value. When you
1578 are to change some of these variables, see more detailed documentation of
1579 the variable by @kbd{M-x describe-variable}.
1581 @defvar YaTeX-japan
1582 Set this nil to produce all messages in English
1583 (@code{Depends on Japanese feature of Emacs})
1584 @end defvar
1586 @defvar YaTeX-kanji-code
1587 Default buffer-file-coding-system for YaTeX modes' buffer.
1588 Set this 0 to no language conversion. Nil to preserve original
1589 coding-system. (@code{1 or 2})
1590 @end defvar
1592 @defvar YaTeX-prefix
1593 Prefix key stroke (@kbd{C-c})
1594 @end defvar
1596 @defvar YaTeX-inhibit-prefix-letter
1597 Change key stroke from @kbd{C-c letter} to @kbd{C-c C-letter} (@code{nil})
1598 @end defvar
1600 @defvar YaTeX-fill-prefix
1601 Fill-prefix used in yatex-mode (@code{nil})
1602 @end defvar
1604 @defvar YaTeX-user-completion-table
1605 Name of user dictionary where learned completion table will be stored.
1606 (@code{"~/.yatexrc"})
1607 @end defvar
1609 @defvar tex-command
1610 La@TeX{} typesetter command (@code{"latex"})
1611 @end defvar
1613 @defvar dvi2-command
1614 Preview command (@code{"xdvi -geo +0+0 -s 4"})
1615 @end defvar
1617 @defvar dviprint-command-format
1618 Command format to print dvi file (@code{"dvi2ps %f %t %s | lpr"})
1619 @end defvar
1621 @defvar dviprint-from-format
1622 Start page format of above %f. %b will turn to start page (@code{"-f %b"})
1623 @end defvar
1625 @defvar dviprint-to-format
1626 End page format of above %t. %e will turn to @code{end} page (@code{"-t %e"})
1627 @end defvar
1629 @defvar makeindex-command
1630 Default makeindex command (@code{"makeindex"} (@code{"makeind"} on MS-DOS))
1631 @end defvar
1633 @defvar YaTeX-need-nonstop
1634 Put @code{\nonstopmode@{@}} or not (@code{nil})
1635 @end defvar
1637 @defvar latex-warning-regexp
1638 Regular expression of warning message latex command puts out
1639 (@code{"line.* [0-9]*"})
1640 @end defvar
1642 @defvar latex-error-regexp
1643 Regular expression of error message (@code{"l\\.[1-9][0-9]*"})
1644 @end defvar
1646 @defvar latex-dos-emergency-message
1647 Message latex command running on DOS puts at abort (@code{"Emergency stop"})
1648 @end defvar
1650 @defvar YaTeX-item-regexp
1651 Regular expression of item command (@code{"\\\\item"})
1652 @end defvar
1654 @defvar YaTeX-verb-regexp
1655 Regexp of verb family. Omit \\\\. (@code{"verb\\*?\\|path"})
1656 @end defvar
1658 @defvar YaTeX-nervous
1659 T for using local dictionary (@code{t})
1660 @end defvar
1662 @defvar YaTeX-sectioning-regexp
1663 Regexp of La@TeX{} sectioning command
1664 (@code{"\\(part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\*?\\)\\b"})
1665 @end defvar
1667 @defvar YaTeX-fill-inhibit-environments
1668 Inhibit fill in these environments
1669 (@code{'("tabular" "tabular*" "array" "picture" "eqnarray" "eqnarray*" "equation" "math" "displaymath" "verbatim" "verbatim*")})
1670 @end defvar
1672 @defvar YaTeX-uncomment-once
1673 T for deleting all preceding @code{%} (@code{nil})
1674 @end defvar
1676 @defvar YaTeX-close-paren-always
1677 T for always close all parenthesis automatically, @code{nil} for only eol
1678 (@code{t})
1679 @end defvar
1681 @defvar YaTeX-auto-math-mode
1682 Switch math-mode automatically (@code{t})
1683 @end defvar
1685 @defvar YaTeX-math-key-list-private
1686 User defined alist, math-mode-prefix vs completion alist
1687 used in image completion (@code{nil}). See @file{yatexmth.el}
1688 for the information about how to define a completion alist.
1689 @end defvar
1691 @defvar YaTeX-default-pop-window-height
1692 Initial height of typesetting buffer when one-window.
1693 Number for the lines of the buffer, numerical string for
1694 the percentage of the screen-height. @code{nil} for half height (10)
1695 @end defvar
1697 @defvar YaTeX-help-file
1698 Global online help file name (@file{$doc-directory/../../site-lisp/YATEXHLP.eng})
1699 @end defvar
1701 @defvar YaTeX-help-file-private
1702 Private online help file name (@file{"~/YATEXHLP.eng"})
1703 @end defvar
1705 @defvar YaTeX-no-begend-shortcut
1706 Disable [prefix] b ?? shortcut (@code{nil)}
1707 @end defvar
1709 @defvar YaTeX-hilit-pattern-adjustment-private
1710 List of the list that contain the regular expression and the symbol of
1711 logical meaning of the string that matches the pattern. See also the
1712 value from @code{(assq 'yatex-mode hilit-patterns-alist)} and the value of
1713 @code{YaTeX-hilit-pattern-adjustment-default} (and even the document of
1714 hilit19.el).
1715 @end defvar
1717 @defvar YaTeX-sectioning-level
1718 Alist of LaTeX's sectioning command vs its height.
1719 @end defvar
1721 @defvar YaTeX-hierarchy-ignore-heading-regexp
1722 @code{YaTeX-display-hierarchy} searches for sectioning command first, and
1723 comment line secondary as a file headings. In latter case, ignore lines
1724 that match with regular expression of this variable. Default value of
1725 this variable is RCS header expressions and mode specifying line `-*- xxxx
1726 -*'.
1727 @end defvar
1729 @defvar YaTeX-skip-default-reader
1730 Non-nil for this variable skips the default argument reader of
1731 section-type command when add-in function for it is not defined
1732 (@code{nil})
1733 @end defvar
1735 @defvar YaTeX-create-file-prefix-g
1736 When typing @kbd{prefix g} on the @code{\include} line,
1737 open the target file even if the file doesn't exist (@code{nil})
1738 @end defvar
1740 @defvar YaTeX-simple-messages
1741 Simplyfy messages of various completions (@code{nil})
1742 @end defvar
1744 @defvar YaTeX-hilit-sectioning-face
1745 When hilit19 and yatex19 is active, YaTeX colors the sectioning commands.
1746 This variable specifies the foreground and background color of
1747 @code{\part} macro. The default value is @code{'(yellow/dodgerblue
1748 yellow/slateblue)}. The first element of this list is for the screen when
1749 @code{hilit-background-mode} is @code{'light}, and the second element is
1750 for @code{'dark}. You should specify both color as `forecolor/backcolor'.
1751 @end defvar
1753 @defvar YaTeX-hilit-sectioning-attenuation-rate
1754 When color mode, this variable specifies how much attenuate the color
1755 density of @code{\subparagraph} compared with that of @code{\chapter}
1756 (@code{'(15 40)}) See also @code{YaTeX-hilit-sectioning-face}.
1757 @end defvar
1759 @defvar YaTeX-use-AMS-LaTeX
1760 If you use AMS-LaTeX, set to @code{t} (@code{nil})
1761 @end defvar
1763 @defvar YaTeX-use-LaTeX2e
1764 If you use LaTeX2e, set to @code{t} (@code{t})
1765 @end defvar
1767 @defvar YaTeX-template-file
1768 File name which is automatically inserted at creation
1769 (@code{~/work/template.tex})
1770 @end defvar
1772 @defvar YaTeX-search-file-from-top-directory
1773 Non-nil means to search input-files from the directory where main file exists
1774 (@code{t})
1775 @end defvar
1777 @defvar YaTeX-use-font-lock
1778 Use font-lock to fontify buffer or not (@code{(featurep 'font-lock)}
1779 @end defvar
1781 @defvar YaTeX-use-hilit19
1782 Use hilit19 to highlight buffer or not (@code{(featurep 'hilit19)}
1783 @end defvar
1785 @defvar YaTeX-use-italic-bold
1786 YaTeX tries to search italic, bold fontsets or not
1787 (@code{t} if Emacs-20 or later). This variable is effective only when
1788 font-lock is used.
1789 (@code{(featurep 'hilit19)}
1790 @end defvar
1792 @defvar YaTeX-singlecmd-suffix
1793 Suffix which is always inserted after maketitle-type macros.
1794 @code{"{}"} is recommended.
1795 @end defvar
1797 @defvar YaTeX-package-alist-private
1798 Alist of LaTeX2e-package name vs. lists of macros in it.
1799 Set this alist properly and YaTeX automatically check the declaratiion of
1800 `usepackage' for corresponding macro, when you input that macro with
1801 completion. If required `usepackage' is not found, YaTeX also
1802 automatically inserts `\usepackage'. Alist is as follows;
1803 @lisp
1804 '((PackageName1
1805 (completionType ListOfMacro)
1806 (completionType ListOfMacro))
1807 (PackageName2
1808 (completionType ListOfMacro)
1809 (completionType ListOfMacro...))....)
1810 @end lisp
1811 completionType is one of @code{env, section, maketitle}.
1812 Consult the value of @code{YaTeX-package-alist-default} as an example.
1813 @end defvar
1815 @node Sample definitions, Hook variables, All customizable variables, Lisp variables
1816 @comment node-name, next, previous, up
1817 @subsection Sample definitions
1818 @cindex prefix key stroke
1819 @cindex fill-prefix
1821 For instance, to change the prefix key stroke to @kbd{ESC}, and name of
1822 the user dictionary @file{~/src/emacs/yatexrc}, and set @code{fill-prefix}
1823 to single TAB character, add the following @code{setq} to @file{~/.emacs}.
1825 @lisp
1826 (setq YaTeX-prefix "\e"
1827 YaTeX-user-completion-table "~/src/emacs/yatexrc"
1828 YaTeX-fill-prefix " ")
1829 @end lisp
1831 @node Hook variables, Hook file, Sample definitions, Lisp variables
1832 @comment node-name, next, previous, up
1833 @subsection Hook variables
1834 @cindex hook variables
1836 More customizations will be done by the hook-function defined in
1837 hook-variable @code{yatex-mode-hook}. This is useful to define a shortcut
1838 key sequence to enter some environments other than @code{document} and
1839 @code{enumerate} etc. The following statement defines @code{[prefix] ba}
1840 to enter @code{\begin@{abstract@}} ... @code{=end@{abstract@}}
1841 immediately.
1843 @lisp
1844 (setq yatex-mode-hook
1845 '(lambda() (YaTeX-define-begend-key "ba" "abstract")))
1846 @end lisp
1848 You should use functions @code{YaTeX-define-key}, or
1849 @code{YaTeX-define-begend-key} to define all the key sequences of
1850 yatex-mode.
1852 @node Hook file, , Hook variables, Lisp variables
1853 @comment node-name, next, previous, up
1854 @subsection Hook file
1855 @cindex hook file
1857 You can stuff all of YaTeX related expressions into a file named
1858 @file{yatexhks.el} if you have a lot of codes. YaTeX automatically load
1859 this file at the initialization of itself. Using @file{yatexhks.el}
1860 makes @code{yatex-mode-load-hook} unnecessary.
1862 @node Add-in functions, Add-in generator, Lisp variables, Customizations
1863 @comment node-name, next, previous, up
1864 @section Add-in functions
1865 @cindex add-in functions
1866 @cindex yatexadd.el
1868 You can easily define a function to input detailed arguments
1869 with completion according to La@TeX{} environments or commands.
1871 @c @node What is add-in functions?, , Add-in functions, Add-in functions
1872 @comment node-name, next, previous, up
1873 @subsection What is add-in functions?
1874 @cindex tabular
1876 When you input @code{tabular} environment, don't you think ``I want
1877 YaTeX to complete its argument toward my favorite one such as
1878 @code{@{|c|c|c|@}}...''? Yes, you can define the function to complete
1879 arguments for any environment and any La@TeX{} commands.
1881 @subsection Procedure
1883 Here is the procedure to define add-in functions.
1884 @enumerate
1885 @item
1886 Define the function
1887 @item
1888 Put the function into @file{yatexhks.el}
1889 @end enumerate
1891 @menu
1892 * How the add-in function works::
1893 * How the function is called::
1894 * Useful functions for creating add-in::
1895 * Contribution::
1896 @end menu
1898 @node How the add-in function works, How the function is called, Add-in functions, Add-in functions
1899 @comment node-name, next, previous, up
1900 @subsection How the add-in function works
1902 There are three types of add-in.
1904 @enumerate
1905 @item
1906 Option add-in
1907 @item
1908 argument add-in
1909 @item
1910 enclosing add-in
1911 @end enumerate
1913 @dfn{Option add-in} returns the
1914 La@TeX{}'s optional parameters such as optional strings after
1915 @code{\begin@{ENV@}}, optional strings between a section-type command
1916 and its first argument, and optional strings just after type
1917 maketitle-type command. The following illustrates the name of add-in
1918 functions, where underlined strings are generated by add-in functions.
1920 @display
1921 \begin@{table@}[ht] (Function name: YaTeX:table)
1922 ~~~~
1923 \put(100,200)@{@} (Function name: YaTeX:put)
1924 ~~~~~~~~~
1925 \sum_@{i=0@}^@{n@} (Function name: YaTeX:sum)
1926 ~~~~~~~~~~
1927 @end display
1929 Obviously, the function name is decided by concatenating the prefix
1930 `YaTeX:' and La@TeX{} command's name.
1932 Another add-in type is @dfn{argument add-in}, which completes arguments
1933 for section-type commands.
1935 @display
1936 \newcommand@{\foo@}@{bar@} (Function name: YaTeX::newcommand)
1937 ~~~~ ~~~
1938 @end display
1940 When the section-type command is inputted, the function named by
1941 concatenating `YaTeX::' and section-type command, is called automatically
1942 with an integer argument which indicates which argument of section-type
1943 command is being read. Thus the add-in should determine the
1944 job referring the value of its argument.
1946 @dfn{enclosing add-in} is for modifying and/or checking the region that
1947 will be enclosed by section-type commands via @kbd{[prefix] S}. An
1948 enclosing add-in function will be called with two arguments, beginning of
1949 the enclosed region and end of the region. Suppose you want to enclose
1950 the existing text @code{(a+b)/c} by @code{\frac{}}.
1952 @display
1953 a/c
1954 | |
1955 A B
1956 @end display
1958 You do set-mark-command at point A and then move to point B. Typing
1959 @kbd{[prefix] S} and input @code{frac} enclose the region like this;
1961 @display
1962 \frac{a/c}
1963 @end display
1965 Normally, the expression @code{a/c} is translated to
1966 @code{\frac@{a@}@{c@}}. An enclosing add-in is useful for modifying
1967 @code{/} to @code{@}@{}.
1969 @menu
1970 * Defining option-add-in::
1971 * Defining argument-add-in::
1972 * Defining enclosing-add-in::
1973 @end menu
1975 @node Defining option-add-in, Defining argument-add-in, How the add-in function works, How the add-in function works
1976 @comment node-name, next, previous, up
1977 @subsubsection Defining `option add-in'
1979 If you want @code{@{|c|c|c|@}} for all @code{tabular} environment,
1981 @lisp
1982 (defun YaTeX:tabular ()
1983 "@{|c|c|c|@}")
1984 @end lisp
1986 @noindent
1987 is enough. If you want more complicated format, define as below.
1989 @lisp
1990 (defun YaTeX:tabular ()
1991 "@{@@@{\\vrule width 1pt\\ @}|||@@@{\\ \\vrule width 1pt@}@}")
1992 @end lisp
1994 @noindent
1995 Note that the character @code{\} must be described as @code{\\} in
1996 Emacs-Lisp. The next example reads the tabular format from keyboard.
1997 @lisp
1998 (defun YaTeX:tabular ()
1999 (concat "@{" (read-string "Rule: ") "@}"))
2000 @end lisp
2002 @node Defining argument-add-in, Defining enclosing-add-in, Defining option-add-in, How the add-in function works
2003 @comment node-name, next, previous, up
2004 @subsubsection Defining `argument add-in'
2006 This section describes how to define the add-in function for
2007 @code{\newcommand}.
2009 The first argument of @code{\newcommand} begins always with @code{\}.
2010 The second argument is usually so complex that we can not edit them in the
2011 minibuffer. Here is the created function considering this.
2013 @lisp
2014 (defun YaTeX::newcommand (n) ;n is argument position
2015 (cond
2016 ((= n 1) ;1st argument is macro name
2017 (read-string "Command: " "\\")) ;initial input `\'
2018 ((= n 2) "") ;do nothing when reading arg#2
2019 (t nil)))
2020 @end lisp
2022 Note that when the `argument add-in' function return `nil', normal
2023 argument reader will be called.
2025 @node Defining enclosing-add-in, , Defining argument-add-in, How the add-in function works
2026 @comment node-name, next, previous, up
2027 @subsubsection Defining `enclosing add-in'
2029 This section describes how to define the add-in function for
2030 text enclosed by @code{\frac@{@}}.
2032 When enclosing the text @code{5/3} by @code{\frac@{@}}, you might want to
2033 replace @code{/} with @code{@}@{}. Enclosing function
2034 @code{YaTeX::frac-region} is called with two arguments, beginning of
2035 enclosed text and end of enclosed text. The function is expected to
2036 replace @code{/} with @code{@}@{}. Here is an example expression.
2038 @lisp
2039 (defun YaTeX::frac-region (beg end)
2040 (catch 'done
2041 (while (search-forward "/" end t)
2042 (goto-char (match-beginning 0))
2043 (if (y-or-n-p "Replace this slash(/) with `}{'")
2044 (throw 'done (replace-match "}{")))
2045 (goto-char (match-end 0)))))
2046 @end lisp
2048 @node How the function is called, Useful functions for creating add-in, How the add-in function works, Add-in functions
2049 @comment node-name, next, previous, up
2050 @subsection How the function is called
2052 YaTeX calls the add-in functions for specified begin-type, section-type,
2053 and maketitle-type command, if any. `Option add-in' functions for
2054 begin-type are called when @code{\begin@{ENV@}} has been inserted,
2055 functions for section-type are called just before input of the first
2056 argument, and functions for maketitle-type is called after maketitle-type
2057 command has been inserted. `Argument add-in' functions are called at each
2058 entry of arguments for section-type commands.
2060 @node Useful functions for creating add-in, Contribution, How the function is called, Add-in functions
2061 @comment node-name, next, previous, up
2062 @subsection Useful functions for creating add-in
2064 Many add-in functions for typical La@TeX{} commands are defined in
2065 @file{yatexadd.el}. Those are also useful as references. Here are the
2066 short descriptions on useful functions, where [F] means function, [A]
2067 means arguments, [D] means description.
2069 @table @kbd
2070 @item [F]
2071 YaTeX:read-position
2072 @itemx [A]
2073 Character list which can show up in the brackets
2074 @itemx [D]
2075 Return the location specifier such as `[htb]'. When
2076 nothing is entered, omit [] itself. If the possible characters
2077 are "htbp", call this function as
2078 @code{(YaTeX:read-position "htbp")}
2080 @item [F]
2081 YaTeX:read-coordinates
2082 @itemx [A]
2083 Base prompt, X-axis prompt, Y-axis prompt (each optional)
2084 @itemx [D]
2085 Read the coordinates with the prompt ``BasePrompt X-axisPrompt:'' for
2086 X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form
2087 of ``(X,Y)''. The default prompts are @code{Dimension}, @code{X},
2088 @code{Y} respectively.
2090 @item [F]
2091 YaTeX:check-completion-type
2092 @itemx [A]
2093 One of the symbols: 'begin, 'section, or 'maketitle
2094 @itemx [D]
2095 Check the current completion type is specified one and cause error if
2096 not. The variable @code{YaTeX-current-completion-type} holds the symbol
2097 according to the current completion type.
2098 @end table
2100 @node Contribution, , Useful functions for creating add-in, Add-in functions
2101 @comment node-name, next, previous, up
2102 @subsection Contribution
2104 If you make your own pretty function and you let it be in public, please
2105 send me the function. I'm going to include it in the next release.
2107 @node Add-in generator, , Add-in functions, Customizations
2108 @comment node-name, next, previous, up
2109 @section Add-in generator
2111 First, don't forget to read the section of add-in functions @ref{Add-in
2112 functions}. If you easily understand how to define them, there's no need
2113 to read this section. But being not familiar with Emacs-Lisp, when you
2114 don't have clear idea what to do, this section describes how to get YaTeX
2115 make add-in function.
2117 There are two methods of generation. One is for fully interactive
2118 generator for beginners and another requires little knowledge of
2119 Emacs-Lisp.
2121 @subsection Generator for beginners
2122 The former generator is called by
2123 @center @kbd{M-x YaTeX-generate}
2125 @noindent
2126 strokes. All you have to do is follow the guidances. Defying them may cases
2127 the disaster (I wonder what is it???). So when you make some mistake, it
2128 is recommendable to type @kbd{C-g} and start afresh.
2130 @subsection Simple generator
2132 The latter generator is invoked by the next sequence.
2133 @center @kbd{M-x YaTeX-generate-simple}
2134 This generator can make both ``option add-in'' and ``argument add-in''
2135 (@emph{refer the section add-in functions}
2136 @ref{How the add-in function works}), whereas @code{YaTeX-generate}
2137 cannot make ``argument addin''.
2139 For example, assume you have the LaTeX command as follows.
2141 @example
2142 \epsinput[t](250,50)@{hoge.eps@}@{plain@}@{Picture of foo@}
2143 (A) (B) (1) (2) (3)
2144 (A)Optional parameter to specify the position
2145 One of t(top), b(bottom), l(left), r(right)
2146 (B)Maximum size of frame
2147 (1)1st argument is filename of EPS file
2148 (2)2nd argument indicates
2149 plain do nothing
2150 frame make frame around image
2151 dframe make double-frame around image
2152 for included EPS file.
2153 (3)Caption for the picture
2154 @end example
2156 Now get start with generation. Typing @kbd{M-x YaTeX-generate-simple}
2157 brings the prompt:
2158 @display
2159 (O)ption? (A)rgument?
2160 @end display
2162 @subsubsection Generating ``option add-in''
2163 @cindex option add-in
2165 Since (A), (B) above are optional argument, all we have to do to
2166 complete them is define the option add-in for them. Let's generate the
2167 function to complete (A).
2169 @display
2170 M-x YaTeX-generate-simple RET
2171 epsinput RET
2173 @end display
2175 @noindent
2176 Typing as above leads the next prompt.
2178 @display
2179 Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit
2180 @end display
2182 @noindent
2183 This asks that ``Which type is the completion style of 1st argument?''.
2184 Here are the possible completion style.
2186 @table @code
2187 @item String
2188 read plain string
2189 @item Complete
2190 read with completion
2191 @item File
2192 read file name
2193 @item Option
2194 read optional string (if string omitted, omit [] too)
2195 @item Position
2196 read positional option (like [htbp])
2197 @item Coord.
2198 read coordinates
2199 @item Quit
2200 quit from generating
2201 @end table
2203 Since (A) is the optional argument to specify the location of included
2204 EPS file, the completion style is @code{Position}, and the possible
2205 characters are t, b, l, and r. To tell these information to generator,
2206 operate as follows.
2208 @display
2209 Read type(1).... p
2210 Acceptable characters: tblr RET
2211 @end display
2213 (B) is coordinate. So its completion style is coOrd. We want a prompt
2214 meaning ``Maximum size'' when completion.
2216 @display
2217 Read type(2).... o
2218 Prompt for coordinates: Max size RET
2219 @end display
2221 That's all for optional argument. Select quit.
2223 @display
2224 Read type(3).... q
2225 @end display
2227 Then the generated option add-in function for \epsinput will be shown in
2228 the next window.
2230 @subsubsection Generating ``argument add-in''
2231 @cindex argument add-in
2233 Next, create the argument add-in. The arguments for \epsinput are EPS
2234 file name, framing style, and caption string in sequence.
2236 @display
2237 M-x YaTeX-generate-simple RET
2238 epsinput RET
2240 @end display
2242 Above key strokes bring the prompt that asks the number of argument.
2243 Answer it with 3.
2245 @display
2246 How many arguments?: 3 RET
2247 @end display
2249 Then the generator asks the completion style and prompt for completion.
2250 Answer them. @kbd{f} for FileName and prompt string.
2252 @display
2253 Read type(1).... f
2254 Prompt for argument#1 EPS file name RET
2255 @end display
2257 The second argument is one of selected symbol. So the completion type
2258 is @code{Completion}.
2260 @display
2261 Read type(2).... c
2262 Prompt for argument#2 Include style RET
2263 @end display
2265 Then all the candidates ready to be read. Type single RET after
2266 entering all.
2268 @display
2269 Item[1](RET to exit): plain RET
2270 Item[2](RET to exit): frame RET
2271 Item[3](RET to exit): dframe RET
2272 Item[4](RET to exit): RET
2273 @end display
2275 The following prompt asks whether the entered string must belong to
2276 candidates or not. In this case, since the argument must be one of
2277 @code{plain}, @code{frame}, and @code{dframe}, type @code{y}.
2279 @display
2280 Require match? (y or n) y
2281 @end display
2283 The last argument is the caption string for which any completion is
2284 needed.
2286 @display
2287 Read type(3).... s
2288 Prompt for argument#3 Caption RET
2289 default: Figure of RET
2290 @end display
2292 Finally we'll get the argument add-in in the next window.
2294 @subsection Contribution
2296 If you get your own pretty function and you let it be in public, please
2297 steel yourself in the happy atmosphere and do not send me the function.
2298 I do know it is not fine because it is generated by yatexgen:-p.
2300 @node Etcetera, Copying, Customizations, Top
2301 @comment node-name, next, previous, up
2302 @chapter Etcetera
2304 The standard completion tables provided in @file{yatex.el} contain a
2305 few La@TeX{} commands I frequently use. This is to lessen the key
2306 strokes to complete entire word, because too many candidates
2307 rarely used often cause too many hits. Therefore always try to
2308 use completion in order to enrich your dictionary, and you will
2309 also find `Wild Bird' growing suitable for your La@TeX{} style.
2311 The package name `Wild Bird' is the English translation of Japanese
2312 title `Yachou', which is a trick on words of Japanese.
2314 @node Copying, , Etcetera, Top
2315 @comment node-name, next, previous, up
2316 @chapter Copying
2318 This program is distributed as a free software. You can
2319 redistribute this software freely but with NO warranty to anything
2320 as a result of using this software. However, any reports and
2321 suggestions are welcome as long as I feel interests in this
2322 software. My possible e-mail address is `yuuji@@yatex.org'.
2323 (up to Sep.2003 at least) And there is mailing list for YaTeX.
2324 Although the common language is Japanese, questions in English will be
2325 welcome. To join the ML, send the mail whose subject is `append' to
2326 the address `yatex@@yatex.org. If you have some
2327 question, please ask to `yatex-admin@@yatex.org'.
2329 The specification of this software will be surely modified
2330 (depending on my feelings) without notice :-p.
2333 @flushright
2334 HIROSE Yuuji
2335 @end flushright
2336 @bye
2338 Local variables:
2339 mode: texinfo
2340 fill-prefix: nil
2341 fill-column: 74
2342 End: