Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \usepackage{xcolor}
- \makeatletter
- \newcommand{\linethrough}{\mathpalette\@thickbar}
- \newcommand{\@thickbar}[2]{%
- \textcolor{red}{
- {\mkern0mu\vbox{
- \sbox\z@{$#1\textcolor{black}{#2}\mkern-1.5mu$}%
- \dimen@=\dimexpr\ht\tw@-\ht\z@+2\p@\relax % The +2 represents the vertical shift of the line.
- \hrule\@height0.5\p@ % The 0.5 represent the thickness on the line.
- \vskip\dimen@
- \box\z@}}#1}
- }
- \makeatother
- \newcommand{\mathstrike}[1]{\ensuremath{\linethrough{#1}}}
- \begin{document}
- \mathstrike{f(x) = x^2},\qquad \mathstrike{c_0}, \qquad \mathstrike{f(x) = x^2 + c_0}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement