Discussion:
LyX construct for LaTeX commands having no arguments
Jacob Barandes
2011-07-26 23:17:34 UTC
Permalink
This is probably a trivial question, but I can't seem to find an answer to
it anywhere in the documentation or the forums, so I thought maybe it wasn't
a feature yet.

I have a LaTeX class file that defines a standalone LaTeX command
(\makecopyrightpage) that takes no arguments, i.e., no {...} -- it simply
generates some text automatically.

Is there an object I can define in my corresponding layout file that would
produce a nice corresponding LyX construct? Paragraphs and flex insets both
allow the user to enter text input. I want something like the GUI construct
that LyX shows when you create a table of contents -- an un-editable "box"
that doesn't allow any text entry.

Thanks,
Jacob
Richard Heck
2011-07-27 04:11:02 UTC
Permalink
Post by Jacob Barandes
This is probably a trivial question, but I can't seem to find an
answer to it anywhere in the documentation or the forums, so I thought
maybe it wasn't a feature yet.
I have a LaTeX class file that defines a standalone LaTeX command
(\makecopyrightpage) that takes no arguments, i.e., no {...} -- it
simply generates some text automatically.
Is there an object I can define in my corresponding layout file that
would produce a nice corresponding LyX construct? Paragraphs and flex
insets both allow the user to enter text input. I want something like
the GUI construct that LyX shows when you create a table of contents
-- an un-editable "box" that doesn't allow any text entry.
At the moment, there is no mechanism within LyX for this sort of thing.
There is a bug report, filed by me, asking for it, and I am hoping to do
it for 2.1. So, for now, it's ERT.

Richard
Uwe Stöhr
2011-07-27 16:23:26 UTC
Permalink
Post by Jacob Barandes
I have a LaTeX class file that defines a standalone LaTeX command
(\makecopyrightpage) that takes no arguments, i.e., no {...} -- it simply
generates some text automatically.
Is there an object I can define in my corresponding layout file that would
produce a nice corresponding LyX construct?
We currently use this construct:

Style Front_Matter
Category Structure
LatexType Command
LatexName frontmatter
KeepEmpty 1
OptionalArgs 0
Margin First_Dynamic
NextNoIndent 1
ParSkip 0
TopSep 2.5
BottomSep 0.5
ParSep 0
Align Center
LabelType Static
LabelBottomSep 0
LeftMargin M
LabelString "--- Front Matter ---"

Font
Family Sans
Series Bold
Size Largest
Color Blue
EndFont
End

This is the definition for the command \frontmatter in the Springer layout files.

regards Uwe
Richard Heck
2011-07-27 21:17:15 UTC
Permalink
Post by Uwe Stöhr
Post by Jacob Barandes
I have a LaTeX class file that defines a standalone LaTeX command
(\makecopyrightpage) that takes no arguments, i.e., no {...} -- it simply
generates some text automatically.
Is there an object I can define in my corresponding layout file that would
produce a nice corresponding LyX construct?
Style Front_Matter
Category Structure
LatexType Command
LatexName frontmatter
KeepEmpty 1
OptionalArgs 0
Margin First_Dynamic
NextNoIndent 1
ParSkip 0
TopSep 2.5
BottomSep 0.5
ParSep 0
Align Center
LabelType Static
LabelBottomSep 0
LeftMargin M
LabelString "--- Front Matter ---"
Font
Family Sans
Series Bold
Size Largest
Color Blue
EndFont
End
This is the definition for the command \frontmatter in the Springer layout files.
The only downside to this hack is that you actually can type stuff there!

Richard
Uwe Stöhr
2011-07-27 21:58:48 UTC
Permalink
Post by Richard Heck
The only downside to this hack is that you actually can type stuff there!
Sure, but better than no solution for now.

regards Uwe
Jacob Barandes
2011-07-27 22:04:01 UTC
Permalink
It could be as rudimentary as just including an additional binary option
UserInput [0/1] in the Style and FlexInset blocks that deactivates text
input in LyX for the given construct.

Jacob
Post by Richard Heck
The only downside to this hack is that you actually can type stuff there!
Sure, but better than no solution for now.
regards Uwe
Richard Heck
2011-07-28 01:53:09 UTC
Permalink
Post by Jacob Barandes
It could be as rudimentary as just including an additional binary
option UserInput [0/1] in the Style and FlexInset blocks that
deactivates text input in LyX for the given construct.
This is more difficult than it seems, due to what happens, e.g., if you
hit the delete key when you are at the end of such a paragraph. Better
to have a custom inset similar to the command insets we already have.

rh
Jacob Barandes
2011-07-28 15:44:09 UTC
Permalink
So it presumably wouldn't work so well as a paragraph style. But what about
a modified flex inset, by having a new binary option in the InsetLayout
block that simply deactivates opening the box in LyX?

Jacob
Post by Richard Heck
Post by Jacob Barandes
It could be as rudimentary as just including an additional binary
option UserInput [0/1] in the Style and FlexInset blocks that
deactivates text input in LyX for the given construct.
This is more difficult than it seems, due to what happens, e.g., if you
hit the delete key when you are at the end of such a paragraph. Better
to have a custom inset similar to the command insets we already have.
rh
Richard Heck
2011-07-28 17:23:40 UTC
Permalink
Post by Jacob Barandes
So it presumably wouldn't work so well as a paragraph style. But what
about a modified flex inset, by having a new binary option in the
InsetLayout block that simply deactivates opening the box in LyX?
Interesting idea. But if I get to the more general approach, which would
allow for arguments (e.g., like the hyperlink inset), then it would
absorb this one, too.

rh
Post by Jacob Barandes
Post by Jacob Barandes
It could be as rudimentary as just including an additional binary
option UserInput [0/1] in the Style and FlexInset blocks that
deactivates text input in LyX for the given construct.
This is more difficult than it seems, due to what happens, e.g., if you
hit the delete key when you are at the end of such a paragraph. Better
to have a custom inset similar to the command insets we already have.
rh
Loading...