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
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}
>> 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
>> 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