Monday, 15 July 2013

r - Custom CSS for highlighting in knitr -



r - Custom CSS for highlighting in knitr -

related:

code styling black , white documents

i want utilize simple custom css code highlighting in knitted .rnw/.tex/.pdf documents. select few rules seem implemented upon knitting.

for moment focusing on colorless highlighting, consequently manipulate rules such text-decoration, font-weight, font-style , - grays - color; cf. theme "print" here. but, simplest examples, can few implemented, e.g., color , font-style; specifically, i've found font-weight nothing, nor text-decoration. e.g.:

.background { color:#f6f6f6; } ... .kwc {/* e.g., parameters */ font-weight:100; color:#8c8c8c; } .kwd {/* e.g., methods */ text-decoration:underline; } ... .com {/* comments */ font-style:italic; } ...

(the sets of 3 dots indicate css file contains more illustration above.)

with above in style sheet, in output pdf code block background , parameters colored accordingly , comments italicized, parameters not have font weight of 100 nor methods underlined.

is there sort of limitation rules custom knitr themes may use? else may problem here?

n.b.:

mac 10.9.3 knitr v1.6.3.

i have css in same directory rnw document , pass knitr in chunk @ origin of document via:

theme <- knit_theme$get('./my_css.css') knit_theme$set(theme)

css r latex knitr rnw

No comments:

Post a Comment