R: how to center output in an R markdown

I know that I can set fig.align = 'center' if I want to focus my figure. But what if I want to focus my work on a PDF document?

+7
source share
2 answers

The following code worked for me.

 \center Centered Text \center 

And, if you need to put it in bold , in my case you can use the underscore (two at the beginning, two at the end):

 \center __Centered Text__ \center 
+8
source

Hope it's not too late to add my answer.

You can use HTML tags in Rstudio Markdown docs.

To center the text you just need to:

 <center> TEXT TO CENTER </center> 

This works for me when knitting Rstudio Markdowns.

0
source

Source: https://habr.com/ru/post/1259255/


All Articles