LaTeX forum ⇒ 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).
User avatar
Cham
Posts: 926
Joined: Sat Apr 02, 2011 4:06 pm

Why is this simple macro gives an halting problem?

Postby Cham » Wed Nov 27, 2019 11:24 pm

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?

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

Postby Stefan Kottwitz » Thu Nov 28, 2019 2:04 am

Hi Cham,

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

Stefan
Site admin

User avatar
Cham
Posts: 926
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Thu Nov 28, 2019 4:36 am

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: 4098
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Nov 28, 2019 7:29 am

No minimal working example?
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. ! 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.


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 7 guests