From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [new exporter]: LaTeX output from babel escapes comment delimiter Date: Wed, 24 Oct 2012 23:41:06 -0400 Message-ID: <4676.1351136466@alphaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TREJs-0003b7-4A for emacs-orgmode@gnu.org; Wed, 24 Oct 2012 23:41:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TREJq-0001tI-Lk for emacs-orgmode@gnu.org; Wed, 24 Oct 2012 23:41:20 -0400 Received: from g1t0027.austin.hp.com ([15.216.28.34]:43521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TREJq-0001su-EI for emacs-orgmode@gnu.org; Wed, 24 Oct 2012 23:41:18 -0400 In-Reply-To: Message from tsd@tsdye.com (Thomas S. Dye) of "Wed, 24 Oct 2012 15:14:15 -1000." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" Cc: emacs-orgmode@gnu.org, Michael Gauland Thomas S. Dye wrote: > 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. > I agree with Tom's comments in general, although there might exist special situations where the output would have to be tweaked and made less generic. But even in the original form below, I cannot reproduce Michael's problem: the % signs are not escaped. I get --8<---------------cut here---------------start------------->8--- \section{Snippet} \label{sec-1} % latex table generated in R 2.12.1 by xtable 1.5-6 package % Wed Oct 24 23:38:22 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} % Generated by Org mode 7.9.2 in Emacs 24.2.50.1. --8<---------------cut here---------------end--------------->8--- Org-mode version 7.9.2 (release_7.9.2-459-g6f7e92 @ /home/nick/elisp/org-mode/lisp/) Nick > > Michael Gauland 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 >