How to place an xtable on the left side of the page

Question: How to place an xtable on the left side of the page or how to disable centering around the world.

I am trying to figure out how to place an xtable object on the left side. I have a * .Rmd file, and all this relates to the corresponding r fragment.

require(xtable) df <- data.frame(x=seq(1,10,1),y=rnorm(10)) Xtab <- xtable(df, digits=0, caption="\\textbf{MINIMAL/IDEAL}", floating=FALSE, latex.environments = c("left")) print(Xtab, size = "small", include.colnames=FALSE) 

I included the following after reading various sources (print.xtable; xtable manual, etc.)

1) floating=FALSE 2) latex.environments = c("left")

I searched for SO and used some hints, but all failed.

0
source share
1 answer

It seems to matter if you xtable() or print(xtable()) parameter. The following snippet creates a table according to your data, which are aligned to the left of the page in the pdf file.

 ```{r, results='asis',echo=FALSE} library(xtable) df <- data.frame(x=seq(1, 10, 1),y = rnorm(10)) print(xtable(df,digits=0, caption="\\textbf{MINIMAL/IDEAL}"), include.colnames=FALSE, size = "small", comment=FALSE, latex.environments="flushleft") ``` 

enter image description here

However, as you can see, the signature remains in the center of the page.

+2
source

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


All Articles