emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Michael Gauland <mikelygee@no8wireless.co.nz>
Cc: emacs-orgmode@gnu.org
Subject: Re: [new exporter]: LaTeX output from babel escapes comment delimiter
Date: Wed, 24 Oct 2012 15:14:15 -1000	[thread overview]
Message-ID: <m1bofrjqu0.fsf@poto.myhome.westell.com> (raw)
In-Reply-To: <loom.20121025T021200-299@post.gmane.org> (Michael Gauland's message of "Thu, 25 Oct 2012 00:15:59 +0000 (UTC)")

Aloha Mike,

It looks like your source block and results are indented.  IIRC, that's
not a good thing.

This might work better:

#+name: gauland-eg
#+HEADER: :results output raw
#+HEADER: :exports results
#+BEGIN_SRC R
  library(xtable)
  library(ascii)
  print(ascii(xtable(matrix(c(1,2,3,4),nrow=2,ncol=2))),type="org")
#+END_SRC

#+results: gauland-eg
|   |    1 |    2 |
|---+------+------|
| 1 | 1.00 | 3.00 |
| 2 | 2.00 | 4.00 |

Then you can let the new exporter do the work of making the LaTeX export
look nice. This has the (possible) advantage that it also exports to the
other back ends, not just LaTeX.

hth,
Tom

Michael Gauland <mikelygee@no8wireless.co.nz> writes:

> I use the xtables package in R to generate nice-looking tables for LaTeX output,
> as in the snippet below. The new exporter escapes the % symbol in the R output,
> so that the comments generated by xtable are no longer comments. 
>
> * Snippet
>   #+HEADER: :results output latex
>   #+HEADER: :exports results
>   #+BEGIN_SRC R
>   library(xtable)
>   xtable(matrix(c(1,2,3,4),nrow=2,ncol=2))
>   #+END_SRC
>
>   #+RESULTS:
>   #+BEGIN_LaTeX
>   % latex table generated in R 2.15.1 by xtable 1.7-0 package
>   % Thu Oct 25 13:11:30 2012
>   \begin{table}[ht]
>   \begin{center}
>   \begin{tabular}{rrr}
>     \hline
>    & 1 & 2 \\ 
>     \hline
>   1 & 1.00 & 3.00 \\ 
>     2 & 2.00 & 4.00 \\ 
>      \hline
>   \end{tabular}
>   \end{center}
>   \end{table}
>   #+END_LaTeX

-- 
Thomas S. Dye
http://www.tsdye.com

  reply	other threads:[~2012-10-25  1:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  0:15 [new exporter]: LaTeX output from babel escapes comment delimiter Michael Gauland
2012-10-25  1:14 ` Thomas S. Dye [this message]
2012-10-25  3:41   ` Nick Dokos
2012-10-25 12:08     ` Nicolas Goaziou
2012-10-25 22:20       ` Michael Gauland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1bofrjqu0.fsf@poto.myhome.westell.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mikelygee@no8wireless.co.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).