On 2020-12-01, Richard Kimberly Heck wrote:

> [-- Type: text/plain, Encoding: 7bit --]

> 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.

Instead of modifying the existing layout, I recommend writing an additional
one that builds on it. This way, changes/fixes to the original will not be
masked by your local version.

I have e.g. in "~/.lyx/layouts/gm-lists.module" the code below.

Günter



#\DeclareLyXModule{gmlists}
#DescriptionBegin
# Adds quoted-list and condensed list environments.
#DescriptionEnd
#Requires: enumitem
#Author: Günter Milde <mi...@lyx.org>

# date: 2008-12-04
# last update: 2016-07-21

Format 49

# Style Variants
# ==============


Style Enumerate-Alpha
  CopyStyle    Enumerate
  LatexParam   "[label=\emph{\alph*}),ref=\emph{\alph*},fullwidth,itemsep=1ex]"
  Margin       First_Dynamic
  LeftMargin   xxxx
  LabelCounter enumi
  LabelString  "\alph{enumi})"
  LabelFont
    Series              Medium
    Shape               Italic
  EndFont
End


# Dense (condensed/compact) list environments
# ===========================================

Style Itemize-Compact
        CopyStyle             Itemize
        Argument 1
                LabelString   "Enumerate Options"
                Tooltip       "Optional arguments for this list (see enumitem 
manual)"
                PresetArg     noitemsep
        EndArgument
        ParSep                0
        TopSep                0.4
        BottomSep             0.4
End     

Style Enumerate-Compact
        CopyStyle             Enumerate
        Argument 1
                LabelString   "Enumerate Options"
                Tooltip       "Optional arguments for this list (see enumitem 
manual)"
                PresetArg     noitemsep
        EndArgument
        ParSep                0
        TopSep                0.4
        BottomSep             0.4
End     

Style Description-Compact
        CopyStyle             Description
        Argument 1
                LabelString   "Enumerate Options"
                Tooltip       "Optional arguments for this list (see enumitem 
manual)"
                PresetArg     noitemsep
        EndArgument
        ParSep                0
        TopSep                0.4
        BottomSep             0.4
End

# Indented compact LyX-List environment
Style Quoted-Labeling
        CopyStyle       Labeling
        LatexName       qlyxlist
        ItemSep         0
        ParSep          0
        LabelIndent     MMM
        Preamble
        % labeling-like list based on enumitem's description list with
        % mandatory second argument (label-pattern) and indent of 2em:
        \newenvironment{qlyxlist}[2][]%
          {\settowidth{\lyxlabelwidth}{#2}
           \addtolength{\lyxlabelwidth}{1.5em}
           \description[font=,style=sameline,
                             leftmargin=\lyxlabelwidth,
                             noitemsep, labelindent=1.5em,
                             #1]}
          {\enddescription}
        EndPreamble
        
End



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

Reply via email to