How to increase line spacing in the editor?

rmarkdown
rstudio

#1

Hi,

I am a researcher and use RMarkdown files to analyze my data and write manuscripts all in one reproducible file (which is absolutely great!). However, I wonder if there is a way to increase line spacing in my Rmarkdown documents (in RStudio's editor window, not the knitted document)? This would help me (re-)reading and writing text a lot! Preferably, it would be nice to have increased line spacing in RMarkdown text but unchanged lines spacing inside the code chunks.
I am aware that you can change the appearance of the IDE by modifying the underlying CSS file (e.g., according to this tutorial). However, I was not able to identify the CSS selector that allows to modify line spacing. Any help would highly appreciated.


#2

I don't know if this will help directly, but here's the repository with all the built-in themes for the Ace editor (what RStudio uses under the hood): https://github.com/ajaxorg/ace/tree/master/lib/ace/theme Might be a better starting point for making a new theme of your own? Many of these were converted from .tmtheme files.

Playing around with the Ace "kitchen sink" demo with the Markdown sample text, I can change the line-height everywhere by setting line-height on the overall .ace-themename class, but I couldn't immediately see a simple way to change it back to something smaller for code chunks.


#3

Thank you very much for pointing out the Ace editor! I'll give it a try... However, it looks like my ultimate goal (different line spacing for different types of Rmarkdown elements, i.e. code vs. markdown) is not that easy to achieve (especially given my limited CSS skills). I wonder if this could be a possible feature request for RStudio. However, I don't know if this is a relevant issue and if others would appreciate such a feature.


#4

I'm not directly answering your question, but something I recently found helped me with reading my Rmarkdown was clicking the 'show whitespace characters` box in under Tools > Global Options > Code > Display

I particularly found this helpful when using the bookdown package where leaving whitespace at the end of a figure reference means it doesn't build properly, but I've left it on all the time as I find it guides my eye and makes it easier to see what's going on.