latex

Stargazer options: resizebox and label

社会主义新天地 提交于 2019-12-10 11:14:48
问题 Is it possible to incorporate resizebox into stargazer in R? I'm trying to create a table that is too wide to fit, even on landscape perspective. I manually added resizebox{\textwidth}{!} { \begin{tabular} \end{tabular} } to the .tex file, and I like how it looks. However, I'd like for my .Rnw file to be complete, so that I can generate pdf perfectly without additional changes to the .tex file. On a related note, stargazer causes pdflatex to output multiple warnings due to it including \label

How to add a watermark image on rmarkdown?

不想你离开。 提交于 2019-12-10 11:08:57
问题 I'm searching and trying to add a image as watermark to rmarkdown pdf, I'm using the render function to generate the PDFs, and saw the \usepackage{draftwatermark} and this question: Watermark in rmarkdown But they don't help me in adding a image as watermark. --EDIT-- I achieved what I wanted putting this to the header of .Rmd: header-includes: - \usepackage{eso-pic,graphicx,transparent} And placing this in the start of file (before the rest of .Rmd): \AddToShipoutPictureFG{ \put(0,0){%

Convert non-ASCII/UTF-8 characters into LaTeX codes

霸气de小男生 提交于 2019-12-10 10:46:47
问题 We have to convert non-ASCII, UTF-8, or named entity characters into LaTeX codes. Now we are using non-ASCII to Unicode, then Unicode to LaTeX/entity using a Perl script. For example: ó --> \'{o} ó --> \'{o} ó --> \'{o} Is there any direct conversion from non-ASCII, or UTF-8 to LaTeX codes in Perl program/script? 回答1: This is very straightforward using the XML::Entities module to decode the entities, and the LaTeX::Encode module to re-encode them as LaTeX Note that I've explicitly created an

Unable to knit pdf from Rmardown from Rstudio in Windows 10 PC

ぐ巨炮叔叔 提交于 2019-12-10 10:36:33
问题 I created a new Rmd file in the latest R and Rstudio version, and with the complete version of MiKTeX installed. In my windows 10 machine. When I tried to knit it I got the following error ! LaTeX Error: File `fancyvrb.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.34 \newcommand pandoc.exe: Error producing PDF Error: pandoc document conversion failed with error 43 Además: Warning message:

how to align kable and ggplot in one row (side by side) in r markdown?

自古美人都是妖i 提交于 2019-12-10 10:30:01
问题 I am trying to knit an r markdown file to pdf , but I can't align ggplot and kable in one row. I have tried following ways: cat("\twocolumn") kable_styling(position = "float_right") Below is a minimal, reproducible example --- title: "Untitled" output: pdf_document classoption: landscape --- \newpage ```{r cars, echo=FALSE, fig.width=3, fig.height=3, results="asis", message=FALSE} library(dplyr) library(knitr) library(kableExtra) library(ggplot2) dt <- split(mtcars, f = mtcars[, "cyl"]) %>%

How to number floats in LaTeX consistently?

那年仲夏 提交于 2019-12-10 10:14:32
问题 I have a LaTeX document where I'd like the numbering of floats (tables and figures) to be in one numeric sequence from 1 to x rather than two sequences according to their type. I'm not using lists of figures or tables either and do not need to. My documentclass is report and typically my floats have captions like this: \caption{Breakdown of visualisations created.} \label{tab:Visualisation_By_Types} 回答1: The differences between the figure and table environments are very minor -- little more

R Markdown pdf Partially color cell background (data bar)

北城以北 提交于 2019-12-10 09:56:44
问题 Excel has this function called "data bar" that allow conditional formatting based on the cell value with respective length. This function can be done with "formattable" in R using the formatter and color_bar. however, the result of this is a html widget which cannot be shown in pdf. Here's some options I have tried: webshot: takes a screenshot of the widget and then I can import into pdf as an image. Not very efficient also formattable is not the best option as it doesn't allow for nested

how to add grid to table with pander?

守給你的承諾、 提交于 2019-12-10 09:31:21
问题 I am working with R, knitr and pander, and I can't find the option that would allow me to print a grid on a table with pander. I tried : pander(tableToPrint, style='grid') but it doesn't do anything, neither with this option or with 'multiline', 'rmarkdown'... I always get an horizontal line, then the column names, another horizontal line, all my data and an horizontal line. I would like to have an horizontal line between every line. Another option would be to alternate row colors. 回答1: There

ctex+texstudio 安装及使用

我的梦境 提交于 2019-12-10 06:29:41
硕士学位论文需要latex排版,提前折腾了下下载安装。 1. 使用在线latex工具overleaf进行编译预览,编译不通过少包。 原因使用gbk编码,确实ccmap包。 试过解决方案加入utf-8以及Xelatex编译无效。 放弃 2.使用最简单的ctex+texstudio 进行编译运行 下载ctex稳定版 http://www.ctex.org/CTeXDownload 选择其中一项下载大小1.3G 下载texstudio http://texstudio.sourceforge.net/ 3.安装 一路next安装ctex与texstudio 4.配置 将options->configure texstudio->build->defaultCompiler改为pdflatex 5.测试 \documentclass{article} \begin{document} Hello, LaTex. \end{document} -----------------------------------------以下非必须,石油大学计科院模板------------------------------------------------------ 如果看你原始latex模板,编码,由于我的是gbk编码 所以设置options->configure texstudio-

Vim script to compile TeX source and launch PDF only if no errors

末鹿安然 提交于 2019-12-10 04:37:14
问题 I am switching to using Vim for for my LaTeX editing environment. I would like to be able to tex the source file from within Vim, and launch an external viewing if the compile was successful. I know about the Vim-Latex suite, but, if possible, would prefer to avoid using it: it is pretty heavy-weight, hijacks a lot of my keys, and clutters up my vimruntime with a lot of files. Here is what I have now: if exists('b:tex_build_mapped') finish endif " use maparg or mapcheck to see if key is free