Generaldefine frequently used phrases

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Erik79
Posts: 2
Joined: Sat Sep 12, 2009 7:52 pm

define frequently used phrases

Post by Erik79 »

Hi all, new guy here.
I want to avoid typing frequently used long words and phrases, and use
abbreviations instead. I tried with

\def\CLT{$\mbox{central limit theorem}$}

and

\newcommand{\CLT}{central limit theorem}

and a few variations but the problem is that LaTeX doesn't leave
a space at the end of the word (and if I define the space within
the command, then I have a problem with puntcuation after the word).
In addition there are problems with line ending.

What's the solution? Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

define frequently used phrases

Post by gmedina »

Hi,

load the xspace package and use something like

Code: Select all

\newcommand{\CLT}{central limit theorem\xspace}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Erik79
Posts: 2
Joined: Sat Sep 12, 2009 7:52 pm

Re: define frequently used phrases

Post by Erik79 »

Thanks, that worked!
Post Reply