TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been using LaTeX for my math homework and notes for about 6 months now. However, I'm really quite new to anything that uses the real power of TeX.

When I used to do my homework by hand, I always meticulously crossed my z's and 7's, like this:

and likewise for my z's.

Is there a way to make LaTeX automatically cross my 7's and z's (and capital Z's, for that matter) within math mode? I'd like to leave the 7's and z's as normal within body text. ALso, I would prefer not to use a new command; I want a crossed 7 whenever I type 7 as normal, and likewise for Z/z.

My first idea for a solution would be to use the "negative space" command somewhat like this:


However, I'm not sure this is the most elegant solution, and I still don't know how to make LaTeX do it automatically whenever I just type something like

$3+4 = 7.$

Thanks for any help anyone can offer!

share|improve this question
You should look for a math-font which has these digits in it. – Martin Scharrer Nov 11 '11 at 18:16
For a yet better confusion of your readers use the pretty cursive Z instead of the normal one. – Andrey Vihrov Nov 11 '11 at 20:36
It makes sense for handwriting to avoid ambiguities, but for typeset math it is not a good idea. – starblue Nov 11 '11 at 21:05
up vote 16 down vote accepted

Also I strongly recommend choosing a math font with such digits, or design one. For learning about TeX, and for using in math homework, I don't see a big problem, however consider not doing such things with possible side effects in an important document.

To answer your question, you could do it by making 7 and Z active characters in math mode, very similar to the answer of in Can (pdf)LaTeX recognize text strings and replace (expand) them.

The 7 crossed in only math mode: $3 + 4 = 7$

crossed symbol

share|improve this answer

The simplest answer is: do not do this.

A longer answer: crossed or uncrossed 7's and z's are features of a font. A font designer spent hours and hours making his or her font aestetically consistent, readable and pleasant. When you make this change, you basically overturn his or her decision; in most cases it looks just awful.

share|improve this answer
Thank you for your commentary, Boris, I will certainly take it into consideration. – Barf Nov 11 '11 at 18:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.