# Re: advices for layout modification

> Thanks Steve, I have a lot to read.... I have started by
> http://troubleshooters.com/linux/lyx/self_publish_lyx.htm just to get
> along with your tutorials and the way you wrote them.
>
> As I am not always focused, I have tried to add that in my layout file:
>
> Style Dialogue
>    LatexType             Environment
>    LatexName             dialog_l
>    ParSep                0.5
>
>    Font
>      Shape               Bold
>    EndFont
>    Preamble
>          \newenvironment{dialog_l}
>                  {
>                  \begin{list}{}
>                  \item[---]
>                  }
>                  {
>                  \par
>                  \end{list}
>                  }
>    EndPreamble
> End
>
> But that doesn't work at all. It leads to what I was afraid of. The
> first line of my dialog has the — sign, but not the others...
>
>
> I definitely have much more reading to do, but if you have an obvious
> solution to my problem, I'll be happy with it. Still, starting to be
> late for me. I'll see that another day.
>
>
> Pierig
>
>
>
>
>
> On 21/08/2022 13:01, Steve Litt wrote:
> > On Sun, 2022-08-21 at 11:04 +0800, pierig wrote:
> >> Hello,
> >>
> >> I have been using Lyx for years, and I am very happy with it. I am
> >> writing novels, so my needs are pretty simple. (I would happily share
> >> the novels here, but they are in French [Sci Fi])
> >>
> >> In a novel, I have two main type of text. The main one, and dialogues.
I
> >> was using "Quote" for the dialogues, convenient enough.
> > I think you're going to be quite pleased with making your own text
types (LyX-speak
> > "environments") instead of hijacking environments meant for other
purposes. You're
> > moving from two to three, but if your books are anything like mine, now
that you can
> > make your own types, you'll want more of them. Just as a for instance,
you have
> > dialog and thoughts, but what about narration? What about narration of
stories and
> > back stories? When you can make your own environments, the world is
> >
> >> But now I need a
> >> third one to show the thoughts of a character. Then I have decided to
> >> try to adapt the layout of "Book (standard class)"
> > I congratulate you on choosing Book class. It works with everything,
and it's very
> > adaptable. 7 of my 9 books use Book class, and I'd never again use Koma
or Memoir.
> >
> >> I have looked at some advice on the net and manage to add a /dialogue/
> >> and /pensée/ (thoughts). For /dialogue/ it should be an itemized style,
> >> (in French we add — for each change of speaker). Which means the code
> >> for first line of a dialogue, the last line of dialogue and other lines
> >> of dialogues are different
> >>
> >> *1st line*
> >>
> >>    \begin{itemize}
> >>        \item
> >>
> >>
> >> *other lines*
> >>        \item
> >>
> >>
> >> *last line*
> >>        \item
> >>
> >> \end{itemize}
> > I'm confused about the preceding. Are you intending to insert ERT code
"/item"
> > between every speaker? Doing so would make for slow authoring.
> >
> >>
> >> Would you have any advice for where to look for this kind of
> >> modification which doesn't involve a single line? For a single line, I
> >> have done something very simple as a try, but I don't have any idea for
> >> this multiple line problem
> >>
> >>
> >> Example of single line:
> >>
> >> Style Pensée
> >>     LatexType             Environment
> >>     LatexName             pensee_l
> >>     ParSep                0.7
> >>
> >>     Font
> >>       Shape               Italic
> >>     EndFont
> >>     Preamble
> >>           \newenvironment{pensee_l}
> >>                   {
> >>                   \itshape
> >>                   }
> >>                   {
> >>                   \par
> >>                   }
> >>     EndPreamble
> >> End
> >>
> >>
> >>
> >> Thanks for your help.
> > I suggest you find the LaTeX source for the Book document class
standard paragraph.
> > I don't remember where it is, but other people do. Modify as needed for
each of your
> > desired environments.
> >
> > Having the first and last whatever different from the middle ones might
require
> > three different paragraph styles. I think LyX has a "next style"
property you can
> > put in the LyX part of the environment definition, so that pretty much
makes
> > everything except the last whatever automatic.
> >
> > Here's a doc I wrote 13 years ago discussing making your own layout
file:
> >
> > http://troubleshooters.com/linux/lyx/surefire_layout.htm
> >
> >
> > Also read http://www.troubleshooters.com/lpm/200210/200210.htm . It's
almost 20
> > years old, but it has ways to modify existing LaTeX environments
without rewriting
> > them from scratch. Combined with CopyStyle, this just might simplify
> >
> > If you ever need to make your own list environments, see
> > http://troubleshooters.com/linux/lyx/ownlists.htm
> >
> > Actually, you might want to acquaint yourself with my whole LyX subsite,
> > http://troubleshooters.com/linux/lyx/ , which links to quite a few LyX
documents.
> >
> > SteveT
> >
> --
> lyx-users mailing list
> lyx-users@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-users

Hello,

I'm not certain what layout you are trying to create, but I hope the
To address your specific problem, you can just copy the itemize layout
already defined in lyx and customize it, you can find the description of
the layout in the file stdlist.inc. The layout is defined as follows:

Style Itemize
Category              List
Margin                Static
LatexType             Item_Environment
LatexName             itemize
NextNoIndent          1
ToggleIndent          Never
LeftMargin            MMN
LabelSep              xx
ItemSep               0.2
TopSep                0.7
BottomSep             0.7
ParSep                0.3
Align                 Block
AlignPossible         Block, Left
LabelType             Itemize
HTMLTag               ul
HTMLItem              li
HTMLLabel             NONE
Argument item:1
LabelString   "Custom Item|s"
Tooltip       "A customized item string"
EndArgument
End

You can change the bullets of this layout via Document->Settings->Bullets.

If you want to understand the commands in this description, you  should
read section 5.3.7 of the customization guide which comes with lyx, and can
be found in Help->Customization, and after that look at module and inc
files for some examples.

Another way to customize lists in lyx is with the enumitem package. In
Document->Modules you should have the module "Customisable Lists
(enumitem)". This module has a manual in here
<http://www.lyx.org/trac/raw-attachment/ticket/7195/enumitem-example.lyx>,
and if you want to use it you should probably also read the enumitem
documentation.

Regards,
Udi

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