During this season of giving, you can show your support for the NTP Project by making a donation to Network Time Foundation.

Examples texi2mdoc


Writing Definition File

Here you will be explained about stanzas that may use to get texinfo output through autogen . There are stanzas that are not mandatory to use for texinfo output format.

Indicating Definitions, Commands, etc.

@code{}

Example Input:

testing @code{sample-code}

Translated Output:

testing
.Li sample-code

Conditions:

Nested macros are not supported

@kbd{}

Example Input:

The function returns @code{nil}

Translated Output:

The function returns
.Li nil

Conditions:

This macro only support @key nesting currently

@key{}

Example Input:

@key{RET}

Translated Output:

.Li RET

Conditions:

Nested macros are not supported

@samp{}

Example Input:

To match @samp{foo} at the end of the line,
use the regexp @samp{foo$}.

Translated Output:

To match=
.Sq foo
at the end of the line, use the regexp
.Sq foo$.

Conditions:

Nested macros are not supported

@verb{<char><char>}

Example Input:

How many @verb{|@|}-escapes does one need to print this
@verb{.@a @b @c.} string or @verb{+@'e?`!`{}\+} this?

Translated Output:

How many @ -escapes does one need to print this .@a @b @c. string or +@'e?`!`{\+} this?

Conditions:

Nested macros are not supported

@var{}

Example Input:

To delete file @var{filename},
type @samp{rm @var{filename}}.

Translated Output:

To delete file
.Li filename
type
.Sq rm filename.

Conditions:

Only @samp nesting is provided

@file{}

Example Input:

The @file{.el} files are in
the @file{/usr/local/emacs/lisp} directory.

Translated Output:

The
.Li .el
files are in the
.Li /usr/local/emacs/lisp
directory.

Conditions:

Nested macros are not supported

@command{}

Example Input:

The command @command{ls} lists directory contents.

Translated Output:

The command
.Li ls
lists directory contents.

Conditions:

Nested macros are not supported

@option{}

Example Input:

The option @option{-l} produces a long listing.

Translated Output:

The option
.Li -l
produces a long listing.

Conditions:

Nested macros are not supported

@dfn{}

Example Input:

Getting rid of a file is called @dfn{deleting} it.

Translated Output:

Getting rid of a file is called
.Sq deleting
it.

Conditions:

Nested macros are not supported

@abbr{[, ]}

Example Input:

@abbr{Comput. J., Computer Journal}

Translated Output:

.Li Comput. J., Computer Jurnal

Conditions:

Nested macros are not supported

@acronym (This command is not completed)

Example Input:

Translated Output:

Conditions:

@indicateurl{}

Example Input:

For example, the url might be @indicateurl{https://example.org/path}.

Translated Output:

For example, the url might be
.Aq Ao https://example.org/path. Ac

Conditions:

Nested macros are not supported

@email{[, ]}

Example Input:

Send bug reports to @email{bug-texinfo@@gnu.org},
suggestions to the @email{bug-texinfo@@gnu.org, same place}.

Translated Output:

Send bug reports to
.Aq bug-texinfo@@gnu.org,
suggestions to the
.Aq bug-texinfo@@gnu.org.

Conditions:

Nested macros are not supported

Emphasizing Text

@emph{} and @strong{}

Example Input:

@strong{Caution:} @samp{rm * .[^.]*}
removes @emph{all} files in the directory.

Translated Output:

.Li Caution:
.Sq rm * .[^.]*
removes
.Em all
files in the directory.

Conditions:

Nested macros are not supported

@sc{}: The Small Caps Font

Example Input:

Richard @sc{Stallman} founded @acronym{GNU}.

Translated Output:

Richard
.Tn Stallman
founded
.Li GNU
.

Conditions:

Nested macros are not supported

Quotations and Examples

@quotation: Block quotations

Example Input:

@quotation Note
This is
a foo.
@end quotation

Translated Output:

.Sy Note
This is a foo.

Conditions:

Nested macros are not supported

@example: Example Text

Example Input:

@example
cp foo @var{dest1}; \
cp foo @var{dest2}
@end example

Translated Output:

.Li cp foo dest1; \
.Li cp foo dest2

Conditions:

Nesting is provided

@verbatim: Literal Text

Example Input:

@verbatim
{
<TAB>@command with strange characters: @'e
expand<TAB>me
}
@end verbatim

Translated Output:

.Li {
.Li <TAB>@command with strange characters: @'e
.Li expand<TAB>me
.Li }

Conditions:

Nesting is provided

@verbatiminclude: Include a File Verbatim

@lisp: Marking a Lisp Example

Example Input:

This is an example of text written between an
@lisp
command and an
@end lisp
command.

Translated Output:

This is an example of text written between an
.Li command and an
command.

Conditions:

Nesting is not provided

@small... Block Commands

@display and @smalldisplay

Example Input:

This is an example of text written between an
@display
command and an
@end display
command. The
@display
command indents the text, but does not fill it.
@end display

Translated Output:

This is an example of text written between an
.Li command and an
command. This is an example of text written between an
.Li command and an
command. The
.Li command indents the text, but does not fill it.

Conditions:

Nesting is not provided

@format and @smallformat

@exdent: Undoing a Line's Indentation

@flushleft and @flushright

@noindent: Omitting Indentation

@cartouche: Rounded Rectangles Around Examples

Lists and Tables

@itemize: Making an Itemized List

@enumerate: Making a Numbered or Lettered List

Using the @table Command

@ftable and @vtable

@itemx

Multitable Column Widths

Multitable Rows

Topic revision: r9 - 05 Oct 2022, DruLavigne
Copyright © by the contributing authors.Use of this website indicates your agreement with, and acceptance of, the PrivacyPolicy, the WikiDisclaimer, and the PrivateWebPolicy.