Bug 15779 - Sweave's \Sexpr misses expressions with backslashes
Sweave's \Sexpr misses expressions with backslashes
 Status: CLOSED FIXED None R Unclassified Misc (show other bugs) R 3.1.0 Other Other P5 enhancement R-core

 Reported: 2014-04-25 12:01 UTC by Duncan Murdoch 2014-04-26 14:01 UTC (History) 0 users

Attachments

 Note You need to log in before you can comment on or make changes to this bug.
 Duncan Murdoch 2014-04-25 12:01:33 UTC The regexp code that looks for \Sexpr in Sweave documents incorrectly sees a backslash as a terminator of the regular expression, so it fails to recognize expressions containing them. For example, the .Rnw file \documentclass{article} \usepackage{Sweave} \begin{document} This has a backslash: \Sexpr{"\\LaTeX"}. \end{document} passes through Sweave() unchanged, rather than being processed to embed the \LaTeX macro in the text. Duncan Murdoch 2014-04-26 14:01:12 UTC I have fixed this in R-devel and soon will in R-patched. At the same time, I've improved the error messages: earlier this fix caused the build of the Sweave.Rnw vignette to fail, but the failure message didn't make it clear that it was a bug in that vignette that was being revealed. (That bug has also been fixed.)