Anastasius
Anastasius

Reputation: 31

Can knitr respect message(..., appendLF = FALSE) calls?

Is there any way to have knitr respect messages that don't end with line breaks? I haven't found a hook that governs this behavior, maybe I just missed it.

\documentclass{article}

\begin{document}

<<>>=
do_stuff <- function() {
  message("Doing some stuff...", appendLF = FALSE)
  message("done.")  
}
do_stuff()
@

\end{document}

The result includes a line break between the first and second messages, but if you run it in R there is no such break.

Upvotes: 3

Views: 87

Answers (1)

Yihui Xie
Yihui Xie

Reputation: 30124

This is a bug in knitr, and I just fixed it in the development version 1.16.2. You can install it via devtools::install_github('yihui/knitr').

Upvotes: 2

Related Questions