Re: Insert plain commands into the document with an Inset
On 2022-04-10 08:07, Daniel via lyx-users wrote: On 2022-04-06 22:57, tush via lyx-users wrote: How can I create an Inset that once inserted into the document, adds the following commands to the document?: \mainmatter \pagestyle{fancy} % new page style \newgeometry{ new page layout goes here } Of course, I can insert these commands with ERT, but I prefer them to be defined a more GUI friendly object. If I create a new flex inset, it either adds an environment (\begin{LatexName }...\end{LatexName ) or a command (\LatexName{...}). I don't need any text (ERT or anything else) to be inserted into this inset. Just to insert those commands into the document. The List Of Figures insertion, for example, does something similar, but it has some information such as Placement and Extension that are irrelevant in my case. First, what is the "new page layout goes here" for? Isn't that text that needs to be entered into the inset? Second, I believe custom command insets without arguments cannot be created currently. You could create an inset with an argument whose argument does nothing to achieve basically the same thing. So, I guess it hasn't been a priority to implement custom non-argument insets. But it's really a just missing feature. Daniel ps. There are separate GUI features for \pagestyle (https://www.lyx.org/trac/ticket/12394) and \mainmatter (https://www.lyx.org/trac/ticket/12424) on the way. But since I lack at least the abilities to finish those patches for backwards compatibility, I am not sure whether they will appear in LyX any time soon. -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Insert plain commands into the document with an Inset
On 2022-04-06 22:57, tush via lyx-users wrote: How can I create an Inset that once inserted into the document, adds the following commands to the document?: \mainmatter \pagestyle{fancy} % new page style \newgeometry{ new page layout goes here } Of course, I can insert these commands with ERT, but I prefer them to be defined a more GUI friendly object. If I create a new flex inset, it either adds an environment (\begin{LatexName }...\end{LatexName ) or a command (\LatexName{...}). I don't need any text (ERT or anything else) to be inserted into this inset. Just to insert those commands into the document. The List Of Figures insertion, for example, does something similar, but it has some information such as Placement and Extension that are irrelevant in my case. First, what is the "new page layout goes here" for? Isn't that text that needs to be entered into the inset? Second, I believe custom command insets without arguments cannot be created currently. You could create an inset with an argument whose argument does nothing to achieve basically the same thing. So, I guess it hasn't been a priority to implement custom non-argument insets. But it's really a just missing feature. Daniel -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Insert plain commands into the document with an Inset
If it is not possible to achieve, then I would like to know it isn't. --- Original Message --- On Wednesday, April 6th, 2022 at 9:57 PM, wrote: > How can I create an Inset that once inserted into the document, adds the > following commands to the document?: > > \mainmatter > \pagestyle{fancy} % new page style > \newgeometry{ new page layout goes here } > > Of course, I can insert these commands with ERT, but I prefer them to be > defined a more GUI friendly object. > > If I create a new flex inset, it either adds an environment (\begin{LatexName > }...\end{LatexName ) or a command (\LatexName{...}). I don't need any text > (ERT or anything else) to be inserted into this inset. Just to insert those > commands into the document. > > The List Of Figures insertion, for example, does something similar, but it > has some information such as Placement and Extension that are irrelevant in > my case.-- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users