How can I define new commands in LaTeX?
If you find yourself needing to use a particular bit of text (with or without LaTeX commands) in your document multiple times, it may be convenient for you to define it as a command, using \newcommand. For example, if you were tired of typing the commands for a degree symbol, you might do
and then in your text, you could say
and LaTeX would automatically substitute "$^\circ " to make a degree symbol where you had typed \dg.
Next, you can create commands which include arguments, by including a field for the number of arguments in your \newcommand line, and putting the arguments themselves in as #1, #2, and so on. For example, if you were creating a description list and you wanted each of them to have the item itself to be in bold and the rest to be in italics, like so
then you could use a \newcommand for that: