Menu

#209 rst2latex uses quote environment for literal blocks

closed-fixed
nobody
None
5
2020-03-03
2012-10-20
Alan
No

The rst2latex writer places literal blocks in a quote environment. This abuse of the quote environment means that quotes cannot be styled without affecting literal blocks, which is clearly a bug in the writer.

Proposed solution: wrap literal blocks in a custom environment.

Comment: the reason literal blocks are wrapped in the quote environment is simply to force indentation of literal blocks. **Separately** from this bug, I would urge the developers to rethink this decision and leave it up to users. Forcing indentation introduces many problems. E.g., as a result of this imposition, the rst2beamer writer output is horrible when literal blocks are included. Although I have proposed a solution above that allows continuation of the current practice, I believe that a better solution is not to wrap literal blocks in an extra environment, and leave indentation decisions up to users. (Who can e.g. set the indentation of the listings environment.)

Discussion

  • Günter Milde

    Günter Milde - 2017-09-22
    • status: open --> pending-works-for-me
    • Group: --> sandbox
     
  • Günter Milde

    Günter Milde - 2017-09-22

    With the recent addition to class handling of environments in the latex writer, independent styling of quotes and literal blocks becomes possible (although tricky).
    Since 2017-09-22, the wrapping in quote environments is replaced by a global xleftmargin setting if "lstlistings" is used for literal blocks. This can be customized in preamble code or a custom style sheet.

     
  • Günter Milde

    Günter Milde - 2019-06-24
    • status: pending-works-for-me --> closed-fixed
    • Group: sandbox --> Default
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.