Bo Peng wrote: > Attached is what I believe a cleaner implementation of > clearpage/cleardoublepage. Please, tex2lyx and lyx2lyx experts, fix > tex2lyx and lyx2lyx so that I can apply it.
Sigh. Once again: tex2lyx _must not_ be changed unless somebody implements the changes from format 245 to 254 first. Otherwise tex2lyx will generate invalid files. > Index: src/insets/insetpagebreak.C > =================================================================== > --- src/insets/insetpagebreak.C (revision 16016) > +++ src/insets/insetpagebreak.C (working copy) > @@ -38,7 +38,7 @@ > > void InsetPagebreak::write(Buffer const &, ostream & os) const > { > - os << "\n\\newpage\n"; > + os << "\n" << latexLabel() << '\n'; > } Why this? If you want to do all in one inset, then inherit from InsetCommand and use the syntax we have there. This was not done with the old \newpage because the \begin_inset..\end_inset was not wanted. IMHO the syntax without \begin_inset..\end_inset is a hack and should only be used for things that can occur very often, because it saves space. If we add more line noise then please do not invent a new syntax, but stick to what we already have. IMO we should either use the version of Ugras, or not create any new inset but let InsetPagebreak inherit from InsetCommand. Then the command name would be an argument of the constructor, and we could even implement an UI later where one can change one kind of pagebreak to another. Apart from that the name latexLabel is misleading IMO, this is no label but the command name. Finally: As I see it it would also make sense to include the \pagebreak mentioned by Herbert. Georg