On 06/24/2014 01:16 AM, S Shieh wrote:
I "cloned," to use the terminology of the enumitem package
documentation section 7, a new itemize list and put it in the LaTeX
preamble of my Lyx file:
\newlist{emptydisplay}{itemize}{1}
\setlist[emptydisplay]{label={}, itemindent=1em, align=left, labelsep=!}
Now I can use this new itemize list by putting, e.g., the following in
an ERT box:
\begin{emptydisplay}
\item The inventor of bifocals wrote an autobiography
\item The first post-master general of the US wrote an autobiography
\end{emptydisplay}
Is there a way of making this new list a Lyx style, so I can apply it
just as I apply Quote, Enumerate-Resume, etc.? I suspect this might
involve modifying a layout file, or, even the enumitem module, is that
right? And if so, are there instructions somewhere for doing this?
Chapter 5 of the Customization manual contains the documention for this.
But the best way to figure it out, really, is just to open the
enumitem.module file and try to mimic what is there.As for where to do
that, you can either (i) copy enumitem.module to your local user layout
directory (e.g., $HOME/.lyx/layouts/) and then modify it; or (ii) create
a new module of your own in that directory (remember to reconfigure
after you create file); or (iii) put the layout code into Document>
Settings> Local Layout. Which you do depends upon how you intend to use it.
Something like this should work as a new module (for 2.1.x):
#\DeclareLyXModule[enumitem.sty]{More Customisable Lists}
#DescriptionBegin
# Additional customizable lists
#DescriptionEnd
#Requires: enumitem
Format 49
Style EmptyDisplay
CopyStyle Itemize
OptionalArgs 0
LatexName emptydisplay
Preamble
\newlist{emptydisplay}{itemize}{1}
\setlist[emptydisplay]{label={}, itemindent=1em, align=left, labelsep=!}
EndPreamble
End
Or you can put the bit starting with "Format 49" into Local Layout.
You'll still get the bullet in LyX with this, since I just copied
Itemize. You can presumably get rid of that, if you want, by changing
the LabelType. But I'll leave that kind of customization to you.
Richard