latex

Undefined control sequence error while converting from markdown to PDF with pandoc and xelatex

若如初见. 提交于 2019-12-11 12:15:18
问题 I'm making some documentation for our project, but I can't enable xelatex in pandoc to setup custom fonts. If I set --latex-engine xelatex pandoc will show that error: pandoc: Error producing PDF from TeX source. ! Undefined control sequence. l.17 \sys_if_engine_luatex:T Here is a command that I run: pandoc -s --latex-engine xelatex -f markdown build.md -o docs.pdf I use Ubuntu 14.04 LTS , pandoc 1.12.2.1 and XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) . 回答1: Oops... after

Compiling multiple PDFs using knitr and texi2dvi

拈花ヽ惹草 提交于 2019-12-11 10:33:48
问题 My goal is to use knitr to produce separate PDFs for data associated with each factor level in a data set. However, I've gotten a variety of errors (included below) and am unable to compile the .tex files that are produced. I've tried trouble shooting with the main SO post on the topic here as well as Yihui's GitHub code here, but I'm still not getting a final product. I suspect there might be other users who are also still struggling to get this right after looking at the listed resources.

xtable highlighting: \rowcolor shifted down one row

女生的网名这么多〃 提交于 2019-12-11 10:18:16
问题 I am following this example in an attempt to add highlighting to rows of a LaTeX table created by xtable . In my version, I want to add highlighting to rows conditional upon column c having a value of 1. Here's my R code to generate the table. <<example>>= # create data frame my.df=data.frame(a=c(1:10),b=letters[1:10],c=sample(c(0,1), 10, replace=TRUE)) # identify index of rows to highlight row.i.1 <- which(my.df$c==1) print(xtable(my.df), only.contents=TRUE, include.rownames=FALSE, include

Apply XSLT tags that aren't there

时间秒杀一切 提交于 2019-12-11 10:08:02
问题 I am trying to convert an XML document into LaTeX using XSLT. I have two tags <lin> and <gra> which, roughly speaking, correspond to a paragraph and a choice of text size, respectively. However, in the case where <lin> is run from within a <blok ryk="lyrik"> tag, I want <lin> to be applied identically to <lin ryk="lang"><gra str="-1"> . I know I could just copy the definition of the latter, but for several reasons, the mentioned solution is to be preferred. I felt very lucky and decided to

Environment where all formatting is ignored

99封情书 提交于 2019-12-11 10:05:31
问题 Does there exist a command in LaTeX, such that all that I write within that environment is showed as it is? For instance when I want to make a guide on how to use commands in LaTeX I'm interested in writing something like: In order to write $\cap$, you use the command \cap. But this will return an error because (the last) \cap isn't in the correct environment. So what can I do to make LaTeX ignore the command and just show the text? I have tried with \mbox{\cap} , which does not work, I am

Is there CSS for typesetting the XeLaTeX logo in HTML?

匆匆过客 提交于 2019-12-11 09:57:05
问题 I want to use the XeLaTeX logo in HTML pages. I found the answer to a similar question regarding the LaTeX logo here: Is there CSS for typesetting the LaTeX logo in HTML?, but the XeLaTeX logo involves a mirrored E. Is there a trick to get this too? 回答1: You could use “Ǝ” U+018E LATIN CAPITAL LETTER REVERSED E to get a mirrored E, but it’s tricky and risky to do a character substitution with CSS. So a better approach would be to uppercase the “e” and use a 3D transform. Considering just this

How can I capture CLI tool file output to R object or stdout?

北城以北 提交于 2019-12-11 09:13:00
问题 I'm calling a bunch of command-line interface (CLI) tools (such as texi2pdf or pdf2svg from an R script, and I'd like to capture the output file of these tools directly as an R object, without touching the file system . This is the opposite concern of the more frequent "how-do-I-redirect-stdout-to-file"-question. (Perhaps that implies that I'm "using it wrong"). Example : Say, I have a simple latex reprex.tex file that I'd like to compile: \documentclass{article} \begin{document} Foo. \end

R to latex - Coloring numbers automatically

泄露秘密 提交于 2019-12-11 09:08:28
问题 I have a (long) R matrix. eg: matrix <- matrix(rexp(200, rate=.01), ncol=4) I would like to find a way to colour, for instance, the 15% more important numbers of each column, BEFORE doing the latex extraction as follow: print(xtable(matrix, align = c("r","r","r","r","r")), type = "latex", floating = FALSE, tabular.environment = "longtable") Any idea? 回答1: I finally found a dirty solution matrix <- as.data.frame(matrix(rexp(200, rate=.01), ncol=4)) Set the loop for(i in 1:length(matrix[1,])) {

Table unnecessarily starting from next page in latex

女生的网名这么多〃 提交于 2019-12-11 08:59:16
问题 How can I stop my table in latex to start unnecessarily from next page leaving a huge space in previous page? How can I force to start just after the heading. Here is my code: I am using packages: \usepackage{tabularx,ragged2e,booktabs,caption}, \usepackage{float} and the code for my table is: \begin{table}[H] \begin{tabular}{| l| l } $.$ & Matches any character.\\ $*$ & Matches zero or more instances of the previous pattern item.\\ $+$ & Matches one or more instances of the previous pattern

Embeding shiny app in pdf latex (R knitr)

纵饮孤独 提交于 2019-12-11 08:42:51
问题 I know that it's impossible to put shiny app in pdf latex directly, but I've heard (How to embed an interactive shiny plot in a pdf / presentation? (via knitR maybe) HubertL's answer) it's possible to bind it via link. Can someone help me with that? I haven't found anything about this. I'm using beamer Madrid (Idk if it's important). 回答1: You have to publish the Shiny app first. Once you have got the URL to the online app, you can use knitr::include_url() to include an automatic screenshot of