From: Nick Dokos <nicholas.dokos@hp.com>
To: Bastien <bzg@altern.org>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: BUG: example/src blocks and latex export
Date: Fri, 19 Aug 2011 19:11:01 -0400 [thread overview]
Message-ID: <13789.1313795461@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Bastien <bzg@altern.org> of "Fri\, 19 Aug 2011 23\:27\:47 +0200." <874o1d6qi4.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1967 bytes --]
Bastien <bzg@altern.org> wrote:
> Hi Nick,
>
> Nick Dokos <nicholas.dokos@hp.com> 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).
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
[-- Attachment #2: [PATCH 2/2] Get rid of gratuitous newline after listing/minted --]
[-- Type: text/plain, Size: 1094 bytes --]
From 5337cbb0669c6b05170190ec1e5751bdcf132d87 Mon Sep 17 00:00:00 2001
From: Nick Dokos <nick@dokosmarshall.org>
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 <nick@dokosmarshall.org>
---
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)))))))
--
1.7.5.1.169.g505a1
next prev parent reply other threads:[~2011-08-19 23:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 10:09 BUG: example/src blocks and latex export Nick Dokos
2011-08-19 13:49 ` Eric Schulte
2011-08-19 15:27 ` Nick Dokos
2011-08-19 19:59 ` Nick Dokos
2011-08-19 21:27 ` Bastien
2011-08-19 22:03 ` Nick Dokos
2011-08-19 23:11 ` Nick Dokos [this message]
2011-08-21 18:30 ` Eric Schulte
2011-08-21 18:28 ` Eric Schulte
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13789.1313795461@alphaville.dokosmarshall.org \
--to=nicholas.dokos@hp.com \
--cc=bzg@altern.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.