0

Same spirit as this question, resize plot for different size, but for the code chunks generated by rmarkdown files. So...

Antecedent 1: A static hugo page generated by the blogdown R package.

Antecedent 2: A blog post created from rmarkdown document with R code chunks.

Question: Some way to resize the code chunk of R code iwhen I open the page for example from a mobile phone?

Cristóbal Alcázar
  • 1,153
  • 14
  • 26
  • Which `Hugo` theme do you use? I understand from your question that you may use a non-responsive theme. You might search a responsive `Hugo` theme. – RLesur Feb 15 '18 at 22:47
  • Hugo Goa Theme. I try to improve the readibility of the code output from the code chunks https://alkzar.cl – Cristóbal Alcázar Feb 16 '18 at 00:51
  • I did some tests and I have no trouble of code chunks sizing with different mobile sizes (`Hugo Goa` is based on `bootstrap`). Could you add some precisions about your goal (font size, color, background color,...)? – RLesur Feb 16 '18 at 18:27
  • My goal is to avoid that columns of a dataframe print output stacked over others (that don't depend on the screen size). The other point, if you know, why only some functions are highlighted in the code chunk? For example in this [post](https://alkzar.cl/blog/a-data-wrangling-case-with-r/), in the first code, `library()` is highlight but `read_excel()` don't. – Cristóbal Alcázar Feb 16 '18 at 18:40
  • For output width, see [here](https://stackoverflow.com/questions/15385696/how-to-adjust-the-output-width-of-rstudio-markdown-output-to-html). For the other point, `highlight.js` uses [these highlighting rules for `R` language](https://github.com/isagalaev/highlight.js/blob/master/src/languages/r.js). You can customise these rules following [the documentation](http://highlightjs.readthedocs.io/en/latest/index.html). – RLesur Feb 17 '18 at 10:12

0 Answers0