Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
literalinclude and line wrapping in Latex
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jose Gomez-Dans  
View profile  
 More options Feb 10 2012, 2:14 pm
From: Jose Gomez-Dans <gomezda...@gmail.com>
Date: Fri, 10 Feb 2012 11:14:05 -0800 (PST)
Local: Fri, Feb 10 2012 2:14 pm
Subject: literalinclude and line wrapping in Latex
Hi,

I am grabbing data from some configuration files using literalinclude.
These files are plain ASCII and are properly processed for the HTML
documentation. For the PDF, however, the lines are too long, and get
clipped out. I understand that this is because sphinx is putting the
contents into a Verbatim environment, that doesn't do line breaks.

I can't modify the input files and split them, as they are
configuration files. I was wondering whether there's something to let
latex/sphinx know that I want those lines wrapped? I think the
listings or minted packages deals with this problem, but haven't seen
them used in conjunction with sphinx.

Any pointers much appreciated!
Jose


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guenter Milde  
View profile  
 More options Feb 10 2012, 5:18 pm
From: Guenter Milde <mi...@users.sf.net>
Date: Fri, 10 Feb 2012 22:18:39 +0000 (UTC)
Local: Fri, Feb 10 2012 5:18 pm
Subject: Re: literalinclude and line wrapping in Latex
On 2012-02-10, Jose Gomez-Dans wrote:

> I am grabbing data from some configuration files using literalinclude.
> These files are plain ASCII and are properly processed for the HTML
> documentation. For the PDF, however, the lines are too long, and get
> clipped out. I understand that this is because sphinx is putting the
> contents into a Verbatim environment, that doesn't do line breaks.
> I can't modify the input files and split them, as they are
> configuration files. I was wondering whether there's something to let
> latex/sphinx know that I want those lines wrapped? I think the
> listings or minted packages deals with this problem, but haven't seen
> them used in conjunction with sphinx.

The Docutils latex writer has a config option to use the listings
environment for literal blocks. I don't know whether this is ported to
Sphinx, though.

Another option is to define a different "teletype" font in the LaTeX
preamble, e.g. with

  \renewcommand{\ttdefault}{txtt}

Günter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jose Gomez-Dans  
View profile  
 More options Feb 11 2012, 6:52 am
From: Jose Gomez-Dans <gomezda...@gmail.com>
Date: Sat, 11 Feb 2012 11:52:05 +0000
Local: Sat, Feb 11 2012 6:52 am
Subject: Re: [sphinx-dev] Re: literalinclude and line wrapping in Latex

Hi Guenter,

Thanks for your reply

On 10 February 2012 22:18, Guenter Milde <mi...@users.sf.net> wrote:

> The Docutils latex writer has a config option to use the listings
> environment for literal blocks. I don't know whether this is ported to
> Sphinx, though.

This would be ideal!

> Another option is to define a different "teletype" font in the LaTeX
> preamble, e.g. with

>  \renewcommand{\ttdefault}{txtt}

> But this just changes the font, and does not affect line wrapping. Or am I

missing something?

J


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guenter Milde  
View profile  
 More options Feb 11 2012, 3:10 pm
From: Guenter Milde <mi...@users.sf.net>
Date: Sat, 11 Feb 2012 20:10:04 +0000 (UTC)
Local: Sat, Feb 11 2012 3:10 pm
Subject: Re: literalinclude and line wrapping in Latex
On 2012-02-11, Jose Gomez-Dans wrote:

>> Another option is to define a different "teletype" font in the LaTeX
>> preamble, e.g. with
>>  \renewcommand{\ttdefault}{txtt}
>> But this just changes the font, and does not affect line wrapping. Or am I
> missing something?

The idea is to use a narrower font, as the default (both, courier and CM)
are rather wide. In some cases this already removes the need to wrap lines.

Günter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jose Gomez-Dans  
View profile  
 More options Feb 13 2012, 11:52 am
From: Jose Gomez-Dans <gomezda...@gmail.com>
Date: Mon, 13 Feb 2012 16:52:47 +0000
Local: Mon, Feb 13 2012 11:52 am
Subject: Re: [sphinx-dev] Re: literalinclude and line wrapping in Latex

Hi,

On 11 February 2012 20:10, Guenter Milde <mi...@users.sf.net> wrote:

> On 2012-02-11, Jose Gomez-Dans wrote:
> >> But this just changes the font, and does not affect line wrapping. Or
> am I
> > missing something?

> The idea is to use a narrower font, as the default (both, courier and CM)
> are rather wide. In some cases this already removes the need to wrap lines.

This won't work here, as some of these lines are rather long (easily 400
characters), so they'll need to be wrapped (or we start using A0 for our
manuals!) :-D I can edit the stuff in Verbatim environments to use
listings, but this is just a manual hack to produce a quick version.
Ideally, I'd like sphinx to take care of that.

J


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guenter Milde  
View profile  
 More options Feb 15 2012, 4:17 am
From: Guenter Milde <mi...@users.sf.net>
Date: Wed, 15 Feb 2012 09:17:07 +0000 (UTC)
Local: Wed, Feb 15 2012 4:17 am
Subject: Re: literalinclude and line wrapping in Latex
On 2012-02-13, Jose Gomez-Dans wrote:

> On 11 February 2012 20:10, Guenter Milde <mi...@users.sf.net> wrote:
>> On 2012-02-11, Jose Gomez-Dans wrote:
>> >> But this just changes the font, and does not affect line wrapping.
>> >> Or am I missing something?
>> The idea is to use a narrower font, as the default (both, courier and CM)
>> are rather wide. In some cases this already removes the need to wrap lines.
> This won't work here, as some of these lines are rather long (easily 400
> characters), so they'll need to be wrapped (or we start using A0 for our
> manuals!) :-D

I see.

> I can edit the stuff in Verbatim environments to use listings, but this
> is just a manual hack to produce a quick version. Ideally, I'd like
> sphinx to take care of that.

For fixing this in Sphinx, there are several options:

a) As a quick fix, overwrite the
   visit_literal_block/depart_literal_block methods in the latex writer
   to use listings.

b) As a medium fix, port the "literal_block_env" setting
   and its handling from the Docutils latex writer
   (docutils/docutils/writers/latex2e/__init__.py) to the Sphinx latex writer.

c) As a proper fix, let Sphinx use the Docutils latex writer (just like it
   does use the Docutils html writer).

Of course, you can also file a bug report instead of doing it yourself.

Günter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »