How to change line-height of code area of rmarkdown?

I want to change the line-height of the rmarkdown code area, but I can't find it in the options, so I want to do it with a custom style (.rsTheme).However, I found that changing the CSS in the code area did not change the line height.How can I change the line-height of a code area?

note: I have already changed the display of the code area through a custom style.

Do you mean you've already set the line-height property for the targeted area with something to the effect of the code below?

line-height: 1em;

If it's all R code, you could use the selector pre.r to override what's set for pre alone.

Do you mean add the css style into my theme file(.rstheme) like this?

.pre.r{
  line-height: 1em !important;
}

I try it, but it's doesn't work.

I found another css style, it can solve it.

.ace_editor, .rstudio-themes-flat.ace_editor_theme .profvis-flamegraph, .rstudio-themes-flat.ace_editor_theme, .rstudio-themes-flat .ace_editor_theme {

    line-height: 1.7 !important;

    letter-spacing: 0.5px !important;

}

Oh. Sorry, I thought you were talking about output from RMarkdown, not inside of the editor. But, yeah, using a specific selector inside the IDE will work as well. I'm gonna mark your self reply as a solution, since you seem to have solved your own problem :slightly_smiling_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.