New commands
To add your own commands, use the\newcommand{name}[num]{definition}
\newcommand{\wbal}{The Wikibook about \LaTeX}
This is ‘‘\wbal'' \ldots{} ‘‘\wbal''
=> This is “The Wikibook about LaTeX” … “The Wikibook about LaTeX”
The next example illustrates how to define a new command that takes one argument. The #1 tag gets replaced by the argument you specify. If you wanted to use more than one argument, use #2 and so on, these arguments are added in an extra set of brackets.
\newcommand{\wbalsup}[1] {This is the Wikibook about LaTeX supported by #1} \newcommand{\wbalTwo}[2] {This is the Wikibook about LaTeX supported by #1 #2} % in the document body: \begin{itemize} \item \wbalsup{Wikimedia} \item \wbalsup{lots of users!} \item \wbalTwo{John}{Doe} \end{itemize}
But there a lot of caveats :-
http://www.uz.ac.zw/science/maths/latex/ltx-18.html |
Comments