latex

how to get figure floated / surrounded by text etc. in R markdown?

妖精的绣舞 提交于 2019-12-09 01:36:30
问题 I am currently writing some reports with LaTeX. Due to most of my analysis is made with R, I switched to Rmarkdown, which I am very happy with so far, except one thing, namely when it comes to include figures in the pdf output. Some of my plots are floating, so they are surrounded by text and the other kinds of output, put some other of my figures take a whole page in the pdf document, although they are not that big. And I have absolutely no clue why it is like that. Does anyone know that

How do I emit the text content of a reference in LaTeX?

喜你入骨 提交于 2019-12-09 01:01:57
问题 I have a section: \section{Introduction} \label{sec:introduction} I'd like a link to the section where the link text is the name of the section. I can use hyperref : The \hyperrf[sec:introduction]{Introduction} introduces the paper. But that requires repeating the section title ("Introduction"). Is there a way to grab that? ref yields the section number, which isn't right. autoref yields "section " and then the section number, which isn't right, either. 回答1: There are a couple of packages

RMarkdown PDF “LaTeX3 error: Erroneous variable”

徘徊边缘 提交于 2019-12-08 21:10:26
问题 I've been creating PDF reports via RMarkdown for a couple months now, but after installing MikTex, R and the rmarkdown and tidyverse packages on a new machine today, I received the following error message when attemping to knit a PDF: "C:/PROGRA~2/Pandoc/pandoc" +RTS -K512m -RTS Test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.pdf --template "C:\Users\drewm\Documents\R\win-library\3.4\rmarkdown\rmd\latex\default-1.17.0.2.tex"

Using apaTables or apaStyles packages with knitr

人走茶凉 提交于 2019-12-08 19:32:25
Problem Social scientists format tables and documents with APA style . There are packages like stargazer and xtable (here is an extensive list ) that provide clean table formatting for those using latex and knitr . However , these packages do not conform to APA style rules in all cases. Building and formatting tables from scratch is time consuming. Fortunately, there are two R packages for creating tables and documents compliant with APA style guidelines: apaStyle and apaTables . Unfortunately, both packages only output to MS Word. Questions Is there a way to use APAStyle and APATables so that

How can I restrict the size of my \multicolumn cells in a longtable?

家住魔仙堡 提交于 2019-12-08 18:18:38
问题 I have a really long table in LaTeX that spans several pages and is (as it is now) also too wide for the page. I am using the longtable package with every column width specified with the p{width} command. The problem is, that most of the rows contain a multicolumn call, and thus are not adhering to the preamble p{width} command, which causes the total width of the table to be too large. Minimal example: \begin{longtable}{|p{1in}|p{0.75in}|p{0.5in}|p{0.5in}|>{p{1in}|p{1in}|} \caption{some cap}

Axis labelling not possible using matplotlib with LateX

丶灬走出姿态 提交于 2019-12-08 14:42:23
问题 I have installed LateX(TeX 3.1415926 (TeX Live 2013/Debian) kpathsea version 6.1.1) on Ubuntu 14.04LTS, ghostscript(9.10) and dvipng(1.14) according to the example in the matplotlib documentation (usetex). If I comment out the label properties of the plot everything works fine, but when not, either they do not show up or it is raising an error (see in the code snippet below). How can I handle axis labelling with latex properly? Do I need a further package? import numpy as np import matplotlib

How do I cite the title of an article in LaTeX?

自作多情 提交于 2019-12-08 14:28:31
问题 I'm using LaTeX and BibTeX for an article, and I want to able to cite the title of an article I reference. What is the command to do this? I'm using \bibliographystyle{chicago} and it does not appear to be \citeT{} , \citetitle{} or \citeTitle{} 回答1: @Norman, and the various commenters, are correct in that it would be difficult to do this with bibtex and other tools. But, there is an alternative. Biblatex does allow this through the command \citetitle . Also, if you really want to, the

Shiny to output a function that generates a pdf file itself

孤街浪徒 提交于 2019-12-08 12:17:42
问题 I am trying to use Shiny to build an app with a function that output a pdf file. Specifically, the function I am trying to use is the msaPrettyPrint function from the msa package. It uses the texi2pdf function from the tools package to generate a pdf file. For example, if you run the following code, you will generate a pdf called "myFirstAlignment.pdf" with an amino acid sequence alignment in your working directory. # source("http://www.bioconductor.org/biocLite.R") # biocLite("msa") library

Matplotlib log-scale tick labels, minus sign too long in latex font

青春壹個敷衍的年華 提交于 2019-12-08 12:16:14
问题 I'm using 'text.usetex': True in matplotib. This is nice for plots with a linear scale. For a log-scale however, the y-ticks looks like this: The minus signs in the exponents take a lot of horizontal space in a plot, which is not very nice. I want it to rather look like that: That one is from gnuplot, and it's not using the tex-font. I would like to use matplotlib, have it rendered in tex, but the minus signs in 10^{-n} should be shorter. Is that possible? 回答1: Dietrich gave you a nice answer

Formatting equations in LaTeX

北城以北 提交于 2019-12-08 09:06:50
问题 When I include an equation in LaTeX that is enumerated, i.e. {\begin{equation} $$ $$ ... \end{equation} } The line above the equation (blank space between the text preceeding it and the equation) is huge. How do I make it smaller? 回答1: Your code it's a little bit messy. If you want to write math in your LaTeX code there are mainly three ways: Inline math: include your math code between two $ (like $\pi=3,141$ ); your equation or symbols will be displayed on the current line. Displayed,