latex

Map cell colors to data values in kableExtra to create a heatmap table

安稳与你 提交于 2019-12-24 00:46:52
问题 I have a table below and would like to apply ROW-level heat maps. (1) Any idea how? Right now the heat map is the same for both values in the single row below. (2) Is there a way to make the header for the group column NOT be angled 90 degrees? Right now all headers are angled but for the group column it be better without angle=90. here is the rmd file. --- title: "Untitled" output: pdf_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(dplyr) library

Pandoc : set document title to first title

删除回忆录丶 提交于 2019-12-24 00:46:04
问题 I'm creating a library on github, so I'm using a Markdown file for that, with the following structure: # My main title ## My first section ... ## My second section ... But unfortunately, when I use pandoc to convert this document into latex: pandoc README.md --number-sections -f markdown -t latex -s -o doc.tex the document does not have any title, and the numbering starts from the main title: 1. My main title 1.1. My first section ... 1.2. My second section ... While I'd like something like

Can I make `git merge` always conflict on file changes?

你离开我真会死。 提交于 2019-12-24 00:28:43
问题 I am hoping I have a simple question for you, but I can't find an answer anywhere (I have been searching for 2 days, maybe I am dumb?). I am trying to develop a git workflow to collaboratively edit LaTeX files with my PhD adviser. The problem we face is due to the behavior of git merge (because it merges automagically). I want git to conflict anytime it sees a file change, even if it is an addition, subtraction, or minuscule change, is this possible? This way we can both pick and choose

MathJax `\\` newline not rendering. Simply shows the `\\`

主宰稳场 提交于 2019-12-23 22:25:46
问题 I use the MathJax CDN: <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> When I put this into my webpage: Say $P(k, n)$ is the probability of ...\\ By definition, ... all the math renders correctly, but the \\ shows up as \\ instead of as a newline, and there is no newline. It just continues on the same line. So it looks like: probability of ... \\ By definition, ... I haven't changed anything for a while, and I didn't think this was

Knitr hook to add code before \documentclass line in tex file to avoid options clash with xcolor

巧了我就是萌 提交于 2019-12-23 18:38:45
问题 I am trying to create a pdf document using rmarkdown and knitr . I need to use the xcolor tex package with some options (eg: [table] or [svgnames] ). Whenever I try to do so either using - \usepackage[table]{xcolor} in the YAML header or in a preamble tex file mentioned under the pdf_document includes in_header: , I am getting the following error: ! LaTeX Error: Option clash for package xcolor The option clash is because, the knitr engine pdf_document is also loading the xcolor package either

Inkscape .91 with latex

别说谁变了你拦得住时间么 提交于 2019-12-23 17:43:49
问题 I am using Inkscape 0.91 and trying to add Latex math formula inside my graphics. After several hours of tying and fixes from the I am still not able make it work. I am on Windows 7 with the following, 1) pstoedit (pstoeditsetup_win32.exe) 2) GSview 5.0 (gsv50w32.exe) 3) Ghostscript 9.18 (gs918w32.exe) 4) miktex 2.59 64 bit version I have added the PATHs and did all the stuff. I can see the Latex extension as well but whenever I try to use it I face the following error: "Problem during

Sympy - fraction manipulation

怎甘沉沦 提交于 2019-12-23 17:14:11
问题 I basically want Sympy to generate latex code \frac{x-1}{3} = y but whenever I ask it generate the Tex component of things Sympy always returns \frac{x}{3} - \frac{1}{3} . How do I avoid splitting up the equations, and assign an equals operator to another variable. I have not attempted to add the "y =" part to the code yet as I wanted to clarify the fraction situation first, but since I have had to come cap in hand to stack exchange I thought I would ask both questions. I have been through

Error in applying a for loop to an xtable in knitr

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 17:04:03
问题 I'm preparing a pdf using knitr that contains a table produced using xtable. I'm adding a bold typeface to certain cells in the table so I've written the following function: bold <- function(x, matrix){ x[] <- lapply(x, as.character) for (i in 1:ncol(x)) { yes <- matrix[,i] x[yes,i] <- paste('\\textbf{', x[yes,i], '}', sep = "") } print(x, sanitize.text.function = identity) } My intention is that the object 'l.mat' is a logical matrix and by changing the 1's and 0's in the matrix I can change

Converting XHTML table with rowspan and colspan to LaTeX

老子叫甜甜 提交于 2019-12-23 13:13:54
问题 I have been looking for a suitable solution for conversion of an HTML table to LaTeX. I have found the following questions which is similar to my requirement: XML table to LaTeX Converting XHTML table to LaTeX using XSLT But both of these were not 100% helpful with my current requirement, as it does not involve in conversion of content with both colspan and rowspan . The input HTML would look like: <html> <head> </head> <body> <table border="1"> <tr> <td>This</td> <td>is</td> <td>a</td> <td

how to align stargazer table to the left when type=“latex”?

北城余情 提交于 2019-12-23 12:50:49
问题 I use stargazer package in my automated rmarkdown pdf documents to make nice looking tables. Stargazer places its tables in the center of the page, by default. How can I let stargazer generate latex code that aligns the table to the left? here is an example of what I mean: library(stargazer) data_object <- structure(list(test = structure(c(1L, 1L, 2L, 2L), .Label = c("test1", "test2"), class = "factor"), test2 = structure(1:4, .Label = c("1", "2", "3", "4"), class = "factor")), .Names = c(