Use 'knitr' built-in option to determine, if code is running in a 'knitr'-based environment.