Skip Navigation.

LaTeX: Simple Replacement Macros

In its simplest form, a LaTeX macro can be a simple text replacement of a phrase to avoid misspelling, or simply to avoid having to constantly type the same phrase. For example, putting this command in your preamble would make it so you could call the entire long phrase anytime in your document by simply using the \ef command:
\newcommand{\ef}{European Foundation for the Improvement of Living and Working Conditions}

To do this, the \newcommand{\ef}{European Foundation for the Improvement of Living and Working Conditions} command defines \ef to mean the entire phrase. For these, you will need to remeber to leave a space between the command in your document (\ef) and the next word so that LaTeX doesn't try to read the next word as part of a command. This also means that in order to have a space after the words that the command calls, you will need to force a space. This is done by putting a back slash at the end of the command like this \ef\.

Back