Tag Info

New answers tagged

2

You can temporarily redefine \raggedright to do nothing. The output may not look pretty: .Rnw file (process with knitr, then LaTeX): \documentclass[a4paper]{article} \usepackage[pass]{geometry} \begin{document} \let\oldraggedright\raggedright \renewcommand\raggedright{} <<echo=FALSE,results="asis">>= utils::toLatex(sessionInfo()) @ ...


4

You could use the listings package: Code \documentclass{book} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{lmodern}% better font than default \usepackage{tgcursor}% tt font with bold/italic styles \usepackage{listings} \lstset{ language=R, basicstyle=\ttfamily } \begin{document} \appendix \chapter{Some R code} Some code ...


1

Can't run your code but from what I read in your post this should help: In R: w <- latex( sumstats, file = "sumstats.tex" ) and then in LaTeX: \input{sumstats} assuming that this all takes place in the same folder. [edited] As stated in the help file: To prevent the latex file from being displayed store the result of ‘latex’ in an object, e.g. ...


1

As per this page on the R Markdown website, you can add whatever you want to the preamble via the in-header option in the YAML header; e.g., ---- title: "Titre" date: Fecha output: pdf_document: includes: in_header: mystyles.sty ---- In mystyles.sty, located in the same directory as the .Rmd, you could have a whole list of ...


1

There is support for specifying certain options in the YAML header; a relevant page on the R Markdown website lists the following options: lang: Document language fontsize: Font size documentclass: Document class classoption: Options for \documentclass geometry: Options for \geometry mainfont, sansfont, monofont, mathfont: For Xe(La)TeX and Lua(La)TeX ...



Top 50 recent answers are included