Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've searched both online and in the TexBook, but can not find a command or package.

Note, I am pretty new to TeX / LaTeX, but am currently trying to figure out how to do things in Plain TeX.

Edit: Thanks for all the answers, but I realized that my question was ambiguous because I used the word "strikeout" which is commonly associated with the horizontal line. I am actually looking for the diagonal strikeout, like the one here, except for Plain TeX. How to strike through obliquely, e.g. to indicate cancellation?

Also, I am looking for a solution that works in Math mode.

share|improve this question
add comment

3 Answers 3

up vote 10 down vote accepted

Package ulem

Timebandit had written a solution with package ulem. The example was given as LaTeX, but the package also works with plain TeX:

\input ulem.sty

\sout{Hello World}

\bye

Result

Package soul

Another LaTeX package soul can be used with plain TeX:

\input soul.sty

\st{Hello World}

\bye

Result

share|improve this answer
    
Note: the ulem package redefines the \em macro. You may need to fix that if you use it elsewhere in your document. –  Ethan Bolker Jan 14 '13 at 21:53
    
@EthanBolker For the old behaviour of \em the package provides \normalem. –  Heiko Oberdiek Jan 14 '13 at 23:11
add comment

this technique has been used for years for maintenance of the tug bylaws. it's really only good for short phrases, and won't break at the end of a line; also, the spaces between words are "frozen". but if those restrictions fit your application, then it works reliably.

\newbox\TestBox
\def\Remove #1 {\setbox\TestBox=\hbox{#1}%
        \leavevmode\rlap{\vrule height 2.5pt depth-1.75pt width\wd\TestBox}%
        \box\TestBox\ }
\def\0{\Remove}
\def\Replaceby #1{{\bf #1}}
\def\1{\Replaceby}

\0{Remove this text.}

\1{Replace it by this text}.

\bye

enter image description here

share|improve this answer
add comment

If you are using one of the newer Unicode based TeX engines (xetex or luatex) an alternative method would be to use Unicode combining characters to get the strike. The effect then depends on the font you used, I have to say I was a bit disappointed with the result with Arial, but here it is:

enter image description here

\font \tenrm="[Arial]"
\tenrm


O̶h̶ ̶n̶o̶ ̶I̶ ̶d̶i̶d̶ ̶i̶t̶ ̶w̶r̶o̶n̶g̶!̶


\bye
share|improve this answer
add comment

Your Answer

 
discard

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.