Math & ScienceWhy is this simple macro gives an halting problem?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Why is this simple macro gives an halting problem?

Post by Cham »

I just defined this simple macro:

\newcommand*{\dp}{\hspace{0.5pt}}

Then, using \dp in mathmode gives an halting error:
Missing number, treated as zero.
and
Illegal unit of measure (pt inserted).
So what is wrong with calling my macro "dp" ? Three letters keyword works: "dpt", but why two letters gives a problem?

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

Why is this simple macro gives an halting problem?

Post by Stefan Kottwitz »

Hi Cham,

I guess that's because \dp is a TeX command for the depth of a box.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Why is this simple macro gives an halting problem?

Post by Cham »

Hmm, I searched for \dp and found nothing on the net about this command.

I replaced it with \ssp and \tsp (for small space, and tiny space), so no harm!

Thanks Stefan.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Why is this simple macro gives an halting problem?

Post by Johannes_B »

No minimal working example?

Code: Select all

! LaTeX Error: Command \dp already defined.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply