On Tue, 19 Mar 2002 22:54:11 -0500 wrote Matej Cepl <[EMAIL PROTECTED]>:
> trying to create layout for the document class of the bulletin of
> CSTUG (Czech TeX Users' Group), I have hit a problem. Every
> article in LaTeX document provided by author (one file may
> contain more articles; of course, the reason is, that whole
> bulletin is than compiled to one) is enclosed (whole, even
> \title, \author, and \maketitle) in special environment clanek
> (which is ``article'' in Czech). Something like this:
>
> \documentclass{article}
>
> \usepackage{csbul} % style of the bulletin itself
>
> \begin{document} \begin{clanek}
>
> \title{something} \author{something}
>
> \podpis{something} % ``podpis'' means ``signature'' and it is
> % used for the authors name
>and contact
> % info in the end of the
>article.
>
> \maketitle
>
> \section{...}
>
> ...
>
> \end{clanek} \end{document}
>
> I would like to make layout as seamless as possible (remember, it
> is for introduction of LyX to {La}TeX community, so I would like
> to avoid any ERT) and of course, I cannot change the style itself.
The situation seems familiar to me, it resembles my problems with
seminar.cls and dinbrief.cls --- I would call it the "container environment
problem"
I got a (partial) solution with the
KeepEmpty 1
keyword also mentioned by Allan.
Unfortunately, LyX (at least up to 1.1.6fix3) has a bug whith this:
A paragraph environment that has the KeepEmpty flag set will not
be deleted when empty :-), but when you have
nothing in it, pressing Enter will not start a new paragraph but do
nothing :-(
Workaround (not really nice for introduction of LyX to {La}TeX community):
1. First create some text following the empty command.
2. Move up and start a new paragraph with Enter.
3. Set the paragraph style to the "KeepEmpty command/environment"
So, here is what I have for seminar slides:
Style LandscapeSlide
LatexType Environment
LatexName slide
KeepEmpty 1
NextNoIndent 1
LabelType Centered_Top_Environment
LabelString "________________________________ Landscape Slide
________________________________"
LabelFont
Shape Italic
Color blue
# Size small
EndFont
End
Everything that shall go to the slide must be nested inside the empty
LandscapeSlide environment (Again not nice for for introduction of LyX to
{La}TeX community but ok for text that shall go to a slide)
Another idea would be:
# !!! Attention: Use only for environments started with BeginEnvironment!!!
# End an environment
Style EndEnvironment
CopyStyle BeginEnvironment
LatexName end
LabelString "End:"
End
# A set of generic container environment commands:
# !!!Attention: Must be closed with EndEnvironment!!!
# Begin an environment
Style BeginEnvironment
LatexType Command
LatexName begin
NextNoIndent 1
Margin First_Dynamic
LabelType Static
LabelString "begin: "
Font
Family Sans
Size small
Color blue
EndFont
LabelFont
Family Sans
Size small
Color blue
EndFont
End
# !!! Attention: Use only for environments started with BeginEnvironment!!!
# End an environment
Style EndEnvironment
CopyStyle BeginEnvironment
LatexName end
LabelString "end: "
End
These ones might be dangerous for the LaTeX novice (as they are quite
ERT-like) but migth be an option for for introduction of LyX to the {La}TeX
community.
OTHOH, there is also a chance using real ERT with the side-effect of
demonstrating the power of ERT to the LaTeX freak:
If there is anything LyX is (still) not able to cope with but what
cane be done in LaTeX, you can use the LaTeX paragraph mode like in the red
\begin{clanek}
command above.
Na sledanou
Guenter
--
[EMAIL PROTECTED]