Hot answers tagged

40

Since you are generating the table from R, I'll assume that you are using R's xtable package to generate the table. This package has some deficiencies, but it is still quite usable. Here's a sample R session showing how to use the package. R-session data(tli) ## Demonstrate aov ## Taken from help(aov) in R 1.1.1 ## From Venables and Ripley (1997) ...


39

There are several ways to draw Venn diagrams. The simplest for $\overline{A \cap B}$ may be: \tikz \fill[even odd rule] (0,0) circle (1) (1,0) circle (1); The key to this question is even odd rule in TikZ (based on PostScript and PDF). Moreover, you can also use \clip to fill the complement of a set, without using even odd rule: ...


36

I've been implementing this for my lab. We produce several hundred (if not thousand) documents per year. The OP was right in that a well-defined workflow is essential. Process For us, the solution was a well-defined process that goes approximately like this: Define a class file that contains the correct formatting, etc, using article, report or book ...


35

I think that LaTeX is the wrong starting format, especially if you are generating your input file using Sweave. Instead you can consider using a light-weight markup (Markdown, RST, etc) as a starting format. It will be much easier to convert these formats to both LaTeX and OpenOffice (for example, using Pandoc). As an example, see this sweave file which is ...


34

I think this is the easiest option! ---- title: "Title" author: "Me" header-includes: - \usepackage{bbm} output: pdf_document ----


30

The pgffor package allows for-loop style repetition using the following format: \foreach \<cmd> in {1,...,<total>} {% % stuff } Using this as base, the following is probably what you're after: \documentclass{beamer}% http://ctan.org/pkg/beamer \usepackage{graphicx}% http://ctan.org/pkg/graphicx \usepackage{pgffor}% ...


27

I think these two softwares are missing in the list. TeX2Word from Chikriilab LaTeX-to-Word from Grindeq Both of them work elegantly for a properly written LaTeX file. Also, they offer packages for word to LaTeX conversion which are again excellent. But unfortunately both of them are not free.


23

How about using a chunk with <<results=tex, echo=FALSE>>=? It will allow you to: (a) paste together the LaTeX code you'd like to run (i.e. 200 \begin{frame} ... \includegraphics ... \end{frame} constructs); and (b) place that constructed text verbatim in the *.tex file produced by Sweave(). For more details, see here. It's a FAQ! ...


23

An example for Venn diagrams with transparency by Till Tantau and Kjell Magne Fauske, from the TikZ Example gallery: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,backgrounds} \begin{document} \pagestyle{empty} \def\firstcircle{(0,0) circle (1.5cm)} \def\secondcircle{(60:2cm) circle (1.5cm)} \def\thirdcircle{(0:2cm) circle (1.5cm)} ...


22

To illustrate the problem, here is the output from the following Sweave document: \documentclass[a4paper]{article} \usepackage{Sweave} \DefineVerbatimEnvironment{Sinput}{Verbatim} {xleftmargin=2em, frame=single} \DefineVerbatimEnvironment{Soutput}{Verbatim}{xleftmargin=2em, ...


21

Following Yihui's advice, I found the best option to be to invoke the warning=F and message=F chunk options, like so: ```{r, message=F, warning=F} library(memisc) ``` This was using knitr ("Knit HTML") with RStudio to process R markdown.


17

0. tl;dr knitr is preferable to Sweave, and ezknitr is a wrapper around knitr that is probably worth using—especially if you are only building documents from the command line; I don't think there are IDEs that have integrated ezknitr use (at least not at the time of writing)—because it makes it easier to ensure the directories and paths are all correct. ...


16

run it with xelatex if you need a pdf \documentclass{minimal} \usepackage{pstricks} \begin{document} \begin{pspicture}(6,4) \psset{linewidth=1.5pt} \psframe[fillcolor=red!30,fillstyle=solid](6,4) \psclip{\pscircle(2,2){1.5}} \pscircle[fillcolor=white,fillstyle=solid](4,2){1.5} \endpsclip \pscircle(4,2){1.5}\pscircle(2,2){1.5} \end{pspicture} ...


16

Here is an alternative approach using the latex function from Hmisc. On the one hand, it only does matrices and data frames; on the other hand, it natively knows about booktabs, is impressively tweakable either directly or via its subroutine format.df, and ships with the standard installation. Using the same npk.aov example as Alan Munn did, I can produce ...


15

The baseline approach is just to keep them separate. My work flow on a recent paper was as follows: I wrote an R script to calculate the statistics and generate (a) charts and (b) tables of numbers. The script produced charts either as eps (which I used with LaTeX) or as png (which were needed for the online version of the paper). The charts had long ...


14

Are you certain that the encoding should be ISO-8856-9? I've never heard of that one. Maybe you mean ISO-8859-6 (Arabic) or ISO-8859-9 (Turkish)? Let's assume that you meant ISO-8859-9. Then you just write \usepackage[latin1]{inputenc} in the beginning of your code, \inputencoding{latin5} just before you include the file and \inputencoding{latin1} ...


14

My first instinct would probably be oolatex too, or some other technique using TeX4ht, but another method that can also work well is latex2rtf, though I've had the best luck when I tell it it convert formulas, tables, and other complicated stuff to embedded images in the result: obviously, this isn't a great option if the people you're sending them to need ...


13

I found a very easy solution for converting LaTeX-documents into editable Word-files. Compile your LaTeX-document to PDF Go to the Internet-page http://pdftoword.com/ Upload your PDF and wait until the Word-file arrives. I have only tested the site with text-files (no graphics or formulas), but it converted complex contract in Norwegian (æøå) to pretty ...


13

Several people have mentioned tex4ht but didn't give the command. From my looking around it seems that the command to run is mk4ht oolatex myfile.tex and you should get a .odt file. I tried it on a basic example and it worked great. When I get a chance I will run it on something more complex.


13

As per this page on the R Markdown website, you can add whatever you want to the preamble via the in-header option in the YAML header; e.g., ---- title: "Titre" date: Fecha output: pdf_document: includes: in_header: mystyles.sty ---- In mystyles.sty, located in the same directory as the .Rmd, you could have a whole list of ...


13

Try adding fig_caption: yes to the YAML header of your .Rmd file. It will look something like this: --- title: "Untitled" author: "Nicholas" date: "20/09/2014" output: pdf_document: fig_caption: yes --- There's more information here: http://rmarkdown.rstudio.com/pdf_document_format.html


13

I think your best bet is to reshape the data before exporting. While it might be possible to join the data based on the Sample name in PGFPlots, that's going to get really tricky. In R, it's a one-liner, using cast from the reshape package write.table( cast(data, Region~Sample, value="Density"), "reshaped.csv", quote=F, sep=",", row.names=F) Then you get ...


13

With Sweave really you need only two steps for a simple document as this my_sweave_file.Rnw: \documentclass{article} \begin{document} Some text <<RTest>>= 2+2 @ \end{document} From the command line is enough: R CMD Sweave my_sweave_file.Rnw pdflatex my_sweave_file.tex Or even only one: R CMD Sweave --pdf my_sweave_file.Rnw In case that ...


12

A solution with the new package tkz-euclide ( based on TikZ ) \documentclass{scrartcl} \usepackage[usenames,dvipsnames]{xcolor} \usepackage{tkz-euclide} \usetkzobj{all} \definecolor{fondpaille}{cmyk}{0,0,0.1,0} \color{Maroon} \tkzSetUpColors[background=fondpaille,text=Maroon] \begin{document} \begin{tikzpicture} \tkzDefPoint(0,0){A} ...


12

\lstinputlisting{} should not be inside a \begin{lstlisting} and \end{lstlisting} pair. Remove the begin and end and it should work as expected.


12

I found a better solution using the wallpaper package, replacing foo and bar produces the desired result. \documentclass{article} \usepackage{lipsum}% http://ctan.org/pkg/lipsum \usepackage{wallpaper} \begin{document} \ULCornerWallPaper{1}{foo} \LLCornerWallPaper{1}{bar} \lipsum[1-3] \end{document}


12

It is also easy with pgfplots \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis} \addplot+[domain=0:360,samples=101,no marks] ({sin(x)},{cos(3*x)}); \end{axis} \end{tikzpicture} \end{document}


11

I ran into this issue, and after some time spent banging my head against a post, I did reach a solution. After installing the package, run the following steps from the inconsolata README: initexmf --update-fndb initexmf --edit-config-file updmap The latter command should open updmap.cfg in your default editor, commonly Notepad. Add the line Map zi4.map ...


11

The best thing is to export everything from Inkscape but here I've just exported the R letter and placed it over the ellipses via the old logo colors. You might need to adjust it properly I'm just approximating here. \documentclass[tikz]{standalone} \definecolor{rlogo}{RGB}{126,142,176} \begin{document} \begin{tikzpicture} \shade[even odd rule,shading ...



Only top voted, non community-wiki answers of a minimum length are eligible