From mboxrd@z Thu Jan 1 00:00:00 1970 From: Douglas Bates Subject: Re: [babel] configuring LaTeX exports verbatim environment for exported code and results Date: Tue, 31 Aug 2010 08:28:19 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=43405 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OqQt0-0002U1-0n for emacs-orgmode@gnu.org; Tue, 31 Aug 2010 09:28:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OqQsu-0008TM-Gq for emacs-orgmode@gnu.org; Tue, 31 Aug 2010 09:28:25 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:50038) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OqQsu-0008T8-E5 for emacs-orgmode@gnu.org; Tue, 31 Aug 2010 09:28:20 -0400 Received: by iwn33 with SMTP id 33so8667826iwn.0 for ; Tue, 31 Aug 2010 06:28:19 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Tue, Aug 31, 2010 at 8:08 AM, Douglas Bates wrote: > I have been unable to find in the documentation whether the verbatim > environment created by LaTeX exports of source code blocks can be > configured. > > Exporting to LaTeX a section like > > --8<---------------cut here---------------start------------->8--- > #+LaTeX_CLASS: beamer > #+LaTeX_CLASS_OPTIONS: [presentation] > #+BEAMER_FRAME_LEVEL: 1 > #+BABEL: :session :exports both :results output :tangle yes > > * Fitting a simple linear regression > #+begin_src R :exports results > options(show.signif.stars=3DFALSE) > #+end_src > #+begin_src R > summary(fm1 <- lm(optden ~ carb, Formaldehyde)) > #+end_src > A final line. > --8<---------------cut here---------------end--------------->8--- > > produces the LaTeX section > > --8<---------------cut here---------------start------------->8--- > \begin{frame}[fragile] > \frametitle{Fitting a simple linear regression} > \label{sec-1} > > \begin{verbatim} > summary(fm1 <- lm(optden ~ carb, Formaldehyde)) > \end{verbatim} > > > > \begin{verbatim} > > Call: > lm(formula =3D optden ~ carb, data =3D Formaldehyde) > > Residuals: > =A0 =A0 =A0 =A01 =A0 =A0 =A0 =A0 2 =A0 =A0 =A0 =A0 3 =A0 =A0 =A0 =A0 4 = =A0 =A0 =A0 =A0 5 =A0 =A0 =A0 =A0 6 > -0.006714 =A00.001029 =A00.002771 =A00.007143 =A00.007514 -0.011743 > > Coefficients: > =A0 =A0 =A0 =A0 =A0 =A0Estimate Std. Error t value Pr(>|t|) > (Intercept) 0.005086 =A0 0.007834 =A0 0.649 =A0 =A00.552 > carb =A0 =A0 =A0 =A00.876286 =A0 0.013535 =A064.744 3.41e-07 > > Residual standard error: 0.008649 on 4 degrees of freedom > Multiple R-squared: 0.999, =A0 =A0 =A0Adjusted R-squared: 0.9988 > F-statistic: =A04192 on 1 and 4 DF, =A0p-value: 3.409e-07 > \end{verbatim} > > A final line. > \end{frame} > --8<---------------cut here---------------end--------------->8--- > > Because both the source and the results are presented in verbatim, I > don't have much control over the appearance of the code on the slide. > If I could, for example, configure the names of the exported > environment for the source code and for the results separately, I > could use LaTeX's fancyvrb.sty to adjust font sizes, colors, boxes, > etc. I just realized that if the code and results are wrapped in other than the verbatim environment the org-beamer-fragile-re variable will need to be customized. (By the way, automatically detecting the need for the fragile option is a great idea.) > Also, the blank lines before and after the verbatim environment are > problematic. =A0In plain text it makes sense to delimit code chunks with > blank lines but in LaTeX a blank line starts a new paragraph and you > don't always want that. > > As this is my first posting please let me know if I have inadvertently > violated conventions of the list. Well, other than my cut-and-paste glich below :-/ > > Also, the exports append blank lines >