latex

LaTeX table positioning

你离开我真会死。 提交于 2019-12-20 08:00:10
问题 I have a LaTeX document that contains a paragraph followed by 4 tables followed by a second paragraph. I want the 4 tables to appear between the two paragraphs which from what I've read means I should use the [h] option after beginning the table environment (e.g. \begin{table}[h] ). Using this the first two tables appear after paragraph 1 as expected, however paragraph 2 is then displayed with the last two tables appearing on the following page. How can I get the tables to appear in the

knitr: code in chunks gets wrapped unexpectedly

冷暖自知 提交于 2019-12-20 05:10:10
问题 In a beamer presentation using knit2pdf() and LaTeX, I sometimes find that code in chunks gets wrapped, even though I have set tidy=FALSE globally. For example, this chunk: \item Fit this using \func{glm}: <<berk-logit2, size='footnotesize'>>= berkeley <- as.data.frame(UCBAdmissions) berk.logit2 <- glm(Admit == "Admitted" ~ Dept + Gender, data = berkeley, weights = Freq, family = "binomial") @ Appears like this: Note that all three lines are wrapped, as if in paragraph mode. The indented line

Beginner's questions (figures, bibliography) with Sweave/R/LaTeX---my first document

末鹿安然 提交于 2019-12-20 04:53:54
问题 I am just starting with Sweave and with R . Here I am using R to output some data and I am also trying to include a plot. The code does not sweave. I have one Sweave example from the web that compiles well in RStudio with LaTeX . \documentclass[a4paper]{article} \begin{document} <<echo=TRUE>>= x <- rnorm(100) xm <- mean(x) xm @ <<echo=FALSE>>= x <- rnorm(100) xm <- mean(x) xm @ <<echo=TRUE>>= test.frame<-read.table(file="apples.d",header=T,sep= "") names(test.frame) head(test.frame) class

Loading AMSmath explicitly in IPython notebook causes “[Math Processing Error]”

孤街浪徒 提交于 2019-12-20 04:25:07
问题 I am a relatively new IPython Notebook user and I am using IPython 3.2.1. So upfront, my apologies if I did not read some documentation carefully! I am trying to typeset some LaTeX in my Notebook intended for a presentation. I tried to utilize MathJax capabilities better than what's (supposedly) available by default and so tried incorporating other extensions that come with MathJax explicitly. In particular, I tried getting my IPython Notebook to load AMScd.js, AMSsymbols.js and unicode.js

Loading AMSmath explicitly in IPython notebook causes “[Math Processing Error]”

北战南征 提交于 2019-12-20 04:25:04
问题 I am a relatively new IPython Notebook user and I am using IPython 3.2.1. So upfront, my apologies if I did not read some documentation carefully! I am trying to typeset some LaTeX in my Notebook intended for a presentation. I tried to utilize MathJax capabilities better than what's (supposedly) available by default and so tried incorporating other extensions that come with MathJax explicitly. In particular, I tried getting my IPython Notebook to load AMScd.js, AMSsymbols.js and unicode.js

Pandoc's environment cslreferences undefined when knitting RMarkdown to PDF in RStudio

一笑奈何 提交于 2019-12-20 03:23:46
问题 Knitting (in RStudio version 1.2.1335) an RMarkdown file to PDF fails when trying to create citations (for pandoc version 2.8.0.1, and R version 3.6.1). (This does not happen when knitting to HTML, for example.) Here is a small rep. ex. in RMarkdown: --- title: "Rep. Ex. for 'LaTeX Error: Environment cslreferences undefined'" output: pdf_document: default bibliography: report.bib --- ```{r generate-bibtex-file, include=FALSE} knitr::write_bib(file = "report.bib", prefix = "") ``` # Used R

Bookdown add URL as footnote

匆匆过客 提交于 2019-12-20 03:16:33
问题 I am having problems getting correct pdf output of figure legends that contain a url. It works as bookdown::gitbook but not as bookdown::pdf_book Here is an example: --- output: bookdown::pdf_book --- ## Reference with URL doesn't work In this experiment, we will use a [spectrophotometer] (https://en.wikipedia.org/wiki/Spectrophotometry) to measure the absorption of light of different wavelength by colored solutions. (ref:spectrum) [Spectrum of light. V, violet; B, blue; G, green Y, yellow; O

Word中Aurora插件编译LaTeX公式速度很慢的问题

风流意气都作罢 提交于 2019-12-20 00:43:34
Word中Aurora插件速度很慢的问题   Aurora插件在32位Word中可以直接在Word上方的工作区中显示,在64位Word中则需要通过 插入 → \rightarrow → 对象 → \rightarrow → Aurora Equation来插入公式(为了方便可以定义一个宏)。   使用Aurora时发现编译速度极慢,而且如果在编译时保存文件将导致该Word文件在编译完成前被锁死。   怀疑可能和Aurora使用的LaTeX库有关。通过Aurora公式编辑框中的Properties → \rightarrow → Paths查看LaTeX库文件路径。   发现Use default values被勾选,路径显示为latex, dvipng, pdflatex,也不知道究竟是用了什么库。   不选Use default values选项,把路径改为电脑中MikTeX 2.9的路径(需要的3个exe文件一般在 MikTex路径\miktex\bin或者 MikTex路径\miktex\bin\x64下),发现还是很慢。   尝试安装下载Aurora插件时自带的Micro-miktex( 下载地址 )。把路径改为安装的MikTeX 2.5的路径(如下图所示),运行速度恢复正常。 来源: CSDN 作者: wwf1093996635 链接: https://blog.csdn

Vertical alignment of matplotlib legend labels with LaTeX math

99封情书 提交于 2019-12-19 08:48:33
问题 When mixing labels that have subscripts with labels without them, they do not vertically align properly in the legend. Since matplotlib determines bounding boxes internally based on printing characters, using a vphantom character does not work to align these legend labels, and I have not had any luck changing the vertical alignment of the labels with set_va , either. Below is a MWE that illustrates problem I am trying to solve. I would like the labels to align to the text baseline if at all

Change paper size and orientation in an rmarkdown pdf

爷,独闯天下 提交于 2019-12-19 08:14:31
问题 I'd like to create a PDF using rmarkdown that is A3 (or 11x17, ideally) and in landscape orientation. I can get it to do one or the other by specifying options in the YAML header, but not both at the same time. Here's my best attempt - the classoption values each work individually, but not together: --- title: "Test" output: pdf_document: toc: true number_sections: true documentclass: article classoption: landscape a3paper --- This question is related, but doesn't have the answer in this case