# Typesetting Units in LaTeX

Use this macro to tell that you don’t want your units slanted in math mode.

\newcommand{\unit}[1]{\ensuremath{\, \mathrm{#1}}}

## Example

• $m = 5 kg$ will render as “m = 5 kg”.
• $m = 5 \unit{kg}$ will render as “m = 5 kg”.

## “I want more!”

Use the units.sty package if my macro is not enough for you.