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 am writing an article in LaTeX 2e. Part of the article describes the Sieve of Eratosthenes, and I want to show examples of how multiples of a prime are removed from the sieve by showing them in a strikethrough font. How do I create a strikethrough font in LaTeX 2e?

share|improve this question

migrated from stackoverflow.com Jul 21 '11 at 14:38

This question came from our site for professional and enthusiast programmers.

Very much related: Crossing out sentences – Martin Scharrer Jul 26 '11 at 21:23
For showing the Sieve of Eratosthenes in tikz this might be useful. – Peter Grill Jun 4 '12 at 20:05
up vote 149 down vote accepted

I'm not quite sure what you mean with creating a strikethrough font. However, for striking through text horizontally see:


So with the ulem package this becomes:

\sout{Hello World}

With the soul package this is:

\st{Hellow world}

enter image description here

The ulem package seems more up to date so I would use that.

share|improve this answer
Soul is not available on my machine. I tried ulem. It worked, producing strikethrough text, but also converted emphasized text from italic to underline, which I do not want. So I added a \normalem declaration, and now everything works properly. Thanks! – user448810 Jul 21 '11 at 12:57
Just to clarify on the above comment- using the command "\usepackage[normalem]{ulem}" will prevent \emph from being changed, as stated in Section 1 of the documentation (mirrors.med.harvard.edu/ctan/macros/latex/contrib/ulem/ulem.pdf) – obfuscation Feb 11 '13 at 13:29
Strangely enough soul seems to have trouble with non-ASCII characters (for instance UTF-8 French). – tiktak Jan 9 '14 at 20:41
The ulem package has the highly undesirable side-effect of redefining \emph{} to produce underlined text, rather than italic. (I guess "ulem" stands for something like "underlined emph".) – David Richerby Oct 21 '14 at 12:21
Thanks for the clarification, @obfuscation! – user1717828 Feb 9 '15 at 16:23

There is also the cancel package:


The solution to Diagonal strikeout starting too low and ending too high is another option to consider.

share|improve this answer
Is it possible to do strikeout without importing a package? – tommy.carstensen Mar 19 '15 at 16:38
@tommy.carstensen: Well a package is just a set of macros, so if you define the necessary macros then you don't need to import the complete package. I'd suggest you post a separate question as some others who are more familiar with Plain TeX can probably do a much better job. – Peter Grill Apr 6 '15 at 1:36

This is for within an equation (I got it off of another forum) and requires amsmath and ulem to be active. The strike is quite long, so using it next to an arrow is troublesome.

share|improve this answer
And to make it work properly in math environment, use \text{\sout{\ensuremath{...}}}, which may be what you meant by $TEXT$. Reference. – Rubens Oct 28 '14 at 6:45
This was very helpful. It works on my Texmaker. Thanks. Do you know how to make such a thing work for Math Stack Exchange? – RestlessC0bra Oct 9 '15 at 10:09

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.