1 Mar 12:52 2011

Re: handling of literal block in LaTeX (esp in slides)

On 2011-02-28, Alan G Isaac wrote:
>> On 2011-02-21, Alan G Isaac wrote:
>>>  Why are literal blocks put in a quote environment?

>> Because this shows up in the PDF similar to the way they are presented
>> in HTML (indented and with vertical separation).

> This seems to justify an unfortunate LaTeX display by
> referencing an unfortunate HTML display, which in turn
> is (I think?) just a reflection of unfortunate decisions
> early on in various browsers.  (I don't think it reflects
> a W3C recommendation.)

It is a style decision (unfortunate or not) made early on in the default
Docutils CSS stylesheet. Together with a different background colour, it
served to highlight literal blocks.

It also reflects the layout of the source, where literal blocks are
indented and only different from quote-blocks by the preceding ::.

> In any case, two comments on LaTeX output.

> 1. Can we agree this is undesirable in *slides* at least?

I have no generic personal preference and believe there is no "correct"
one-size-fits-all layout not even for slides.

> Code I need to display gets cutoff *because of* this
> quote environment.



1 Mar 14:19 2011

Re: handling of literal block in LaTeX (esp in slides)

>> >  2. Given (1), then we should allow easy styling, and
>> >  nesting in a quote environment does not (because it
>> >  abuses the quote environment).

On 3/1/2011 6:52 AM, Guenter Milde wrote:
> I dispute that nesting in a quote environment is an abuse but agree that
> it hinders styling.

For LaTeX writers it is an abuse of the quote environment
because LaTeX environments are not context sensitive.
This means I cannot change the indent for code without
changing the indent for real quotes.

It is really a very bad solution, and I beg
for this to be acknowledged and changed.

How about polling to see if *anyone* wants lstlisting
environments to be in quote environments.  (Anyone?)

Note that anyone who wants an indented literal block
can just indent it (in the reST source).  That is the
natural and much better approach.

Alan

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business


1 Mar 14:23 2011

Re: handling of literal block in LaTeX (esp in slides)

On 3/1/2011 6:52 AM, Guenter Milde wrote:
> E.g. I searched the listings package documentation but found no way to
> configure the block-indent of an lstlisting.
>

Change xleftmargin.

The listlistings package is very complete.
Please do not "muck with it".  People who
use it will want it to work correctly.

Alan Isaac

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev

2 Mar 09:03 2011

Re: handling of literal block in LaTeX (esp in slides)

On 2011-03-01, Alan G Isaac wrote:
> On 3/1/2011 6:52 AM, Guenter Milde wrote:
>> E.g. I searched the listings package documentation but found no way to
>> configure the block-indent of an lstlisting.

> Change xleftmargin.

Thanks.

Just below on the same page I found another possible solution for your
problem.

In the custom preamble or stylesheet write::

\usepackage{listings}
\lstset{resetmargins=true}

and also the quote margins are reset (as LaTeX quotes inherit from the
generic "list" environment).

Alternatively, use xleftmargin with a negative value or break lines with
breaklines=true.

Besides this, I recommend txtt as monotype font. Its a bit heavier than the
very light Courier and also less wide.

Günter

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in


2 Mar 14:52 2011

Re: handling of literal block in LaTeX (esp in slides)

On 3/2/2011 3:03 AM, Guenter Milde wrote:
> also the quote margins are reset (as LaTeX quotes inherit from the
> generic "list" environment).
>
> Alternatively, use xleftmargin with a negative value or break lines with
> breaklines=true.
>

I'm not sure which you are doing:

1. Trying to help me with my immediate problem. (Thanks.
I did not know the resetmargins option, and it helps.)

or

2. Offering a justification for not fixing the writer.

I hope not (2).  The very nature of the proposed fixes
shows that the current approach is **broken**.
While there may be a hack that fixes things for those
using the listings packages, *if* they can find that solution,
that is pure accident and may well not apply to other packages
that users might choose.  They current behavior is still a bug.

A user who chooses to use e.g. the listings package
should get the *expected behavior* and currently does not.

Note that nobody on this list has spoken in defense of putting


2 Mar 09:11 2011

Re: handling of literal block in LaTeX (esp in slides)

On 2011-03-01, Alan G Isaac wrote:
>>> >  2. Given (1), then we should allow easy styling, and
>>> >  nesting in a quote environment does not (because it
>>> >  abuses the quote environment).

> On 3/1/2011 6:52 AM, Guenter Milde wrote:
>> I dispute that nesting in a quote environment is an abuse but agree that
>> it hinders styling.

> For LaTeX writers it is an abuse of the quote environment
> because LaTeX environments are not context sensitive.

The noun abuse has 3 senses (first 1 from tagged texts)

1. (1) maltreatment, ill-treatment, ill-usage, abuse -- (cruel or
inhumane treatment; "the child showed signs of physical abuse")

2. abuse, insult, revilement, contumely, vilification -- (a rude
expression intended to offend or hurt; "when a student made a stupid
mistake he spared them no abuse"; "they yelled insults at the visiting
team")

3. misuse, abuse -- (improper or excessive use; "alcohol abuse"; "the
abuse of public funds")

In my view, this far less severe than "alcohol abuse" or "the abuse of
public funds" and does not merit such a harsh naming.

> This means I cannot change the indent for code without
> changing the indent for real quotes.


2 Mar 17:30 2011

Re: handling of literal block in LaTeX (esp in slides)

On 3/2/2011 8:52 AM, Alan G Isaac wrote:
>      I did not know the resetmargins option, and it helps.)

BUT I now see that it has a side effect:
it resets margins all the way down,
not just in the parent environment.
So it is not a real solution either.

Alan

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev

3 Mar 09:01 2011

Re: handling of literal block in LaTeX (esp in slides)

On 2011-03-02, Alan G Isaac wrote:
> On 3/2/2011 8:52 AM, Alan G Isaac wrote:
>>      I did not know the resetmargins option, and it helps.)

> BUT I now see that it has a side effect:
> it resets margins all the way down,
> not just in the parent environment.
> So it is not a real solution either.

So the best current workaround for you might be
xleftmargin with a negative value.

Günter

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Docutils-users mailing list
Docutils-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users


3 Mar 09:17 2011

Re: handling of literal block in LaTeX (esp in slides)

On 2011-03-02, Alan G Isaac wrote:
> On 3/2/2011 3:03 AM, Guenter Milde wrote:
>> also the quote margins are reset (as LaTeX quotes inherit from the
>> generic "list" environment).

>> Alternatively, use xleftmargin with a negative value or break lines with
>> breaklines=true.

> I'm not sure which you are doing:

> 1. Trying to help me with my immediate problem. (Thanks.
>     I did not know the resetmargins option, and it helps.)

> or

> 2. Offering a justification for not fixing the writer.

Both.

> I hope not (2).  The very nature of the proposed fixes
> shows that the current approach is **broken**.
> While there may be a hack that fixes things for those
> using the listings packages, *if* they can find that solution,
> that is pure accident and may well not apply to other packages
> that users might choose.  They current behavior is still a bug.

> A user who chooses to use e.g. the listings package
> should get the *expected behavior* and currently does not.


3 Mar 15:08 2011

Re: handling of literal block in LaTeX (esp in slides)

On 3/3/2011 3:17 AM, Guenter Milde wrote:
> I see it as a feature request "make literal block indentation
> configurable in LaTeX output".

I know you are redescribing it that way, but it
is a bug report:  when a user requests a lstlisting
environment, give it to them, as the documentation
appears to promise.

Right now, the user does not get what is promised.
And it breaks the display.

Query: do you actually use lstlisting?  Because I do
all the time.  And I can tell you plainly: the
current behavior is undesirable.

Alan Isaac

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev


Gmane