On 04/08/2014 05:31 PM, Alex Vergara Gil wrote:
Dear lyxers!
Is there a better way to switch between enumerated lists from a); b) ... to 1.; 2. ... and so on without the need of the tex hack \renewcommand{\labelenumi{alph | roman | arabic{enumi}} ) | . | .- | - } ???
Shouldn't there exists a gui to handle this???

The Customized Lists module contains some lists to do this. You can easily add moreby following the same pattern. I'm attaching my hacked version.

Richard

#\DeclareLyXModule{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 <mi...@users.berlios.de>

Format 35

# 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]
        OptionalArgs          0
        # a blue label to indicate that this is not a WYSIWYG label
        # (the numbering differs in the output)
        LabelFont
                Color                      blue
        EndFont
End

Style Enumerate-Roman
        CopyStyle     Enumerate
        OptionalArgs  0
        LatexName     romanlist
        # a blue label to indicate that this is not a WYSIWYG label
        # we don't get roman
        LabelFont
                Color blue
        EndFont
        Preamble
                \newlist{romanlist}{enumerate}{1}
                \setlist[romanlist]{label=(\roman*),leftmargin=*,align=left}
        EndPreamble
End
  
Style Roman-Resume
        CopyStyle Enumerate-Roman
        LatexParam "[resume]"
        # a blue label to indicate that this is not a WYSIWYG label
        # we don't get roman
        LabelFont
                Color blue
        EndFont
        Preamble
        EndPreamble
End

Style Roman-Bare
        CopyStyle Enumerate-Roman
        LatexName romanbare
        Preamble
                \newlist{romanbare}{enumerate}{1}
                
\setlist[romanbare]{label=(\roman*),ref=\roman*,leftmargin=*,align=left}
        EndPreamble
End

Style Enumerate-Alpha
        CopyStyle     Enumerate
        OptionalArgs  0
        LatexName     alphlist
        # a blue label to indicate that this is not a WYSIWYG label
        # we don't get roman
        LabelFont
                Color blue
        EndFont
        Preamble
                \newlist{alphlist}{enumerate}{1}
                \setlist[alphlist]{label=(\alph*),leftmargin=*,align=left}
        EndPreamble
End
  
Style Alpha-Resume
        CopyStyle Enumerate-Alpha
        LatexParam "[resume]"
        # a blue label to indicate that this is not a WYSIWYG label
        # we don't get roman
        LabelFont
                Color blue
        EndFont
        Preamble
        EndPreamble
End

Style Alpha-Bare
        CopyStyle Enumerate-Alpha
        LatexName arabbare
        Preamble
                \newlist{alphbare}{enumerate}{1}
                
\setlist[alphbare]{label=(\alph*),ref=\alph*,leftmargin=*,align=left}
        EndPreamble
End

Reply via email to