Tag Info

Hot answers tagged

34

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


30

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


28

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


26

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


21

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


16

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


15

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

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


14

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

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.


13

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


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


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

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

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}


11

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


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


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


10

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


10

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


9

If you're willing to add a single space before the <<>> and the @, that'll do the trick. (The Sweave driver only interprets as chunks blocks of text beginning with <<>>= at the beginning of a line -- no spaces allowed!) Your input file will now look like this: \documentclass{article} \begin{document} \begin{verbatim} ...


9

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


9

There's a venn package on CTAN: "Creating Venn diagrams with MetaPost." Example code (from README): draw_venn_two(true,false,true,false) shifted (2in,1in); draws a diagram with the outer box shaded, with the first circle but not the second unshaded, with the intersection of the two shaded, and with the second circle but not the first unshaded. That is, ...


9

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.


9

Here is an example where I shamelessly copied some R code from Cross-Validated. It can be compiled in many ways, but personally I used R CMD Sweave 1.Rnw pdflatex 1.tex where 1.Rnw actually reads: \documentclass[a4paper,11pt]{article} \title{A sample Sweave demo} \author{Author name} \date{} \begin{document} ...


9

User defined constants: \const{HalfCanvas}{1.5}% half of canvas width or height \const{InitAngleD}{30}% initial angle \const{MainR}{1}% main radius \const{ChildR}{2}% child radius \documentclass{beamer} \usepackage{pstricks-add} \usepackage[nomessages]{fp} \def\const#1#2{% \expandafter\FPeval\csname#1\endcsname{round(#2:3)}% ...


8

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


8

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


8

It is easy to generate such messages: \documentclass{article} \begin{document} äö¿ \end{document} But to be able to know what in your document is the source of the message a complete example is needed.



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