create an Inset for \marginnote{text}[arg]

Jürgen Spitzmüller spitz at lyx.org
Sun Mar 27 16:39:36 UTC 2022


Am Sonntag, dem 27.03.2022 um 16:25 +0000 schrieb tush via lyx-users:
> I am having difficulties creating a Flex Inset that creates the
> following command:
> 
> \marginnote{text}
> and
> \marginnote{text}[arg]
> 
> Because sometimes the user needs to give the argument arg​.
> 
> If I do the following:
> 
> InsetLayout Flex:MarginalNote    LyXType        custom
>     LabelString    "Margin Note"
>     LatexType      Command
>     LatexName      marginnote
>     Decoration     classic
>     NeedProtect    0
>     Argument 1
>         LabelString vertical
>         Mandatory 0
>         LeftDelim [
>         RightDelim ]
>     EndArgument
>     Argument 2
>         LabelString left
>         #Mandatory 0
>         Requires  1
>         LeftDelim [
>         RightDelim ]
>     EndArgument
> End
> 
> Then I get the latex code \marginnote[arg]{text goes here}.
> I tried to follow the instruction written in section 5.3.7 (for
> "Requires") in the customization manual, but I can't figure it out my
> self.
> 
> What changes should I make?

InsetLayout Flex:MarginalNote
    LyXType        custom
    LabelString    "Margin Note"
    LatexType      Command
    LatexName      marginnote
    Decoration     classic
    NeedProtect    0
    Argument post:1
        LabelString vertical
    EndArgument
End

Jürgen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20220327/d14f9b56/attachment-0001.asc>


More information about the lyx-users mailing list