Günter Milde
2017-02-08 16:49:39 UTC
I don't like the idea of local commands/environments just for class handling.
Instead, I propose wrapping elements in a group or environment if there are class arguments present. Standard environments could then be easily redefined in preamble, stylesheet, or raw latex code
- see attached patch and examples.
Attachments:
- [class-wrapper-test.tex](https://sourceforge.net/p/docutils/patches/_discuss/thread/23ac30c5/be1e/attachment/class-wrapper-test.tex) (6.7 kB; text/x-tex)
---
** [patches:#99] latex2e: Handle classes for bullet & field lists**
**Status:** open
**Group:**
**Created:** Thu Nov 15, 2012 03:22 PM UTC by Kirill Smelkov
**Last Updated:** Fri Aug 15, 2014 01:39 AM UTC
**Owner:** nobody
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
\newenvironment\{DUitemizecompact\}\{%
\begingroup%
\small%
\begin\{itemize\}%
\itemsep=0pt\parskip=0pt%
\}\{%
\end\{itemize\}%
\endgroup%
\}
which make text a bit smaller and tightens inter-line gaps.
NOTES:
\* 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.
---
Sent from sourceforge.net because docutils-***@lists.sourceforge.net is subscribed to https://sourceforge.net/p/docutils/patches/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
Instead, I propose wrapping elements in a group or environment if there are class arguments present. Standard environments could then be easily redefined in preamble, stylesheet, or raw latex code
- see attached patch and examples.
Attachments:
- [class-wrapper-test.tex](https://sourceforge.net/p/docutils/patches/_discuss/thread/23ac30c5/be1e/attachment/class-wrapper-test.tex) (6.7 kB; text/x-tex)
---
** [patches:#99] latex2e: Handle classes for bullet & field lists**
**Status:** open
**Group:**
**Created:** Thu Nov 15, 2012 03:22 PM UTC by Kirill Smelkov
**Last Updated:** Fri Aug 15, 2014 01:39 AM UTC
**Owner:** nobody
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
\newenvironment\{DUitemizecompact\}\{%
\begingroup%
\small%
\begin\{itemize\}%
\itemsep=0pt\parskip=0pt%
\}\{%
\end\{itemize\}%
\endgroup%
\}
which make text a bit smaller and tightens inter-line gaps.
NOTES:
\* 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.
---
Sent from sourceforge.net because docutils-***@lists.sourceforge.net is subscribed to https://sourceforge.net/p/docutils/patches/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.