Numbered Lists features

Jean-Marc Lasgouttes lasgouttes at lyx.org
Wed Oct 23 09:48:07 UTC 2019


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


-------------- next part --------------
#\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



More information about the lyx-devel mailing list