Skip to content

Commit

Permalink
replace " with "{} to make sure " does not induce an umlaut: http://s…
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 8, 2013
1 parent 87953f6 commit e9a5e85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@

- removed the global option `KNITR_PROGRESS`, which was introduced to suppress the progress bar, but now we have got `knit(..., quiet = TRUE)`, so this option is redundant

## BUG FIXES

- in LaTeX output, the double quotes `"` in the messages, errors, and warnings are replaced by `"{}` because they might cause trouble to babel: http://stackoverflow.com/q/18125539/559676 (thanks, Thierry)

# CHANGES IN knitr VERSION 1.3

## NEW FEATURES
Expand Down
6 changes: 4 additions & 2 deletions R/hooks-latex.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ hook_plot_tex = function(x, options) {
.color.block = function(color1 = '', color2 = '') {
function(x, options) {
x = gsub('\n*$', '', x)
sprintf('\n\n{\\ttfamily\\noindent%s%s%s}',
color1, escape_latex(x, newlines = TRUE, spaces = TRUE), color2)
x = escape_latex(x, newlines = TRUE, spaces = TRUE)
# babel might have problems with "; see http://stackoverflow.com/q/18125539/559676
x = gsub('"', '"{}', x)
sprintf('\n\n{\\ttfamily\\noindent%s%s%s}', color1, x, color2)
}
}

Expand Down

0 comments on commit e9a5e85

Please sign in to comment.