On 12/1/20 7:39 AM, Hal Kierstead wrote:
> All -
>
> I know how to use inline enumerate (enumitem[enumerate*]) in LaTeX. Is there
> a good way to use it in LyX without ERT? Among other problems, it seems that
> in order to use the enumitem[enumerate*] package option I need to turn off
> the enumitem module.
The attached is a hacked version of the enumitem module with additional
list types, including inline. You can either put it into your layouts/
directory as is, in which case it will replace the official version, or
rename it and put it there, in which case it will give you a different
option.
Riki
#\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 <[email protected]>
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-RomanUpper
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 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 alphbare
Preamble
\newlist{alphbare}{enumerate}{1}
\setlist[alphbare]{label=(\alph*),ref=\alph*,leftmargin=*,align=left}
EndPreamble
End
Style Inline-Enumerate-Roman
CopyStyle Enumerate-Roman
LatexName romaninline
Preamble
\newlist{romaninline}{enumerate*}{1}
\setlist[romaninline]{label=(\roman*)}
EndPreamble
End
Style Inline-Enumerate-Arabic
CopyStyle Enumerate
LatexName arabicinline
Preamble
\newlist{arabicinline}{enumerate*}{1}
\setlist[arabicinline]{label=(\arabic*)}
EndPreamble
End
--
lyx-users mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-users