LaTex2Web logo

Documents Live, a web authoring and publishing system

If you see this, something is wrong

Table of contents

First published on Monday, Oct 28, 2024 and last modified on Monday, Jun 16, 2025

C.8 Definitions, Numbering, and Programming

François Chaplais

1 Definitions, Numbering, and Programming

1.1 Defining Commands

The syntax

\newcommand{cmd}[args][opt]{def}

is implemented recursively before any \( \rm{\LaTeX}\) interpretation. In particular, the [opt] parameter is treated properly.

The logic of \renewcommand and \providecommand is preserved. Note that, however, LaTeX2Web does not take standard LaTeX commands (or packages commands) into account when deciding if the command definitions should be executed.

1.2 Defining Environments

Both \newenvironment and \renewenvironment are supported.

1.3 Theorem-like Environments

\newtheorem is supported with corresponding counters.

1.4 Numbering

To enable dynaminc cross-references, the numbering is performed within LaTeX2Web. Therefore, counter like commands are ignored.

1.5 The ifthen package

The ifthen package has a basic implementation: it only recongnizes two commands: if0 and if1. To create multiple if commands, proceed as follows

  • use any command to use in place of the if command

  • at compile time, use a \newcommand statement to decide if the deciding statement should be replaced by if0 or if1.