TeX coding examples
For a complete listing of TeX codes, see the TeX cookbook. If you use the cookbook, be aware of the following:
- Do not include $ symbols shown in the cookbook. For example, the cookbook shows, $\acute x$. In Mastering, enter \acute x instead.
- Mastering supports most codes shown, but not all of them.
- The cookbook is created and maintained by a third party, not by Pearson.
For this symbol or notation . . . | Code TeX this way... |
---|---|
Percent symbol (%) |
<tex>\%</tex> |
Subtraction sign (–) | <tex>-</tex> |
Multiplication |
\cdot or \times Use \cdot for multiplication between variables For example:
If explicit multiplication needs to be emphasized. Do not use \times. Use × (\times in TeX) for scientific notation, dimensional analysis, and equations involving words. |
Regular space | ~ or \; |
Lowercase Greek letter |
\lower_Greek_letter For example:
|
Uppercase Greek letter |
\upper_Greek_letter For example:
|
{x \over y} -OR- {\frac {x}{y}} |
|
Roman font |
\rm To combine several fonts, use {\rm text} to specify Roman |
Italic font |
\it To combine several fonts, use {\it text} to specify italics |
Vector arrow over xy
|
\vec {xy} |
Chemistry reaction arrow
|
\rightarrow |
Chemistry equilibrium arrow
|
\rightleftharpoons |
Infinity symbol
|
\infty |
Centered ellipses (math mode) | \cdots |
Units of measure |
Make sure there is a space between the number and the unit
|
Math equations |
Use \matrix to set multiple line equations. Here is an example:
The code for this is:
|
Chemical equations |
The use of end punctuation will depend on context. In general it is not used. All display chemical equations should be in its own paragraph with <p @align = center> Set multi-line equations in TeX with the \matrix environment. Do not use a table in which every cell is occupied with a separate term or operator. Here is an example: The code for this is:
|
Elements and other chemical symbols |
This includes single elements such as H, Ne, etc. For example, He would be <tex> {\rm He} </tex>
|
Note: You can also use ^\circ for degrees.