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