The attached module enables resuming an enumeration with the new
Enumerate-Resume style. See the example file for usage details.

It also allows customising base lists with optional arguments
(Still to be found under Einfügen>Kurztitel.)

> Why not use a different Style for a "resuming enumeration"?

My question at comp.text.tex revealed two lyx-compatible solutions:

a) using the enumitem.sty package (as the enumitem modue does),

b) defining a "resuming" enumerate* environment (no package dependency)
   (see below).

Günter

::

  % Heiko <[EMAIL PROTECTED]> wrote:
  % The following solution uses \usecounter as hook into the code of
  % \enumerate: 
  
  \documentclass{article}
  
  \makeatletter
  \newenvironment{enumerate*}{%
    [EMAIL PROTECTED]
    \def\usecounter##1{%
      \begingroup
        \edef\x{\endgroup
          [EMAIL PROTECTED]
          \noexpand\setcounter{##1}{\the\value{##1}}%
        }%
      \x
      [EMAIL PROTECTED]
    }%
    \enumerate
  }{%
    [EMAIL PROTECTED]
  }
  \makeatother
  
  \begin{document}
  
  \begin{enumerate}
  \item first
  \item list
  \end{enumerate}
  regular text
  \begin{enumerate*}
  \item resumed
  \end{enumerate*}
  
  \end{document}
#\DeclareLyXModule[enumitem.sty]{Customisable Lists (enumitem)}
#DescriptionBegin
# Control the layout of enumerate, itemize and description
# with an optional argument.
# See http://dante.ctan.org/CTAN/macros/latex/contrib/enumitem/enumitem.pdf
#DescriptionEnd
# Author: Günter Milde <[EMAIL PROTECTED]>

Format 11

# The package enumitem provides user control over the layout of the three
# basic list environments: enumerate, itemize and description. It supersedes
# both enumerate and mdwlist (providing well-structured replacements for all
# their funtionality), and in addition provides functions to compute the
# layout of labels, and to ‘clone’ the standard environments, to create new
# environments with counters of their own.
#
# - fancy labels and fancy refs,
# - leftmargin, labelsep and labelwidth automatically set,
# - changes applied globally or only in one of the three
#   types or even in a single list (including topsep) by
#   means of a sort of "inheritance",
# - several description styles (which fix some bad
#   spacing, too),
# - starting value and counter resuming,
# - trivlists properly formatted,
# - control on page breaking
#
# Styling the basic lists is possible 
#
# a) generally in the LaTeX preamble and 
# b) per environment with optional arguments
#
# See enumitem.pdf_ for details and examples.

AddToPreamble
        \usepackage{enumitem}
EndPreamble

# ensure the stdlist layouts are present (unmodified) 
# (as e.g. the KOMA script classes obsolete lyx-list with labeling)
# TODO: is this secure?

Input stdlists.inc

# Customizable Basic Lists
# ------------------------

# With enumitem, the three standard list environments take an optional
# argument. See enumitem.pdf_ for possible values.

Style Itemize
        OptionalArgs          1
End

Style Enumerate
        OptionalArgs          1
End

Style Description
        OptionalArgs          1
End

# List Variants
# -------------
#
# Styles with pre-defined optional arguments for ease of use

Style Enumerate-Resume
        CopyStyle             Enumerate
        LatexParam            [resume]
#       LatexParam            [resume*] # reuse optional arguments
        OptionalArgs          0
End


# .. _enumitem.pdf:
#    http://dante.ctan.org/CTAN/macros/latex/contrib/enumitem/enumitem.pdf      
LatexParam            [resume*] # reuse also optional arguments

Attachment: enumitem-module.lyx
Description: application/lyx

Reply via email to