How to Write Strikethrough Text in LaTeX
In LaTeX, you can write strikethrough text using the \sout command from the ulem package.
The following examples show how to write strikethrough text in LaTeX.
How to Write Strikethrough Text in Text
We can use the \sout command to write strikethrough text in LaTeX document for text.
Suppose we want to write strikethrough text in the text.
We can use the following LaTeX code to do so:
\documentclass{article}
\usepackage{ulem}
\begin{document}
This is an example of using the \sout{strikethrough} text with the \texttt{\textbackslash sout} command.
\end{document}
Output: 👇️

In this example, we use the \sout command to display the strikethrough text in the document.
How to Write Strikethrough Text in Mathematical Expressions
For mathematical expressions, we can use the \cancel command from the cancel package to ensure proper formatting.
Suppose we would like to write mathematical expressions that contain strikethrough text.
We can use the following LaTeX code to do so:
\documentclass{article}
\usepackage{cancel}
\begin{document}
An inline mathematical expression: \( \cancel{a + b} \).
A displayed mathematical expression:
\[
\cancel{a + b}
\]
\end{document}
Output: 👇️

In this example, we use the \cancel command to denote strikethrough text in both inline and displayed mathematical expressions.
Conclusion
We can use the \sout command from the ulem package for text, and the \cancel command from the cancel package for mathematical expressions.