Closed s-u closed 8 months ago
I've adopted the second solution you proposed. Thanks!
Thanks for your prompt reply! Much appreciated! I can confirm that this fixes the issue (LaTeX will correctly fail with "runaway argument" for the above example).
Sorry, I just discovered that the above fix would break some reverse dependencies. I'll investigate and may consider switching to the first solution (but one tricky thing is to avoid escaping %
that has already been escaped by the author).
What about gsub("(?<!\\\\)%", "\\\\%", "cap 10% but not 90\\%", perl=TRUE)
?
Yes, that's what I was thinking.
Just committed the new fix. Thanks!
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
Reproducible and illustrative example (
test.Rmd
):\begin{figure} \includegraphics[width=1\linewidth]{test_files/figure-latex/unnamed-chunk-1-1} \caption{10%}\label{fig:unnamed-chunk-1} \end{figure}
\textbackslash begin{figure} \includegraphics[width=1\linewidth]{test_files/figure-latex/unnamed-chunk-1-1} \textbackslash caption{10\%}\label{fig:unnamed-chunk-1} \textbackslash end{figure}