1

I am using Soul to mark the change to my manuscript in Overleaf, but it won't work for equations, like

\documentclass[12pt]{article}
\usepackage{soul}
\setstcolor{red}

\begin{document} \begin{equation} \st{E = mc^3} E=mc^2
\end{equation} \end{document}

what I want to see is an overstrike on E = mc^3, followed by E = mc^2

Thanks

  • Let me guess: they are looking for something to mark revisions on a document. – Rmano Jul 18 '23 at 15:58
  • @Rmano yes, you are right – majordoctor Jul 18 '23 at 16:07
  • 3
    @majordoctor: Please update your post with a more direct description of what you want; not just a "I've tried this and it doesn't work" without much context. It'll remove the guesswork from the audience. Can you do that? – Werner Jul 18 '23 at 16:26
  • @Werner sorry, I made some changes, please take a look – majordoctor Jul 18 '23 at 16:38
  • 2
    Welcome. // Can you please post code, which compiles, once we copied? It‘s not much, that‘s missing, but it‘s annoying to guess where you can easily EDIT … Thank you. – MS-SPO Jul 18 '23 at 17:48
  • How many people work on the document? – MS-SPO Jul 18 '23 at 17:54
  • @MS-SPO, I post a simple example from my manuscript, and it should be compiled. – majordoctor Jul 18 '23 at 18:31
  • Thank you ... but did you try it? Still important lines are missing, unless you use a quite different Latex environment/editor ... What I expect is code starting with \documentclass{ and ending with \end{document}. – MS-SPO Jul 18 '23 at 18:34
  • 1
    @MS-SPO, I added. I tried, but the error is missing $$ even in equation mode – majordoctor Jul 18 '23 at 18:40

1 Answers1

2

Use the ulem and xcolor packages and define a new command as described here.

MWE:

\documentclass{article}
\usepackage{ulem}
\usepackage{xcolor}

\makeatletter \newcommand\rst{\bgroup\markoverwith{\textcolor{red}{\rule[0.6ex]{10pt}{1pt}}}\ULon} \makeatother

\begin{document}

\rst{Red line through this} but not through this.

\rst{$E=mc^3$} $E=mc^2$

\end{document}

Don't forget to wrap your equations in math mode.

enter image description here

  • Sorry, what are wrap equations? I am encountering the error: Missing } inserted. LaTeX Error: Bad math environment delimiter. Missing number, treated as zero. Missing $ inserted. Extra }, or forgotten $. Illegal unit of measure (pt inserted). Missing $ inserted. – majordoctor Jul 18 '23 at 21:48
  • @majordoctor Your equations should have the math delimiters on either side. So "$E=mc^3$" not "E=mc^3" – Kenneth Odle Jul 19 '23 at 17:07