Tag Info

Hot answers tagged

37

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) ...


35

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: ...


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 ...


29

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}% ...


28

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 ...


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! ...


21

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.


20

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


20

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, ...


20

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{(45:2cm) circle (1.5cm)} \def\thirdcircle{(0:2cm) circle (1.5cm)} ...


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

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} ...


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

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} ...


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

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 ...


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

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 ...


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 ...


11

In both cases, the Sweave chunks should not be indented. When the Sweave driver (a part of R) parses the input file, it recognizes as chunks of R code blocks that begin with a << at the start of a line, and end with a @. Because your << is not at the start of a line, those blocks are never run as R code, and no plots are produced.


11

You can use Sweave's results=tex code chunk argument to construct a LaTeX \input{} directive that will insert the text from whatever file path R constructed. This Sweave file (call it "example.Rnw") ... \documentclass{article} \usepackage{fancyvrb} \begin{document} <<text, echo=FALSE, results=tex>>= targetvar<-'abc' textfile <- ...


11

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} ...


11

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 ...


11

The best way I know to convert a TeX to an XML application is tex4ht. The project page says it converts TeX to a number of different output formats, including "(X)HTML, MathML, OpenDocument, and DocBook." I believe tex4ht can even convert tikz code to SVG graphics. Word supports OpenDocument, so in theory you could just open up the converted document in ...


11

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 ...


11

If you are not stuck on using fancyhdr, you could adapt the solution from How do I add an image in the upper, left-hand corner using TikZ and graphicx which uses the background package: Notes: Need at least two runs to see the images. Code: \documentclass[12pt]{article} \usepackage[demo]{graphicx} \usepackage[all]{background} \usepackage{lipsum} ...


11

This error message is low-level TeX output which shows up if you are typesetting material in a font (external name "cmr12" in your example) and you are trying to typeset a glyph that is not in the font. The ? is not a real question mark it stands for a character that is unknown. When you are typesetting a word, say, "aha" then deep down this is all ...


11

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}


10

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.


10

If you use MetaPost or Asymptote, there will be a different method: buildcycle. For example, Asymptote: size(200); defaultpen(black+1); pair A = (0,0), B = (1,0); path inter = buildcycle(arc(A,1,-90,90), arc(B, 1,90,270)); path outer = box((-2,-2), (3,2)); fill(outer, mediumgray); unfill(inter); // or use: // fill(outer ^^ inter, evenodd+mediumgray); ...



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