emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Extra space after listings in LaTeX export with minted
@ 2013-03-14 17:34 Richard Stanton
  2013-03-14 18:30 ` Aaron Ecay
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stanton @ 2013-03-14 17:34 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Using the minted package, I get very nice colored listings in the PDF
files generated by exporting to LaTeX, but there's always a lot of extra
space after each listing and before any text that immediately follows.
This seems to be an issue with the minted package itself, but I'm
wondering if anyone has come up with a  simple work-around (short of
inserting negative space after each listing).

Thanks.

Richard Stanton

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Extra space after listings in LaTeX export with minted
  2013-03-14 17:34 Extra space after listings in LaTeX export with minted Richard Stanton
@ 2013-03-14 18:30 ` Aaron Ecay
  2013-03-14 21:44   ` Richard Stanton
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ecay @ 2013-03-14 18:30 UTC (permalink / raw)
  To: Richard Stanton; +Cc: emacs-orgmode@gnu.org

Hi Richard,

2013ko martxoak 14an, Richard Stanton-ek idatzi zuen:
> 
> Using the minted package, I get very nice colored listings in the PDF
> files generated by exporting to LaTeX, but there's always a lot of extra
> space after each listing and before any text that immediately follows.
> This seems to be an issue with the minted package itself, but I'm
> wondering if anyone has come up with a  simple work-around (short of
> inserting negative space after each listing).

It looks like the answer to your question is “sort of”: there are
workarounds, though whether they qualify as simple is largely a matter
of taste.  Check out these two StackOverflow discussions on the topic
(including solutions):

http://stackoverflow.com/questions/2318598/how-to-reduce-the-seperation-from-other-text-using-latex-minted
http://tex.stackexchange.com/questions/37117/belowskip-on-minted

In general, the TeX StackExchange site (the second link) is a marvelous
resource for LaTeX-related questions.  Many questions are already
answered there (with a usable search interface), and the community is
very friendly and helpful for new questions/users.

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Extra space after listings in LaTeX export with minted
  2013-03-14 18:30 ` Aaron Ecay
@ 2013-03-14 21:44   ` Richard Stanton
  2013-03-14 23:03     ` Aaron Ecay
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stanton @ 2013-03-14 21:44 UTC (permalink / raw)
  To: Aaron Ecay; +Cc: emacs-orgmode@gnu.org

Thanks, Aaron. I ended up adding the line

#+LaTeX_HEADER: \addtolength\partopsep{-0.9cm}

to my org file. Not too complicated...


There's still one more (even more) minor problem, which is that minted
always indents the text immediately after a listing, but this I can
probably live with.

On 3/14/13 11:30 AM, "Aaron Ecay" <aaronecay@gmail.com> wrote:

>Hi Richard,
>
>2013ko martxoak 14an, Richard Stanton-ek idatzi zuen:
>> 
>> Using the minted package, I get very nice colored listings in the PDF
>> files generated by exporting to LaTeX, but there's always a lot of extra
>> space after each listing and before any text that immediately follows.
>> This seems to be an issue with the minted package itself, but I'm
>> wondering if anyone has come up with a  simple work-around (short of
>> inserting negative space after each listing).
>
>It looks like the answer to your question is ³sort of²: there are
>workarounds, though whether they qualify as simple is largely a matter
>of taste.  Check out these two StackOverflow discussions on the topic
>(including solutions):
>
>http://stackoverflow.com/questions/2318598/how-to-reduce-the-seperation-fr
>om-other-text-using-latex-minted
>http://tex.stackexchange.com/questions/37117/belowskip-on-minted
>
>In general, the TeX StackExchange site (the second link) is a marvelous
>resource for LaTeX-related questions.  Many questions are already
>answered there (with a usable search interface), and the community is
>very friendly and helpful for new questions/users.
>
>-- 
>Aaron Ecay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Extra space after listings in LaTeX export with minted
  2013-03-14 21:44   ` Richard Stanton
@ 2013-03-14 23:03     ` Aaron Ecay
  2013-03-15 17:45       ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ecay @ 2013-03-14 23:03 UTC (permalink / raw)
  To: Richard Stanton; +Cc: emacs-orgmode@gnu.org

Hi Richard,

You should be able to get rid of that indentation by arranging for the
text after the listing end to begin with \noindent{} (in LaTeX).  This
should be as simple, in org, as:

...
#+END_SRC

\noindent{}Lorem ipsum...

I am not sure there is a way to automate the \noindent: LaTeX indents
the beginning of paragraphs, and in org there is no way to have a
paragraph that contains a source listing.  (In latex there is: don’t
leave a blank line after the \end{minted}.  But I don’t think org has a
way to represent/output such a thing.  If I’m wrong about that I hope
Nicolas or someone else knowledgeable will chime in.)

I suppose it would be possible to write a filter to post-process the
LaTeX output, and delete single blank lines after an \end{foo}, and
indicate desired paragraph breaks with double blank lines.

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Extra space after listings in LaTeX export with minted
  2013-03-14 23:03     ` Aaron Ecay
@ 2013-03-15 17:45       ` Nicolas Goaziou
  2013-03-15 18:12         ` Richard Stanton
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2013-03-15 17:45 UTC (permalink / raw)
  To: Richard Stanton; +Cc: emacs-orgmode@gnu.org

Hello,

Aaron Ecay <aaronecay@gmail.com> writes:

> I am not sure there is a way to automate the \noindent: LaTeX indents
> the beginning of paragraphs, and in org there is no way to have a
> paragraph that contains a source listing.  (In latex there is: don’t
> leave a blank line after the \end{minted}.  But I don’t think org has a
> way to represent/output such a thing.  

Don't leave a blank line after the #+END_SRC.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Extra space after listings in LaTeX export with minted
  2013-03-15 17:45       ` Nicolas Goaziou
@ 2013-03-15 18:12         ` Richard Stanton
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Stanton @ 2013-03-15 18:12 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

You'd think so, but it actually doesn't make a difference. It's indented
even when there's no blank line in the LaTeX file. It's a minted
"feature", I think. I did email the minted author about it, so maybe one
day it'll be fixed.

On 3/15/13 10:45 AM, "Nicolas Goaziou" <n.goaziou@gmail.com> wrote:

>Hello,
>
>Aaron Ecay <aaronecay@gmail.com> writes:
>
>> I am not sure there is a way to automate the \noindent: LaTeX indents
>> the beginning of paragraphs, and in org there is no way to have a
>> paragraph that contains a source listing.  (In latex there is: don¹t
>> leave a blank line after the \end{minted}.  But I don¹t think org has a
>> way to represent/output such a thing.
>
>Don't leave a blank line after the #+END_SRC.
>
>
>Regards,
>
>-- 
>Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-15 18:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-14 17:34 Extra space after listings in LaTeX export with minted Richard Stanton
2013-03-14 18:30 ` Aaron Ecay
2013-03-14 21:44   ` Richard Stanton
2013-03-14 23:03     ` Aaron Ecay
2013-03-15 17:45       ` Nicolas Goaziou
2013-03-15 18:12         ` Richard Stanton

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).