fork download
  1. texfile <- "\\caption[SOME WORDS]"
  2. ## -> \caption[\textit{SOME WORDS}]
  3. texfile <-gsub('(\\\\caption\\[)([^][]*)]','\\1\\\\textit{\\2}]', texfile)
  4. cat(texfile)
Success #stdin #stdout 0.26s 38472KB
stdin
Standard input is empty
stdout
\caption[\textit{SOME WORDS}]