latex

Using CSS when converting Markdown to PDF with Pandoc

此生再无相见时 提交于 2019-12-03 12:19:40
I'm trying out Pandoc on OS X, and results thus far are impressive. One blocking problem, however, is getting CSS styles to work on inline code samples. I'm converting from Markdown to PDF. I have this string in my source: * Create a simple HTML document (<span class="filename">simple.html</span>) and load it into the browser via the file system I've also tried this: * Create a simple HTML document (`simple.html`{.filename}) and load it into the browser via the file system I'd like to apply the class "filename" to the enclosed text in each case, but it doesn't seem to do anything to the output

Vim, LaTeX, word-wrapping, and version control

被刻印的时光 ゝ 提交于 2019-12-03 12:12:42
I'm writing a LaTeX document in vim, and I have it hard wrapping at 80 characters to make reading easier. However, this causes problems with tracking changes with in version control. For example, inserting "Lorem ipsum" at the beginning of this text: 1 Dolor sit amet, consectetur adipiscing elit. Phasellus bibendum lobortis lectus 2 quis porta. Aenean vestibulum magna vel purus laoreet at molestie massa 3 suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien 4 ullamcorper elit, dignissim consectetur justo tellus et nunc. results in: 1 Lorum ipsum dolor sit amet,

How to get \\bm{} to work in an R markdown (to HTML) file?

二次信任 提交于 2019-12-03 12:05:33
My R Markdown (.Rmd) file looks like this: --- title: Foo author: Marius Hofert header-includes: - \usepackage{bm} output: pdf_document vignette: > %\VignetteEngine{knitr::rmarkdown} %\VignetteIndexEntry{Foo} --- \[ \begin{align} \bm{U}=a\bm{X}\quad\boldmath{U}=a\boldmath{X}\quad\mathbf{U}=a\mathbf{X}. \end{align} \] The output (obtained via R CMD build and the looking in ./inst/doc/*.html ) is this: For getting italics bold vectors, I would like to use \bm{X} in my .Rmd document, but it fails (although I load the package bm ). Why? The same happens without the output: pdf_document part.

Repeat headers when using xtable with longtable option

…衆ロ難τιáo~ 提交于 2019-12-03 12:04:55
Is there a way to repeat the top row / set headers when generating an xtable with a longtable option ? For eg., if I have tableSb <- xtable(df, caption="A Very Long Table", label="ALongTable") print(tableSb, include.rownames=TRUE, tabular.environment="longtable", floating=FALSE) This works fine, but when the tables roll over into a new page the headers are not repeated. Any suggestions ? In order to accomplish this, you'll need to use the add.to.row option of the print function (run ?print.xtable for more information). Try this (adapted from https://r-forge.r-project.org/tracker/?func=detail

How do I disable colors in LaTeX output generated from sphinx?

混江龙づ霸主 提交于 2019-12-03 11:49:09
When I build the LaTeX file generated from sphinx, the TOC entries, and section headers are blue. Is there an easy way to disable coloring these items? If not, is there an easy way to make them black instead? My goal is to print the document on a non-color printer, and the TOC and headings do not look as dark as the rest of the text when I do so. I would like to make one change that applies to the whole document if possible. Note: I am using the howto document class. Update Thanks to ddbeck's input, I took a closer look at sphinx.sty which defines the colors that I needed to change. I set

matplotlib 3d axes ticks, labels, and LaTeX

喜欢而已 提交于 2019-12-03 11:31:28
问题 I am running this sample script, with the following modifications: import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt mpl.rcParams['legend.fontsize'] = 10 fig = plt.figure() ax = fig.gca(projection='3d') theta = np.linspace(-4 * np.pi, 4 * np.pi, 100) z = np.linspace(-2, 2, 100) r = z**2 + 1 x = r * np.sin(theta) y = r * np.cos(theta) ax.plot(x, y, z, label='parametric curve') ax.legend() ax.set_xlabel('$X$', fontsize=20,

Changing the colour of \textbullet in LaTeX Beamer

假装没事ソ 提交于 2019-12-03 11:14:55
问题 I don't want to use Beamer's standard blue colour theme. I want to use beaver , which is deep reds. Everything looks nice, except that if I use itemize the bullet points are still blue. Is there a nice way to have the bullets vary with what colour theme I was using? (If I were to opt for a yellowish colour theme, I'd expect the bullets to go yellow too.) If there isn't, what is the brute force way to change the bullet points red? Or at the very least, make them go back to black again. 回答1: ..

Change “List of Listings” text

♀尐吖头ヾ 提交于 2019-12-03 11:09:27
问题 I tried to change the "List of Listings" text with the command \renewcommand*{\lstlistlistingname}{List of XYZ} before my \begin{document} . What's wrong with this? By the way \renewcommand*{\lstlistingname}{NewListing} worked like a charm. Edit: No error occurred, just no change in the text. It's still "List of Listings". By the way this is how I included it: \pagestyle{scrheadings} \pagenumbering{Roman} \pdfbookmark[0]{\contentsname}{Contents} \tableofcontents \listoftables \listoffigures

stargazer left align LaTeX table columns

女生的网名这么多〃 提交于 2019-12-03 10:47:21
stargazer automatically centres values within tables. How can I left align the columns? Put this code in an .Rnw file and use knitr to convert to .tex: <<load, echo=FALSE, warning=FALSE, message=FALSE>>= opts_chunk$set(eval=TRUE, echo=FALSE, warning=FALSE, message=FALSE, dpi=300) @ \documentclass[a4paper,11pt]{article} \usepackage{lipsum} % Required to insert dummy text \begin{document} \title{} \author{} \date{\today} \maketitle \section{Header} Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

How to remove white space above and below image in R Markdown?

余生颓废 提交于 2019-12-03 10:32:48
I want to export a .Rmd file primarily as a latex pdf. This is the code that I'm currently using ```{r ,fig.cap="caption",fig.env='figure', fig.width=10, fig.height=10,echo=FALSE, results='asis', warning=FALSE, strip.white=TRUE} library(png) library(grid) img <- readPNG("filepath/overview.png") grid.raster(img) ``` As you can see, I'm already using strip.white=TRUE & fig.env='figure' but they don't seem to work. The .PNG file hasn't got any (white) spacing above or below the image. I know I can use latex directly and achieve what I want, but I want to able to reproduce this in Word if needed.