0

(textstudio) How can I get rid of all the \vspace{}* commands from my document automatically, without having to remove one by one ? I was using it in and out of my equations' throughout the whole document but they told me I shouldn't use it.

*Actually it's not all, but only after the introduction chapter of the document, when the equations start to appear.

Thanks in advance and sorry if that's too simple to solve.

  • Do you mean literally \vspace{} or various instances of \vspace{xxx} with different values of xxx? TeXstudio has a find and replace function which allows you to replace all, or all within a selection etc. You can make the Replace bar visible below the Find bar by choosing Searching->Replace from the Edit menu. – Alan Munn Dec 11 '23 at 04:17
  • Well, I'd probably do sed '/\\chapter{Introduction}/,$s/\\vspace{}\*/g' <filename> > <filename2>. Or the equivalent in Kile's find-and-replace. – cfr Dec 11 '23 at 04:21
  • 1
    Welcome on tex.stackexchange.// this seems to be more an editor question than a LaTeX question. With a decent editor, inluding TeXstudio a find&replace using regular expression would be the most obvious solution.// An alternatve would perform a find&replace from \vspace{ to ,\foobar and define the later as \newcommand{\foobar}[1]{}. – Jhor Dec 11 '23 at 04:27
  • 1
    What @cfr said, but \\vspace{[^}]*} instead of \\vspace{}\* (assuming you want to remove all \vspace{xxx}, not all literal \vspace{} which would've been low level TeX errors). – Skillmon Dec 11 '23 at 04:56
  • @Skillmon It wasn't clear to me whether that was why the OP had been told not to use it. On OverLeaf, people tend to just ignore the errors. Otherwise, maybe it should be \\vspace\*{[^}]*} since the * in the original would be literal? – cfr Dec 11 '23 at 05:43
  • 1
    @cfr I take it that the * in the question is denoting a footnote and doesn't mean the starred variant of \vspace. – Skillmon Dec 11 '23 at 06:02
  • @Skillmon Ooh. I missed that completely. Oops. – cfr Dec 12 '23 at 00:15
  • Thank you all for the help ;) – Denner Cássio Dec 15 '23 at 09:48

0 Answers0