Last modified: 25.08.2008

Deutsche Version

List of sometimes useful snippets

XY

Sometimes you need to create something like 2x and don't want or can't change into a math environment. In this cases this snippets, inside the header of your document can be very helpful.

\newcommand{\up}[1]{\ensuremath{^\textrm{\scriptsize#1}}}

To call it, you just use 2\up{nd} to created a nice 2nd

Prevent from linebreaking inside a word or phrase

To prevent line breakings inside a word or phrase you can use a mbox.

To don't invent the wheel twice, just add

\newcommand*{\ac}[1]{\mbox{#1}}

to the header of your file. Inside your document you are able to call it by typing \ac{text} where text is the part that shouldn't disturbed by a linebreak.