harrelfe / Hmisc

Harrell Miscellaneous
Other
210 stars 81 forks source link

center not working #24

Closed BrainyGuy closed 9 years ago

BrainyGuy commented 9 years ago

I cannot get the center option to work. The problem is similar to what was mentioned here:

http://stackoverflow.com/questions/16413799/tables-created-from-latex-from-the-hmisc-package-are-horisontally-left-aligned

As a workaround, I am enclosing the entire knitr fragment in a centering LaTeX directive:

{\centering <<summary_table, results='asis', echo=FALSE>>= Hmisc::latex( tabulr((Date=factor(sumDate)) ~ Heading()identity (Heading("Visitors")_visitors + Heading("Sessions")_sessions + Heading("Page Views")*pageViews), data=day_sum_40days)) @ }

harrelfe commented 9 years ago

I'm about to respond on stackoverflow.

On 04/21/2015 05:12 PM, BrainyGuy wrote:

I cannot get the center option to work. The problem is similar to what was mentioned here:

http://stackoverflow.com/questions/16413799/tables-created-from-latex-from-the-hmisc-package-are-horisontally-left-aligned

As a workaround, I am enclosing the entire knitr fragment in a centering LaTeX directive:

{\centering <>= Hmisc::latex( tabulr((Date=factor(sumDate)) ~ Heading()/identity/ (Heading("Visitors")/visitors + Heading("Sessions")/sessions + Heading("Page Views")*pageViews), data=day_sum_40days)) @ }

— Reply to this email directly or view it on GitHub https://github.com/harrelfe/Hmisc/issues/24.


Frank E Harrell Jr Professor and Chairman School of Medicine

Department of *Biostatistics*   *Vanderbilt University*