StartLaTeX faqLaTeX for Beginners F.A.Q.LaTeX topicsLaTeX courseSearch

Introduction to New Commands

When introducing a new command in LaTeX, it's essential to avoid using existing names. As an alternative, consider using the German name or capitalizing the command.

For example, \neueseite as a new command analogous to the \newpage command.

Naming New Commands

New commands, except for the last character (which can also be a *), should consist only of letters.


The user is free to define new commands wherever they wish. An exception is the Beamer class, where the new command must be defined before the document begins or in every frame where it's used.


The command used to define new commands is \newcommand.

Defining New Commands:


For example, defining an abbreviation:

\newcommand{\GT}{Game theory}
\GT is a part of economics.
Game theoryis a part of economics.

Nested Commands

\newcommand{\GTn}{Game theory\nbs}
Game theory is a part of economics.

Defining Commands with Arguments

New commands with additional arguments can be defined: \newcommand{\Name}[Number]{Definition}

Abbreviations II

\newcommand{\GTB}[1]{\GT \ Sheet No.#1}
Game theory Sheet No.2

Note: Only 9 elements are possible as arguments!

Defining Commands with Options

When defining new commands, they can also be equipped with options. If no argument is passed, the default value will be taken.

Command: \newcommand{\Name}[Number][Default]{Definition}

Abbreviations III

\newcommand{\Studium}[1][Economics]{Major: #1}
\Studium from ... to \\
\Studium[Computer Science] from ... to \\
\Studium[Engineering] from ... to \\
Major: Economics from ... to
Major: Computer Science from ... to
Major: Engineering from ... to

Changing Commands with \renewcommand

Occasionally, it's necessary to change the properties of an existing command. This is done with the command:

\renewcommand{Command}{New Definition}


\newcommand{\City}{The most beautiful city is Cologne!}
\City \\
\renewcommand{\City}{The most beautiful city is Duesseldorf!}
\City \\
The most beautiful city is Cologne!
The most beautiful city is Duesseldorf!

The \renewcommand can be applied not only to custom commands but also to the standard LaTeX commands. For example, the chapter command has been changed here.

Defining Mathematical Operators

Procedure: \DeclareMathOperator{\Name}{Name}

Note: Only in the preamble is possible, meaning before \begin{document}!


Declare \DeclareMathOperator{\Det}{Det}

Contact   Privacy Policy   disclosures

accept decline

This website uses cookies and pixel tags to ensure you get the best experience on our website. By using this website, you consent to the use of cookies.learn more about cookies see also our privacy policy