latex

Repeat headers when using xtable with longtable option

試著忘記壹切 提交于 2019-12-04 18:28:01
问题 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 ? 回答1: In order to accomplish this, you'll need to use the add.to.row option of the print function (run

Vim, LaTeX, word-wrapping, and version control

我是研究僧i 提交于 2019-12-04 18:27:15
问题 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

Physics bra-ket symbols in IPython

倾然丶 夕夏残阳落幕 提交于 2019-12-04 17:35:12
I am trying to have the ket symbol which is usually written in latex as \ket{\psi} . However, this doesn't work when written within the $$ ... $$ . This also doesn't work when written using IPython.display . $ latex ** \documentclass{article}\usepackage{amsmath}\begin{document} ... chatter chatter ... * \show\ket > \ket=undefined. So your \ket macro is coming from some package or other which I don't know what it is. This doesn't explain why it doesn't work in $$ ... $$ -- you have to work at it to get things to not work in display math -- but it does explain why it doesn't work in IPython:

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

余生长醉 提交于 2019-12-04 16:52:26
问题 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

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

依然范特西╮ 提交于 2019-12-04 16:29:19
问题 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

How can I combine cells in a row in a latex-table?

…衆ロ難τιáo~ 提交于 2019-12-04 16:06:55
问题 In a table I want to combine some of the columns, but not in all rows. How can I realize this with LaTeX? 回答1: \multicolumn{<number>}{<formatting>}{<contents>} Where the arguments are Number of columns to merge the justification and formating string (just like you use in the table header, i.e. " |c| " or the like) The contents to put in the merged columns This command simply replaces the <number> columns and is used inline. Addition: This is also how you change the formatting of a single

Is it possible to write own “packages” for LaTeX?

試著忘記壹切 提交于 2019-12-04 16:05:41
As a programmer, I wonder if I could create my own package for LaTeX. I need something like that famous "listings" package, but something that is much more capable for my needs. I look for a listings solution that would watch out for a comment line like // BEGIN LISTING 3122 // END LISTING 3122 No syntax highlighting, but intelligent support for tab indents. That package then would be used with a file name or path, walk through the lines and copy out just the snippets of interest. I am 100% sure there is absolutely nothing like this on the market. So I want to program it for LaTeX. If that's

Which is the best import / export LaTeX tool?

孤人 提交于 2019-12-04 15:45:21
Working in academia publishing CS/math, you sooner or later find yourself trying to publish in a journal that will only accept .doc/.rtf. This means tedious, boring hours of translating line after line, especially equations, from LaTeX to an inferior format. Over the years I have tried a number of export tools for LaTeX, but none, at least of the free ones, that I have been very satisfied with. I'd like this page to collect and monitor the best import/export tools for LaTeX, to .doc/.rtf, or to other useful (e.g. HTML, MATHML) formats. Thus, what is your one favorite import or export LaTeX

Lightweight Text Markup language that can be converted to HTML and LaTeX with a Java library? [closed]

丶灬走出姿态 提交于 2019-12-04 15:45:10
A simple lightweight markup language like e.g. defined by Ceole 1.0 could be very useful for use in program and application documentation that is used as the basis for automatically created HTML and LaTeX. Is there any Java library out there that would be able to create HTML AND LaTeX from some markup dialect (creole, markdown, textile or similar)? Are there any tools or libraries that would make it easier to implement such a library oneself? Starting from scratch gets surprisingly complex when done right. Unless I've misunderstood your question, Fletcher Penney's Multimarkdown is about a

stargazer left align LaTeX table columns

一曲冷凌霜 提交于 2019-12-04 15:40:29
问题 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