At the time, I was working on customizing CSS classes of the code chunks in my blog after being inspired by the impeccable styling of Brodie Gaslam’s blog.
What I like most are the subtle visual clues that link code inputs and outputs by keeping both source and output inside the same box.
I have a plan to do something similar on this blog using custom source and output classes via the
class.source chunk options.
But I quickly discovered that the
class.output class is only applied to standard code output, and not the “side effect” chunk outputs, such as messages, warnings and errors.
I opened an issue in knitr and, amazingly, three days later my wishes were granted:
You can now use the chunk options
class.error to customize the CSS class of outputs of each type.