From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: BUG: example/src blocks and latex export Date: Sun, 21 Aug 2011 12:30:48 -0600 Message-ID: <87y5ymaa7b.fsf@gmail.com> References: <6977.1313748571@alphaville.dokosmarshall.org> <874o1d6qi4.fsf@gnu.org> <13789.1313795461@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvCnR-0005Gj-HM for emacs-orgmode@gnu.org; Sun, 21 Aug 2011 14:30:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvCnN-0006Ix-Uw for emacs-orgmode@gnu.org; Sun, 21 Aug 2011 14:30:57 -0400 Received: from mail-iy0-f175.google.com ([209.85.210.175]:36832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvCnN-0006It-Ni for emacs-orgmode@gnu.org; Sun, 21 Aug 2011 14:30:53 -0400 Received: by iyn15 with SMTP id 15so7524713iyn.6 for ; Sun, 21 Aug 2011 11:30:53 -0700 (PDT) In-Reply-To: <13789.1313795461@alphaville.dokosmarshall.org> (Nick Dokos's message of "Fri, 19 Aug 2011 19:11:01 -0400") 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: nicholas.dokos@hp.com Cc: Bastien , emacs-orgmode@gnu.org Nick Dokos writes: > Bastien wrote: > >> Hi Nick, >> >> Nick Dokos writes: >> >> > * foo >> > >> > Verbiage to begin the paragraph >> > #+begin_src shell >> > get-config.py var section [section ...] >> > #+end_src >> > and verbiage to end the same paragraph. >> > >> > * bar >> > >> > Verbiage to begin the paragraph >> > #+begin_example >> > get-config.py var section [section ...] >> > #+end_example >> > and verbiage to end the same paragraph. >> >> I tested your patch with the example above and I get this: >> >> ,---- >> | Verbiage to begin the paragraph >> | >> | \lstset{language=shell} >> | \begin{lstlisting} >> | get-config.py var section [section ...] >> | \end{lstlisting} >> | >> | and verbiage to end the same paragraph. >> | \section*{bar} >> | \label{sec-2} >> | >> | >> | Verbiage to begin the paragraph >> | >> | \begin{verbatim} >> | get-config.py var section [section ...] >> | \end{verbatim} >> | and verbiage to end the same paragraph. >> `---- >> >> It looks better than the current export (less white lines) but still >> has a problem with the first "and verbiage..." being indented. >> >> Is this intentional? Or do you want the same behavior for #+begin_src >> and #+begin_example? >> >> In overall, I think number of white lines should be the same in the Org >> source file and in the LaTeX exported file, so a patch here is welcome. >> But maybe I misunderstood something in Eric's reply. >> > > So here's another patch to get rid of some more newlines, these ones after > a listings or minted environment. I tried both with the previously posted file > and setting org-export-latex-listings to t or 'minted. AFAICT, it works as it > should and should not break anything else, but... This is to be applied on top > of the previous one (and it's still very much a trial balloon). > This seems like a logical extension of the previous patch, I've just applied this as well. Thanks Again -- Eric > > BTW, the defcustom of org-export-latex-listings seems to be outdated: > custom thinks it's a boolean, but it can now take at least one more value > (minted - see the docstring). > > Thanks, > Nick > > From 5337cbb0669c6b05170190ec1e5751bdcf132d87 Mon Sep 17 00:00:00 2001 > From: Nick Dokos > Date: Fri, 19 Aug 2011 18:36:50 -0400 > Subject: [PATCH 2/2] Get rid of gratuitous newline after listing/minted > environment. > > > Signed-off-by: Nick Dokos > --- > lisp/org-exp.el | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lisp/org-exp.el b/lisp/org-exp.el > index a2a2fb3..f795fbd 100644 > --- a/lisp/org-exp.el > +++ b/lisp/org-exp.el > @@ -2689,11 +2689,11 @@ INDENT was the original indentation of the block." > (format "\\begin{%s}\n%s\\end{%s}\n" > custom-environment rtn custom-environment)) > (listings-p > - (format "\\begin{%s}\n%s\\end{%s}\n" > + (format "\\begin{%s}\n%s\\end{%s}" > "lstlisting" rtn "lstlisting")) > (minted-p > (format > - "\\begin{minted}[%s]{%s}\n%s\\end{minted}\n" > + "\\begin{minted}[%s]{%s}\n%s\\end{minted}" > (mapconcat #'make-option-string > org-export-latex-minted-options ",") > backend-lang rtn))))))) -- Eric Schulte http://cs.unm.edu/~eschulte/