yatex

diff docs/yatexe.tex @ 49:eb0512bfcb7f

Abolish user-article table. Use normal read-string instead. Supply smart add-in function for documentstyle. Update user dictionary whenever new words entered. Enhance [prefix] c. Allow user defined sectioning commands in yatexsec.
author yuuji
date Fri, 25 Nov 1994 08:26:13 +0000
parents a0640ff3f72f
children b0371b6ed799
line diff
     1.1 --- a/docs/yatexe.tex	Mon Oct 31 17:49:43 1994 +0000
     1.2 +++ b/docs/yatexe.tex	Fri Nov 25 08:26:13 1994 +0000
     1.3 @@ -31,11 +31,11 @@
     1.4  * Typesetting::                 
     1.5  * %# notation::                 
     1.6  * Completion::                  
     1.7 +* Local dictionaries::          
     1.8  * Commenting out::              
     1.9  * Cursor jump::                 
    1.10  * Changing and Deleting::       
    1.11  * Filling an item::             
    1.12 -* Local dictionaries::          
    1.13  * Updation of @code{\includeonly}::  
    1.14  * What column?::                
    1.15  * Intelligent newline::         
    1.16 @@ -70,10 +70,16 @@
    1.17  
    1.18  * view-sectioning::             
    1.19  
    1.20 +Changing and Deleting
    1.21 +
    1.22 +* Changing La@TeX{} commands::  
    1.23 +* Killing La@TeX{} commands::   
    1.24 +
    1.25  Customizations
    1.26  
    1.27  * Lisp variables::              
    1.28  * Add-in functions::            
    1.29 +* Add-in generator::            
    1.30  
    1.31  Lisp variables
    1.32  
    1.33 @@ -81,6 +87,18 @@
    1.34  * Sample definitions::          
    1.35  * Hook variables::              
    1.36  * Hook file::                   
    1.37 +
    1.38 +Procedure
    1.39 +
    1.40 +* How the add-in function works?::  
    1.41 +* How the function is called::  
    1.42 +* Useful functions for creating add-in::  
    1.43 +* Contribution::                
    1.44 +
    1.45 +How the add-in function works?
    1.46 +
    1.47 +* Defining `option add-in'::    
    1.48 +* Defining `argument add-in'::  
    1.49  @end menu
    1.50  
    1.51  @node What is YaTeX?, Main features, Top, Top
    1.52 @@ -108,6 +126,7 @@
    1.53          (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m})
    1.54  @item Enclosing text into La@TeX{} environments or commands
    1.55        (@kbd{C-u} @var{AboveKeyStrokes})
    1.56 +@item Displaying the structure of text at entering sectioning delimiters
    1.57  @item Learning unknown/new La@TeX{} commands for the next completion
    1.58  @item Argument reading with a guide for complicated La@TeX{} commands
    1.59  @item Generating argument-readers for new/unsupported commands(@file{yatexgen})
    1.60 @@ -216,7 +235,7 @@
    1.61  skip this by invoking it with universal-argument as follows:
    1.62  
    1.63  @example
    1.64 -C-u [prefix] tl
    1.65 +        C-u [prefix] tl
    1.66  @end example
    1.67  
    1.68  @node %# notation, Completion, Typesetting, Top
    1.69 @@ -391,7 +410,7 @@
    1.70  When you type @kbd{b}, all @code{%#BEGIN} and @code{%#END} are
    1.71  automatically erased.
    1.72  
    1.73 -@node Completion, Commenting out, %# notation, Top
    1.74 +@node Completion, Local dictionaries, %# notation, Top
    1.75  @comment  node-name,  next,  previous,  up
    1.76  @chapter Completion
    1.77  @cindex completion
    1.78 @@ -583,7 +602,7 @@
    1.79  @cindex number of argument
    1.80  
    1.81  @example
    1.82 -C-u 2 [prefix] s (or ESC 2 [prefix] s)
    1.83 +        C-u 2 [prefix] s (or ESC 2 [prefix] s)
    1.84  @end example
    1.85  
    1.86  @noindent
    1.87 @@ -603,12 +622,6 @@
    1.88  arguments by calling the completion with different universal argument
    1.89  again.
    1.90  
    1.91 -  The special number of argument 0 makes YaTeX  use read-string to
    1.92 -read the first  argument  instead of completing-read.  It  is more
    1.93 -comfortable  to enter first  argument  without completion when you
    1.94 -put section title which contains  space character.  Normally, such
    1.95 -sectioning commands as    chapter,  section,  paragraph...,   have
    1.96 -argument 0 in the completion table.
    1.97  
    1.98    Invoking section-type completion with @code{[Prefix] S} (Capital `S')
    1.99  includes the region as the first argument of section-type command.
   1.100 @@ -836,7 +849,36 @@
   1.101  @kbd{;} or @kbd{/} after universal-argument(@kbd{C-u}) which forces
   1.102  @kbd{;} and @kbd{/} to work as math-prefix.
   1.103  
   1.104 -@node Commenting out, Cursor jump, Completion, Top
   1.105 +@node Local dictionaries, Commenting out, Completion, Top
   1.106 +@comment  node-name,  next,  previous,  up
   1.107 +@chapter Local dictionaries
   1.108 +@cindex local dictionaries
   1.109 +@cindex nervous users
   1.110 +
   1.111 +  Tables for completion consist of three dictionaries; `standard
   1.112 +dictionary' built in @file{yatex.el}, `user dictionary' for your common
   1.113 +private commands, and `local dictionary' that is effective in a certain
   1.114 +directory.
   1.115 +
   1.116 +  When you input the command unknown to YaTeX at a completion in the
   1.117 +minibuffer, YaTeX asks you with the following prompt;
   1.118 +
   1.119 +@example
   1.120 +  `foo' is not in table. Register into: U)serTable L)ocal N)one
   1.121 +@end example
   1.122 +
   1.123 +@noindent 
   1.124 +In this menu, typing `u' updates your `user dictionary', `l' updates your
   1.125 +local dictionary, and `n' updates no dictionary and throws the word away.
   1.126 +
   1.127 +  If you find this switching feature meaningless and bothersome, put the
   1.128 +next expression into your @file{~/.emacs}
   1.129 +
   1.130 +@lisp
   1.131 +        (setq YaTeX-nervous nil)
   1.132 +@end lisp
   1.133 +
   1.134 +@node Commenting out, Cursor jump, Local dictionaries, Top
   1.135  @comment  node-name,  next,  previous,  up
   1.136  @chapter Commenting out
   1.137  @cindex commenting out
   1.138 @@ -918,18 +960,20 @@
   1.139  La@TeX{} command of last place.  YaTeX recognize the followings as pairs
   1.140  that have relation each other.
   1.141  
   1.142 -@table
   1.143 +@itemize @bullet
   1.144  @item @code{\begin@{@}} <-> @code{\end@{@}}
   1.145  @item @code{%#BEGIN} <-> @code{%#END}
   1.146  @item @code{\label@{@}} <-> @code{\ref@{@}}
   1.147  @item @code{\include(\input)} -> included file
   1.148  @item @code{\bibitem@{@}} <-> @code{\cite@{@}}
   1.149 -@end table
   1.150 +@end itemize
   1.151  
   1.152 -  On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g}
   1.153 -moves the cursor to the corresponding @code{\end},@code{\begin} line, if
   1.154 -its partner really exists.  The movement on the line @code{%#BEGIN} and
   1.155 -@code{%#END} are the same.
   1.156 +  On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the
   1.157 +cursor to the corresponding @code{\end},@code{\begin} line, if its partner
   1.158 +really exists.  The behaviour on the line @code{%#BEGIN} and @code{%#END}
   1.159 +are the same.  Note that if the correspondent of @code{label/ref} or
   1.160 +@code{cite/bibitem} exists in another file, that file have to be opend to
   1.161 +make a round trip between references by @kbd{[prefix] g}.
   1.162  
   1.163    If you type @code{[prefix] g} on the line of @code{\include@{chap1@}},
   1.164  typically in the main text, YaTeX switches buffer to @file{chap1.tex}.
   1.165 @@ -978,17 +1022,58 @@
   1.166  @cindex prefix c
   1.167  @cindex prefix k
   1.168  
   1.169 -@kbd{[prefix] c} can change the name of the corresponding environment
   1.170 -declaration. @kbd{[prefix] k} works as follows:
   1.171 +@menu
   1.172 +* Changing La@TeX{} commands::  
   1.173 +* Killing La@TeX{} commands::   
   1.174 +@end menu
   1.175 +
   1.176 +@node Changing La@TeX{} commands, Killing La@TeX{} commands, Changing and Deleting, Changing and Deleting
   1.177 +@comment  node-name,  next,  previous,  up
   1.178 +@section Changing La@TeX{} commands
   1.179 +
   1.180 +@kbd{[prefix] c} can change the various (La)@TeX{} commands.  This can
   1.181 +change the followings.
   1.182 +@itemize @bullet
   1.183 +@item Environment names
   1.184 +@item Section-type commands
   1.185 +@item Argument of section-type commands
   1.186 +@item Optional parameters (enclosed by []) of section-type commands
   1.187 +@item Font/size designators
   1.188 +@end itemize
   1.189 +
   1.190 +  Typing @kbd{[prefix] c} on one of above objects you want to change
   1.191 +brings a suitable reading function sometimes with completion.
   1.192 +Note: If you want to change the argument of section-type command that
   1.193 +contains other La@TeX{} commands, type @kbd{[prefix] c} either of
   1.194 +surrounding braces of the argument in order to make YaTeX ignore the
   1.195 +internal La@TeX{} sequences as an object of changing.  Anyway, it is
   1.196 +very difficult to know which argument position the cursor belongs because
   1.197 +the La@TeX{} commands can be nested and braces can freely emerge.  So keep 
   1.198 +it mind to put the cursor on a brace when you are thinking of changing a
   1.199 +complicated argument.
   1.200 +
   1.201 +@node Killing La@TeX{} commands,  , Changing La@TeX{} commands, Changing and Deleting
   1.202 +@comment  node-name,  next,  previous,  up
   1.203 +@section Killing La@TeX{} commands
   1.204 +@cindex Killing La@TeX{} commands
   1.205 +
   1.206 +  @kbd{[prefix] k} kills the La@TeX{} commands sometimes with their
   1.207 +arguments.  Following table illustrates the correspondence of the invoking
   1.208 +position and what is killed.
   1.209  
   1.210  @example
   1.211  [Invoking position]             [action]
   1.212 -\begin,\end line                kill \begin,\end pairs
   1.213 -%BEGIN, %END line               kill %BEGIN,%END pairs
   1.214 +\begin, \end line               kill \begin,\end pairs
   1.215 +%#BEGIN, %#END line             kill %#BEGIN,%#END pairs
   1.216  on a Section-type command       kill section-type command
   1.217  on a parenthesis                kill parentheses
   1.218  @end example
   1.219  
   1.220 +Note that when killing @code{\begin, \end} or @code{%#BEGIN, %#END} pair,
   1.221 +the lines @code{\begin, \end} or @code{%#BEGIN, %#END} exist will be
   1.222 +killed entirely.  So take care not to create any line that contains more
   1.223 +than one @code{\begin} or so.
   1.224 +
   1.225  While all operations above are to kill `containers' which surround some
   1.226  text, universal argument (@kbd{C-u}) for these commands kills not only
   1.227  `containers' but also `contents' of them.  See below as a sample.
   1.228 @@ -999,7 +1084,7 @@
   1.229         ~(cursor)
   1.230  @end example
   1.231  
   1.232 -@node Filling an item, Local dictionaries, Changing and Deleting, Top
   1.233 +@node Filling an item, Updation of @code{\includeonly}, Changing and Deleting, Top
   1.234  @comment  node-name,  next,  previous,  up
   1.235  @chapter Filling an item
   1.236  @cindex filling an item
   1.237 @@ -1029,36 +1114,7 @@
   1.238  for Emacs-Lisp, name  a newcommand  for  `itemize' beginning  with
   1.239  @code{\item} such as @code{\itembf}, not @code{\bfitem}.
   1.240  
   1.241 -@node Local dictionaries, Updation of @code{\includeonly}, Filling an item, Top
   1.242 -@comment  node-name,  next,  previous,  up
   1.243 -@chapter Local dictionaries
   1.244 -@cindex local dictionaries
   1.245 -@cindex nervous users
   1.246 -
   1.247 -  Tables for completion consist of three dictionaries; `standard
   1.248 -dictionary' built in @file{yatex.el}, `user dictionary' for your common
   1.249 -private commands, and `local dictionary' that is effective in a certain
   1.250 -directory.
   1.251 -
   1.252 -  When you input the command unknown to YaTeX at a completion in the
   1.253 -minibuffer, YaTeX asks you with the following prompt;
   1.254 -
   1.255 -@example
   1.256 -  `foo' is not in table. Register into: U)serTable L)ocal N)one
   1.257 -@end example
   1.258 -
   1.259 -@noindent 
   1.260 -In this menu, typing `u' updates your `user dictionary', `l' updates your
   1.261 -local dictionary, and `n' updates no dictionary and throws the word away.
   1.262 -
   1.263 -  If you find this switching feature meaningless and bothersome, put the
   1.264 -next expression into your @file{~/.emacs}
   1.265 -
   1.266 -@lisp
   1.267 -        (setq YaTeX-nervous nil)
   1.268 -@end lisp
   1.269 -
   1.270 -@node Updation of @code{\includeonly}, What column?, Local dictionaries, Top
   1.271 +@node Updation of @code{\includeonly}, What column?, Filling an item, Top
   1.272  @comment  node-name,  next,  previous,  up
   1.273  @chapter Updation of @code{\includeonly}
   1.274  @cindex includeonly
   1.275 @@ -1262,6 +1318,7 @@
   1.276  @menu
   1.277  * Lisp variables::              
   1.278  * Add-in functions::            
   1.279 +* Add-in generator::            
   1.280  @end menu
   1.281  
   1.282  @node Lisp variables, Add-in functions, Customizations, Customizations
   1.283 @@ -1297,7 +1354,9 @@
   1.284  
   1.285    Here are the customizable variables of yatex-mode.  Each value setq-ed
   1.286  in @file{~/.emacs} is preferred and that of defined in @file{yatex.el} is
   1.287 -neglected.  Parenthesized contents stands for the default value.
   1.288 +neglected.  Parenthesized contents stands for the default value.  When you
   1.289 +are to change some of these variables,  see more detailed documentation of
   1.290 +the variable by @kbd{M-x describe-variable}.
   1.291  
   1.292  @defvar YaTeX-prefix
   1.293          Prefix key stroke (@kbd{C-c})
   1.294 @@ -1435,6 +1494,18 @@
   1.295          Disable [prefix] b ?? shortcut (@code{nil)}
   1.296  @end defvar
   1.297  
   1.298 +@defvar YaTeX-hilit-pattern-adjustment-private
   1.299 +List of the list that contain the regular expression and the symbol of
   1.300 +logical meaning of the string that matches the pattern.  See also the
   1.301 +value from @code{(assq 'yatex-mode hilit-patterns-alist)} and the value of 
   1.302 +@code{YaTeX-hilit-pattern-adjustment-default} (and even the document of
   1.303 +hilit19.el).
   1.304 +@end defvar
   1.305 +
   1.306 +@defvar YaTeX-sectioning-level
   1.307 +Alist of LaTeX's sectioning command vs its height.
   1.308 +@end defvar
   1.309 +
   1.310  @node Sample definitions, Hook variables, All customizable variables, Lisp variables
   1.311  @comment  node-name,  next,  previous,  up
   1.312  @subsection Sample definitions
   1.313 @@ -1482,16 +1553,385 @@
   1.314  this file at the initialization of itself.  Using @file{yatexhks.el}
   1.315  makes @code{yatex-mode-load-hook} unnecessary.
   1.316  
   1.317 -@node Add-in functions,  , Lisp variables, Customizations
   1.318 +@node Add-in functions, Add-in generator, Lisp variables, Customizations
   1.319  @comment  node-name,  next,  previous,  up
   1.320  @section Add-in functions
   1.321  @cindex add-in functions
   1.322 +@cindex yatexadd.el
   1.323  
   1.324    You can easily  define  a function to input  detailed  arguments
   1.325 -with completion according  to La@TeX{} environments  or commands.  To
   1.326 -know the way to define these functions, see also @file{yatexadd.doc} in
   1.327 -this package please.
   1.328 +with completion according  to La@TeX{} environments  or commands. 
   1.329  
   1.330 +@c @node What is add-in functions?,  , Add-in functions, Add-in functions
   1.331 +@comment  node-name,  next,  previous,  up
   1.332 +@subsection What is add-in functions?
   1.333 +@cindex tabular
   1.334 +
   1.335 +  When you input @code{tabular} environment, don't you think ``I want
   1.336 +YaTeX to complete its argument toward my favorite one such as
   1.337 +@code{@{|c|c|c|@}}...''?  Yes, you can define the function to complete
   1.338 +arguments for any environment and any La@TeX{} commands.
   1.339 +
   1.340 +@subsection Procedure
   1.341 +
   1.342 +  Here is the procedure to define add-in functions.
   1.343 +@enumerate
   1.344 +@item
   1.345 +Define the function
   1.346 +@item
   1.347 +Put the function into @file{yatexhks.el}
   1.348 +@end enumerate
   1.349 +
   1.350 +@menu
   1.351 +* How the add-in function works?::  
   1.352 +* How the function is called::  
   1.353 +* Useful functions for creating add-in::  
   1.354 +* Contribution::                
   1.355 +@end menu
   1.356 +
   1.357 +@node How the add-in function works?, How the function is called, Add-in functions, Add-in functions
   1.358 +@comment  node-name,  next,  previous,  up
   1.359 +@subsection How the add-in function works?
   1.360 +
   1.361 +  There are two kinds of add-in.  @dfn{Option add-in} returns the
   1.362 +La@TeX{}'s optional parameters such as optional strings after
   1.363 +@code{\begin@{ENV@}}, optional strings between a section-type command
   1.364 +and its first argument, and optional strings just after type
   1.365 +maketitle-type command.  The following illustrates the name of add-in
   1.366 +functions, where underlined strings are generated by add-in functions.
   1.367 +
   1.368 +@display
   1.369 +\begin{table}[ht]		(Function name: YaTeX:table)
   1.370 +             ~~~~
   1.371 +\put(100,200){}		(Function name: YaTeX:put)
   1.372 +    ~~~~~~~~~
   1.373 +\sum_{i=0}^{n}		(Function name: YaTeX:sum)
   1.374 +    ~~~~~~~~~~
   1.375 +@end display
   1.376 +
   1.377 +  Obviously, the function name is decided by concatenating the prefix
   1.378 +`YaTeX:' and La@TeX{} command's name.
   1.379 +
   1.380 +  Another add-in type is @dfn{argument add-in}, which completes arguments
   1.381 +for section-type commands.
   1.382 +
   1.383 +@display
   1.384 +\newcommand{\foo}{bar}	(Function name: YaTeX::newcommand)
   1.385 +            ~~~~  ~~~
   1.386 +@end display
   1.387 +
   1.388 +  When the section-type command is inputted, the function named by
   1.389 +concatenating `YaTeX::' and section-type command, is called automatically
   1.390 +with an integer argument which indicates which argument of section-type
   1.391 +command is being read.  Thus the add-in should determine the
   1.392 +job refering the value of its argument.
   1.393 +
   1.394 +@menu
   1.395 +* Defining `option add-in'::    
   1.396 +* Defining `argument add-in'::  
   1.397 +@end menu
   1.398 +
   1.399 +@node Defining `option add-in', Defining `argument add-in', How the add-in function works?, How the add-in function works?
   1.400 +@comment  node-name,  next,  previous,  up
   1.401 +@subsubsection Defining `option add-in'
   1.402 +
   1.403 +  If you want @code{@{|c|c|c|@}} for all @code{tabular} environment,
   1.404 +
   1.405 +@lisp
   1.406 +        (defun YaTeX:tabular ()
   1.407 +          "{|c|c|c|}")
   1.408 +@end lisp
   1.409 +
   1.410 +@noindent
   1.411 +is enough.  If you want more complicated format, define as below.
   1.412 +
   1.413 +@lisp
   1.414 +        (defun YaTeX:tabular ()
   1.415 +          "@{@@@{\\vrule width 1pt\\ @}|||@@@{\\ \\vrule width 1pt@}@}")
   1.416 +@end lisp
   1.417 +
   1.418 +@noindent
   1.419 +Note that the character @code{\} must be described as @code{\\} in
   1.420 +Emacs-Lisp.  The next example reads the tabular format from keyboard.
   1.421 +@lisp
   1.422 +        (defun YaTeX:tabular ()
   1.423 +          (concat "{" (read-string "Rule: ") "}"))
   1.424 +@end lisp
   1.425 +
   1.426 +@node Defining `argument add-in',  , Defining `option add-in', How the add-in function works?
   1.427 +@comment  node-name,  next,  previous,  up
   1.428 +@subsubsection Defining `argument add-in'
   1.429 +
   1.430 +  This section describes how to define the add-in function for
   1.431 +@code{\newcommand}.
   1.432 +
   1.433 +  The first argument of @code{\newcommand} begins always with @code{\}.
   1.434 +The second argument is usually so complex that we can not edit them in the 
   1.435 +minibuffer.  Here is the created function considering this.
   1.436 +
   1.437 +@lisp
   1.438 +        (defun YaTeX::newcommand (n)	;n is argument position
   1.439 +          (cond
   1.440 +           ((= n 1)			;1st argument is macro name
   1.441 +            (read-string "Command: " "\\")) ;initial input `\' 
   1.442 +           ((= n 2) "")			;do nothing when reading arg#2
   1.443 +           (t nil)))
   1.444 +@end lisp
   1.445 +
   1.446 +  Note that when the `argument add-in' function return `nil', normal
   1.447 +argument reader will be called.
   1.448 +
   1.449 +@node How the function is called, Useful functions for creating add-in, How the add-in function works?, Add-in functions
   1.450 +@comment  node-name,  next,  previous,  up
   1.451 +@subsection How the function is called
   1.452 +
   1.453 +  YaTeX calls the add-in functions for specified begin-type, section-type,
   1.454 +and maketitle-type command, if any.  `Option add-in' functions for
   1.455 +begin-type are called when @code{\begin@{ENV@}} has been inserted,
   1.456 +functions for section-type are called just before input of the first
   1.457 +argument, and functions for maketitle-type is called after maketitle-type
   1.458 +command has been inserted.  `Argument add-in' functions are called at each
   1.459 +entry of arguments for section-type commands.
   1.460 +
   1.461 +@node Useful functions for creating add-in, Contribution, How the function is called, Add-in functions
   1.462 +@comment  node-name,  next,  previous,  up
   1.463 +@subsection Useful functions for creating add-in
   1.464 +
   1.465 +  Many add-in functions for typical La@TeX{} commands are defined in
   1.466 +@file{yatexadd.el}.  Those are also useful as references.  Here are the
   1.467 +short descriptions on useful functions, where [F] means function, [A]
   1.468 +means arguments, [D] means description.
   1.469 +
   1.470 +@itemize
   1.471 +@item [F]
   1.472 +YaTeX:read-position
   1.473 +@itemx [A]
   1.474 +Character list which can show up in the brackets
   1.475 +@itemx [D]
   1.476 +   Return the location specifier such as `[htb]'.  When
   1.477 +nothing is entered, omit [] itself.  If the possible characters
   1.478 +are "htbp", call this function as
   1.479 +@code{(YaTeX:read-position "htbp")}
   1.480 +
   1.481 +@item [F]
   1.482 +YaTeX:read-coordinates
   1.483 +@itemx [A]
   1.484 +Base prompt, X-axis prompt, Y-axis prompt     (each optional)        
   1.485 +@itemx [D]
   1.486 +  Read the coodinates with the prompt ``BasePrompt X-axisPrompt:'' for
   1.487 +X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form 
   1.488 +of ``(X,Y)''.  The default prompts are @code{Dimention}, @code{X},
   1.489 +@code{Y} respectively.
   1.490 +
   1.491 +@item [F]
   1.492 +YaTeX:check-comletion-type
   1.493 +@itemx [A]
   1.494 +One of the symbols: 'begin, 'section, or 'maketitle
   1.495 +@itemx [D]
   1.496 +  Check the current completion type is specified one and cause error if
   1.497 +not. The variable @code{YaTeX-current-completion-type} holds the symbol
   1.498 +according to the current completion type.
   1.499 +@end itemize
   1.500 +
   1.501 +@node Contribution,  , Useful functions for creating add-in, Add-in functions
   1.502 +@comment  node-name,  next,  previous,  up
   1.503 +@subsection Contribution
   1.504 +
   1.505 +  If you make your own pretty function and you let it be in public, please 
   1.506 +send me the function.  I'm going to include it in the next release.
   1.507 +
   1.508 +@node Add-in generator,  , Add-in functions, Customizations
   1.509 +@comment  node-name,  next,  previous,  up
   1.510 +@section Add-in generator
   1.511 +
   1.512 +  First, don't forget to read the section of add-in functions @ref{Add-in
   1.513 +functions}.  If you easily understand how to define them, there's no need
   1.514 +to read this section.  But being not familiar with Emacs-Lisp, when you
   1.515 +don't have clear idea what to do, this section describes how to get YaTeX
   1.516 +make add-in function.
   1.517 +
   1.518 +  There are two methods of generation.  One is for fully interactive
   1.519 +generator for beginners and another requires little knowledge of
   1.520 +Emacs-Lisp.
   1.521 +
   1.522 +@subsection Generator for beginners
   1.523 +  The former generator is called by
   1.524 +@center @kbd{M-x YaTeX-generate}
   1.525 +
   1.526 +@noindent
   1.527 +strokes.  All you have to do is follow the guidances.  Defying them may cases 
   1.528 +the disaster (I wonder what is it???).  So when you make some mistake, it
   1.529 +is recommendable to type @kbd{C-g} and start afresh.
   1.530 +
   1.531 +@subsection Simple generator
   1.532 +
   1.533 +  The latter generator is invoked by the next sequence.
   1.534 +@center @kbd{M-x YaTeX-generate-simple}
   1.535 +This generator can make both ``option add-in'' and ``argument add-in''
   1.536 +(@emph{refer the section add-in functions}
   1.537 +@ref{How the add-in function works?}), whereas @code{YaTeX-generate}
   1.538 +cannot make ``argument addin''.
   1.539 +
   1.540 +  For example, assume you have the LaTeX command as follows.
   1.541 +
   1.542 +@example
   1.543 +	\epsinput[t](250,50){hoge.eps}{plain}{Picture of foo}
   1.544 +	         (A)  (B)     (1)      (2)      (3)
   1.545 +	(A)Optional parameter to specify the position
   1.546 +	   One of t(top), b(bottom), l(left), r(right)
   1.547 +	(B)Maximum size of frame
   1.548 +	(1)1st argument is filename of EPS file
   1.549 +	(2)2nd argument indicates
   1.550 +		plain		do nothing
   1.551 +		frame		make frame around image
   1.552 +		dframe		make double-frame around image
   1.553 +	   for included EPS file.
   1.554 +	(3)Caption for the picture
   1.555 +@end example
   1.556 +
   1.557 +  Now get start with generation.  Typing @kbd{M-x YaTeX-generate-simple}
   1.558 +brings the prompt:
   1.559 +@display
   1.560 +                (O)ption? (A)rgument?
   1.561 +@end display
   1.562 +
   1.563 +@subsubsection Generating ``option add-in''
   1.564 +@cindex option add-in
   1.565 +
   1.566 +  Since (A), (B) above are optional argument, all we have to do to
   1.567 +complete them is define the option add-in for them.  Let's generate the
   1.568 +function to complete (A).
   1.569 +
   1.570 +@display
   1.571 +                M-x YaTeX-generate-simple RET
   1.572 +                epsinput RET
   1.573 +                o
   1.574 +@end display
   1.575 +
   1.576 +@noindent
   1.577 +Typing as above leads the next prompt.
   1.578 +
   1.579 +@display
   1.580 +Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit
   1.581 +@end display
   1.582 +
   1.583 +@noindent
   1.584 +  This asks that ``Which type is the completion style of 1st argument?''.
   1.585 +Here are the possible completion style.
   1.586 +
   1.587 +@table @code
   1.588 +@item String
   1.589 +read plain string
   1.590 +@item Complete
   1.591 +read with completion
   1.592 +@item File
   1.593 +read file name
   1.594 +@item Option
   1.595 +read optional string (if string omitted, omit [] too)
   1.596 +@item Position
   1.597 +read positional option (like [htbp])
   1.598 +@item Coord.
   1.599 +read coodinates
   1.600 +@item Quit
   1.601 +quit from genarating
   1.602 +@end table
   1.603 +
   1.604 +  Since (A) is the optional argument to specify the location of included
   1.605 +EPS file, the completion style is @code{Position}, and the possible
   1.606 +characters are t, b, l, and r.  To tell these information to generator,
   1.607 +operate as follows.
   1.608 +
   1.609 +@display
   1.610 +                Read type(1).... 		p
   1.611 +                Acceptable characters:		tblr RET
   1.612 +@end display
   1.613 +
   1.614 +  (B) is coordinate.  So its completion style is coOrd.  We want a prompt
   1.615 +meaning ``Maximum size'' when completion.
   1.616 +
   1.617 +@display
   1.618 +                Read type(2)....		o
   1.619 +                Prompt for coordinates:		Max size RET
   1.620 +@end display
   1.621 +
   1.622 +  That's all for optional argument.  Select quit.
   1.623 +
   1.624 +@display
   1.625 +                Read type(3)....		q
   1.626 +@end display
   1.627 +
   1.628 +  Then the generated option add-in function for \epsinput will be shown in
   1.629 +the next window.
   1.630 +
   1.631 +@subsubsection Generating ``argument add-in''
   1.632 +@cindex argument add-in
   1.633 +
   1.634 +  Next, create the argument add-in.  The arguments for \epsinput are EPS
   1.635 +file name, framing style, and caption string in sequence.
   1.636 +
   1.637 +@display
   1.638 +                M-x YaTeX-generate-simple RET
   1.639 +                epsinput RET
   1.640 +                a
   1.641 +@end display
   1.642 +
   1.643 +  Above key strokes bring the prompt that asks the number of argument.
   1.644 +Answer it with 3.
   1.645 +
   1.646 +@display
   1.647 +                How many arguments?: 3 RET
   1.648 +@end display
   1.649 +
   1.650 +  Then the generator asks the completion style and prompt for completion.
   1.651 +Answer them.  @kbd{f} for FileName and prompt string.
   1.652 +
   1.653 +@display
   1.654 +                Read type(1)....		f
   1.655 +                Prompt for argument#1		EPS file name RET
   1.656 +@end display
   1.657 +
   1.658 +  The second argument is one of selected symbol.  So the completion type
   1.659 +is @code{Completion}.
   1.660 +
   1.661 +@display
   1.662 +                Read type(2)....		c
   1.663 +                Prompt for argument#2		Include style RET
   1.664 +@end display
   1.665 +
   1.666 +  Then all the candidates ready to be read.  Type single RET after
   1.667 +entering all.
   1.668 +
   1.669 +@display
   1.670 +		Item[1](RET to exit):		plain RET
   1.671 +		Item[2](RET to exit):		frame RET
   1.672 +		Item[3](RET to exit):		dframe RET
   1.673 +		Item[4](RET to exit):		RET
   1.674 +@end display
   1.675 +
   1.676 +  The following prompt asks whether the entered string must belong to
   1.677 +candidates or not.  In this case, since the argument must be one of
   1.678 +@code{plain}, @code{frame}, and @code{dframe}, type @code{y}.
   1.679 +
   1.680 +@display
   1.681 +                Require match? (y or n)		y
   1.682 +@end display
   1.683 +
   1.684 +  The last argument is the caption string for which any completion is
   1.685 +needed.
   1.686 +
   1.687 +@display
   1.688 +                Read type(3)....		s
   1.689 +                Prompt for argument#3		Caption RET
   1.690 +                default:			Figure of RET
   1.691 +@end display
   1.692 +
   1.693 +  Finally we'll get the argument add-in in the next window.
   1.694 +
   1.695 +@subsection Contribution
   1.696 +
   1.697 +  If you get your own pretty function and you let it be in public, please 
   1.698 +steel yourself in the happy atomospher and do not send me the function.
   1.699 +I do know it is not fine because it is generated by yatexgen:-p.
   1.700  
   1.701  @node Etcetera, Copying, Customizations, Top
   1.702  @comment  node-name,  next,  previous,  up
   1.703 @@ -1514,7 +1954,7 @@
   1.704  as a result  of using this  software.   However, any  reports  and
   1.705  suggestions are  welcome as  long as I   feel  interests in   this
   1.706  software.   My possible  e-mail address is  `yuuji@@ae.keio.ac.jp'.
   1.707 -(up to Mar.1993 at least)
   1.708 +(up to Mar.1995 at least)
   1.709  
   1.710    The specification of this software will be surely modified
   1.711  (depending on my feelings) without notice :-p.