#99 latex2e: Handle classes for bullet & field lists


latex2e: Handle classes for bullet lists

For example authors could customize documents as follows:

.. class:: compact

- item 1
- item 2
- item 3

and expect the writer to apply the class. This works for html writer,
but not yet for latex2e/xetex and that's why this patch is here.

Usual rules for customizing rendering for classed elements is done - for
class `compact`, if stylesheet provides an environment named
DUitemizecompact, it will be used, otherwise the default itemize.

Personally, for compact lists I use


which make text a bit smaller and tightens inter-line gaps.


* There is no \provideenvironment in LaTeX, so plain \newenviroment is used.
* The implementation of DUitemize environment is a bit cumbersome.
That's because it is not possible to pass arguments to
end<something> when defining environments and because my TeX foo is
probably not high enough. (help appreciated)
* I've patched the code to emit \begin{DUitemize} only when classes
attrubute is present - only to minimize changes to tests, for the
patch not being huge with low signal/noise ratio.


  • Kirill Smelkov

    Kirill Smelkov - 2012-11-15

    NOTE: The TeX part of the patch (DUitemize environmet) probably needs polish, but if otherwise in general this approach is correct, I'd like to add more class handling to latex2e backend - for example to field lists and other environments.

    Thanks beforehand for your reply,

  • Kirill Smelkov

    Kirill Smelkov - 2012-11-15

    Simplified TeX preamble:

    PreambleCmds.itemize = r"""
    % bullet list
    % store #1 for end
    \ifcsname DUitemize#1\endcsname%
    %\begin{DUitemize#1}% XXX why this does not work?
    \ifcsname endDUitemize\DUitemizearg\endcsname%

  • Kirill Smelkov

    Kirill Smelkov - 2012-11-20

    Uploaded cleaned up patch and demo.

  • Kirill Smelkov

    Kirill Smelkov - 2012-11-28
    • summary: latex2e: Handle classes for bullet lists --> latex2e: Handle classes for bullet & field lists

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks