On 4/26/19 4:16 PM, Paul Smith wrote:
Dear All,
Suppose that I have created a new enumerate-like enumerate, say
xenumerate. How can I use it from inside LyX without recourse to ERT?
Thanks in advance,
Paul
A couple of possibilities come to mind. If you want to use the new
version exclusively (and not use good old "enumerate"), you could
redefine the enumerate environment itself. Assuming you want xenumerate
to coexist with enumerate, you can define a layout for it, either in the
Local Layout portion of the document settings (if you only want it for
one document) or in a module file installed in your local layouts directory.
Guessing that you want the last one (i.e., add this along side regular
enumerations and make it available to any document that wants it), I
would suggest looking at /usr/share/lyx/layouts/stdlists.inc for
inspiration. (That's the Linux path; on other OSes, your path may
differ.) Look for the section that begins "Style Enumerate" and copy it
to your local module file (which will also need the proper header
stuff). Change the first line of the style to "Style Xenumerate" (or
whatever), change the LatexName entry to "xenumerate", and see if
anything else needs tweaking (quite possibly not).
Help > Customization has lots of details about creating your own modules
and paragraph styles. Note that you will have to expressly include the
module in any document where you want to use the style. (You could hack
stdlists.inc itself, but then you would need to repeat the hack any time
an upgrade/reinstallation overwrote /usr/share/lyx/layouts.)
Paul (the original one)