print-function-with-highlighting example broken?

23 views
Skip to first unread message

Ben Bolker

unread,
Oct 16, 2012, 4:34:39 PM10/16/12
to kn...@googlegroups.com
I'm sorry not to have any more useful diagnosis, but some great code that Yihui wrote a while back to embed external functions in a chunk with code highlighting doesn't work for me any more ...

https://gist.github.com/1805862

runs through knit just fine, but when trying to (pdf)latex it I get:

! Undefined control sequence.
<argument> \hlnormalsizeboxlessthan
                                   
l.97 ...nement{\usebox{\hlnormalsizeboxlessthan}-}
                                                  {\ }\hlkeyword{function}\h...


Any ideas ... ?

R-unstable (r60013), other attached packages:
[1] formatR_0.6     highlight_0.3.2 parser_0.0-16   Rcpp_0.9.15   
[5] codetools_0.2-8 knitr_0.8     


Yihui Xie

unread,
Oct 16, 2012, 4:39:13 PM10/16/12
to Ben Bolker, kn...@googlegroups.com
That is true. I think the fix is opts_knit$set(use.highlight = TRUE),
but after R 2.15.2 is released (later this month), I think everything
will work again. The problem is that example relies on the highlight
package, which will no longer be necessary after R 2.15.2.

Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA

Ben Bolker

unread,
Oct 16, 2012, 6:19:55 PM10/16/12
to Yihui Xie, kn...@googlegroups.com
On 12-10-16 04:39 PM, Yihui Xie wrote:
> That is true. I think the fix is opts_knit$set(use.highlight = TRUE),
> but after R 2.15.2 is released (later this month), I think everything
> will work again. The problem is that example relies on the highlight
> package, which will no longer be necessary after R 2.15.2.
>
> Regards,
> Yihui

Thanks, works perfectly.

Ben
Reply all
Reply to author
Forward
0 new messages