Info Node: (texinfo)Def Cmd Template

texinfo: Def Cmd Template
Definition Commands
Def Cmd Continuation Lines
Back to Software Index
16.1 The Template for a Definition
==================================
The '@deffn' command is used for definitions of entities that resemble
functions. To write a definition using the '@deffn' command, write the
'@deffn' command at the beginning of a line and follow it on the same
line by the category of the entity, the name of the entity itself, and
its arguments (if any). Then write the body of the definition on
succeeding lines. (You may embed examples in the body.) Finally, end
the definition with an '@end deffn' command written on a line of its
own.
The other definition commands follow the same format: a line with the
'@def...' command and whatever arguments are appropriate for that
command; the body of the definition; and a corresponding '@end' line.
The template for a definition looks like this:
@deffn CATEGORY NAME ARGUMENTS...
BODY-OF-DEFINITION
@end deffn
For example,
@deffn Command forward-word count
This command moves point forward @var{count} words
(or backward if @var{count} is negative). ...
@end deffn
produces
-- Command: forward-word count
This command moves point forward COUNT words (or backward if
COUNT is negative). ...
Capitalize the category name like a title. If the name of the
category contains spaces, as in the phrase 'Interactive Command',
enclose it in braces. For example:
@deffn {Interactive Command} isearch-forward
...
@end deffn
Otherwise, the second word will be mistaken for the name of the entity.
As a general rule, when any of the arguments in the heading line
_except_ the last one are more than one word, you need to enclose them
in braces. This may also be necessary if the text contains commands,
for example, '{declaraci@'on}' if you are writing in Spanish.
Some of the definition commands are more general than others. The
'@deffn' command, for example, is the general definition command for
functions and the like--for entities that may take arguments. When you
use this command, you specify the category to which the entity belongs.
Three predefined, specialized variations ('@defun', '@defmac', and
'@defspec') specify the category for you: "Function", "Macro", and
"Special Form" respectively. (In Lisp, a special form is an entity much
like a function.) Similarly, the general '@defvr' command is
accompanied by several specialized variations for describing particular
kinds of variables.
Note: Sample Function Definition, for a detailed example of a
function definition, including the use of '@example' inside the
definition.
automatically generated by info2www version 1.2