Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to strike out inside LaTeX equations? [closed]

Please see the snippet below and tell me how can I achieve the same strike-out effect as in the main text. I am using the version of LaTeX from the latest Ubuntu repositories.

\documentclass{article} \usepackage{ulem} \begin{document} The sout tag works perfect in the \sout{main text area} but not inside the equations. $$ list = [1, \sout{2}, 3, \sout{4}, 5, \sout{6}, 7, \sout{8}, 9, \sout{10}] $$ Any clue? \end{document} 

Here is LaTeX output

like image 341
Aamir Avatar asked Apr 18 '10 21:04

Aamir


People also ask

How do you strikethrough in LaTeX?

Luckily, it's very easy to cross something out in a LaTeX expression. Simply use the \cancel{x} command, where x is whatever you want to cross out.

How do you break an equation in LaTeX?

Insert a double backslash to set a point for the equation to be broken. The first part will be aligned to the left and the second part will be displayed in the next line and aligned to the right.

How do you write an inline equation in LaTeX?

In the LaTeX block, you can insert an inline formula by typing the equation inside $.. $ . For example, type: An inline equation is $e=mc^2$.


1 Answers

It looks like the \sout doesn't work inside a math env. You can try doing something like this, which works:

\documentclass{article} \usepackage{ulem} \begin{document} The sout tag works perfect in the \sout{main text area} but not inside the equations.  $list = $[1, \sout{2}, 3, \sout{4}, 5, \sout{6}, 7, \sout{8}, 9, \sout{10}$]$  Any clue? \end{document} 
like image 194
Macarse Avatar answered Sep 22 '22 21:09

Macarse