Le 23/10/2019 à 10:49, Jean-Marc Lasgouttes a écrit :
Concerning the issue that you discussed in lyx-users of having an enumerated list for legal documents, it seems to be easy with enumitem and I can try to provide a module for that.

Here is a first go at it. Things to discuss:
- it is limited to a depth of 4 like enumerate. Is it necessary to go further? - I opted to create the new list type Legal. Would you prefer to redefine enumerate instead (advantage: the key bindings for Itemize can be used).

Regards,
JMarc


#\DeclareLyXModule[enumitem.sty]{Legal}
#\DeclareCategory{List Enhancements}
#DescriptionBegin
#Adds a Legal list type where labels are nested like 1.1.2.
#DescriptionEnd

Counter legali
        LabelString          "\arabic{legali}."
End

Counter legalii
        Within               legali
        LabelString          "\thelegali\arabic{legalii}."
End

Counter legaliii
        Within               legalii
        LabelString          "\thelegalii\arabic{legaliii}."
End

Counter legaliv
        Within               legaliii
        LabelString          "\thelegaliii\arabic{legaliv}."
End

Style Legal
        CopyStyle Enumerate
        LatexName             legal
        LabelCounter          "legal"
        RefPrefix             leg
        Requires enumitem
        Preamble
          \newlist{legal}{enumerate}{4}
          \setlist[legal]{label*=\arabic*.}
        EndPreamble
End

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to