(yatexe)Add-in generator

Prev: Add-in functions Up: Customizations

Add-in generator

  First, don't forget to read the section of add-in functions Note: Add-in
functions.  If you easily understand how to define them, there's no need
to read this section.  But being not familiar with Emacs-Lisp, when you
don't have clear idea what to do, this section describes how to get YaTeX
make add-in function.

  There are two methods of generation.  One is for fully interactive
generator for beginners and another requires little knowledge of

Generator for beginners
  The former generator is called by
                           `M-x YaTeX-generate'

strokes.  All you have to do is follow the guidances.  Defying them may
cases the disaster (I wonder what is it???).  So when you make some
mistake, it is recommendable to type `C-g' and start afresh.

Simple generator

  The latter generator is invoked by the next sequence.
                       `M-x YaTeX-generate-simple'
This generator can make both "option add-in" and "argument add-in"
(*refer the section add-in functions*
Note: How the add-in function works), whereas `YaTeX-generate'
cannot make "argument addin".

  For example, assume you have the LaTeX command as follows.

     	\epsinput[t](250,50){hoge.eps}{plain}{Picture of foo}
     	         (A)  (B)     (1)      (2)      (3)
     	(A)Optional parameter to specify the position
     	   One of t(top), b(bottom), l(left), r(right)
     	(B)Maximum size of frame
     	(1)1st argument is filename of EPS file
     	(2)2nd argument indicates
     		plain		do nothing
     		frame		make frame around image
     		dframe		make double-frame around image
     	   for included EPS file.
     	(3)Caption for the picture

  Now get start with generation.  Typing `M-x YaTeX-generate-simple'
brings the prompt:
                     (O)ption? (A)rgument?

Generating "option add-in"

  Since (A), (B) above are optional argument, all we have to do to
complete them is define the option add-in for them.  Let's generate the
function to complete (A).

                     M-x YaTeX-generate-simple RET
                     epsinput RET

Typing as above leads the next prompt.

     Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit

  This asks that "Which type is the completion style of 1st argument?".
Here are the possible completion style.

     read plain string
     read with completion
     read file name
     read optional string (if string omitted, omit [] too)
     read positional option (like [htbp])
     read coordinates
     quit from generating

  Since (A) is the optional argument to specify the location of included
EPS file, the completion style is `Position', and the possible characters
are t, b, l, and r.  To tell these information to generator, operate as

                     Read type(1).... 		p
                     Acceptable characters:		tblr RET

  (B) is coordinate.  So its completion style is coOrd.  We want a prompt
meaning "Maximum size" when completion.

                     Read type(2)....		o
                     Prompt for coordinates:		Max size RET

  That's all for optional argument.  Select quit.

                     Read type(3)....		q

  Then the generated option add-in function for \epsinput will be shown in
the next window.

Generating "argument add-in"

  Next, create the argument add-in.  The arguments for \epsinput are EPS
file name, framing style, and caption string in sequence.

                     M-x YaTeX-generate-simple RET
                     epsinput RET

  Above key strokes bring the prompt that asks the number of argument.
Answer it with 3.

                     How many arguments?: 3 RET

  Then the generator asks the completion style and prompt for completion.
Answer them.  `f' for FileName and prompt string.

                     Read type(1)....		f
                     Prompt for argument#1		EPS file name RET

  The second argument is one of selected symbol.  So the completion type
is `Completion'.

                     Read type(2)....		c
                     Prompt for argument#2		Include style RET

  Then all the candidates ready to be read.  Type single RET after
entering all.

     		Item[1](RET to exit):		plain RET
     		Item[2](RET to exit):		frame RET
     		Item[3](RET to exit):		dframe RET
     		Item[4](RET to exit):		RET

  The following prompt asks whether the entered string must belong to
candidates or not.  In this case, since the argument must be one of
`plain', `frame', and `dframe', type `y'.

                     Require match? (y or n)		y

  The last argument is the caption string for which any completion is

                     Read type(3)....		s
                     Prompt for argument#3		Caption RET
                     default:			Figure of RET

  Finally we'll get the argument add-in in the next window.


  If you get your own pretty function and you let it be in public, please
steel yourself in the happy atmosphere and do not send me the function.  I
do know it is not fine because it is generated by yatexgen:-p.

automatically generated by info2www.cgi version 1.2