emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Austin F. Frank" <austin.frank@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [babel] Re: Removing the blank lines between code and results blocks in LaTeX export
Date: Thu, 09 Sep 2010 09:08:42 -0400	[thread overview]
Message-ID: <m062yfjc85.fsf@gmail.com> (raw)
In-Reply-To: AANLkTi=V_x2rP0LXNJZ=Rg_1WCjX7LoHPX8TOjq-wqa5@mail.gmail.com


[-- Attachment #1.1: Type: text/plain, Size: 3810 bytes --]

Professor Bates--

I used org, org-babel, and lme4 to write my PhD dissertation over the
past few months.  Thanks for your continued excellent work, and I'm glad
to see you here.  I look forward to reading the org source of your
beamer presentations!

Sorry that answers haven't been quicker to arrive-- the org-babel folks
are incredibly productive, but there's a lot on their plates.  One way
to get a quicker response to questions about org-babel is to prefix the
subject with a bracketed "babel" label, as I've done in this response.

On Mon, Sep 06 2010, Douglas Bates wrote:

> Recently Dan Davidson posted a patch to suppress the removal of blank
> lines in exported source code.  I have the opposite problem -
> suppression of blank lines added during LaTeX export
>
> ---- snip --- begin org file ----
> * An R example with :exports both
> The following code
> #+begin_src R :exports both :results output
> 2 + 2
> #+end_src
> shows that there are blank lines added between the code and the
> results sections in \LaTeX export.  Is this configurable? In \LaTeX{}
> the blank lines cause a new paragraph which often I don't want.
> --- snip --- end org file ---
>
> Just copy those lines to an org file and export it to LaTeX to see
> what I mean.

I had similar problems while writing my dissertation, and arrived at
this workaround:

--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC R :exports results :results output latex
library(lme4)
fit <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
latex(summary(fit)@coefs,
      file = "",
      dec = 3,
      center = "centering",
      caption = "Parameter estimates for reaction time data",
      label = "tab:reaction-mer")
#+END_SRC
--8<---------------cut here---------------end--------------->8---

Hopefully this will tide you over until Eric and Dan get a chance to
look at your example.  I recognize that it does not accomplish your goal
of typesetting your code according to your customizations, but it worked
for me for including results from mer models.  Please forgive the bad
practice of reaching directly into the summary object to print results
;)

> A related issue is the LaTeX environment for the results.  At present
> it is hard-wired in the function org-export-latex-fixed-width in
> org-latex.el to be the verbatim environment.  I would like to
> configure the appearance of the results using the LaTeX package
> fancyvrb and it would be much easier if I could customize the strings
> preceding and following the exported results.  The current strings are
> "\\begin{verbatim}\n" and "\\end{verbatim}\n\n" and, again, the two
> blank lines inserted after the results can be problematic.

I know Dan Davison has been working on using different verbatim
environments for latex export of source code blocks (not results),
having been dissatisfied with the defaults from listings.  I believe he
recently made the minted package available for LaTeX export-- this does
have some python language dependencies, so it still may not be your
answer.  For exporting source code (as opposed to tabular results), I
find the minted syntax highlighting to be very visually appealing.

Dan or Carsten, is it possible that org-export-latex-listings could be
reconfigured so that the package used for source code export in latex is
configurable?  Or does this functionality already exist and I've missed
it?

And, directly to Professor Bates' question, could a similar treatment be
given to the environment that controls export of verbatim regions?

Sorry not to provide a patch, I've got this pesky defense thing on
Monday.

/au

-- 
Austin Frank
http://aufrank.net
GPG Public Key (D7398C2F): http://aufrank.net/personal.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

      reply	other threads:[~2010-09-09 13:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-06 17:09 Removing the blank lines between code and results blocks in LaTeX export Douglas Bates
2010-09-09 13:08 ` Austin F. Frank [this message]

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=m062yfjc85.fsf@gmail.com \
    --to=austin.frank@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).