I would like to ammend some .tex files from within R. I read the file with readLines() but I cannot replace the following text.
tex <- "$\\times$"
new_tex <- gsub("$\\times$", "\\ $\\times$", tex)
new_tex
It seems that it cannot find the $\\times$
But even if it does, is it possible to write \ without escaping them?
Thank you in advance!