Andre Poenitz <[EMAIL PROTECTED]> writes: > On Tue, Dec 10, 2002 at 11:27:50PM +0100, David Kastrup wrote: > > The following message is a courtesy copy of an article > > that has been posted to de.comp.text.tex as well. > > I'll try to translate this (freely) into English lest we get examples of > Norwegian or Hebrew poetry next time (comments in [] are mine)
ARGH! Please excuse my stupidity, I am switching so often between English and German that this was completely unconscious. Of _course_ I know that lyx-devel is English spoken, it just did not occur to me that I was no writing in English at that time. No disrespect for the international participants was intended. Ok, I'll try clarifying where my thoughts were as muddled in the German not to survive the translation. Problem was that the OP asked how complicated it would be to write a layout file for some class with non-standard structuring commands (jura.cls). > Stupid question: What about trying to write a [LaTeX/TeX] package that > writes out a LyX .layout file. [preview-latex gets along with "foreign" classes usually] > Then it occured to me that preview-latex is only able to do that because > \@startsection and similar are called with suitable parameters and > \thesection etc. are defined. LyX could hook into it Ok, here is where my German already has been bad. preview.sty of course is pretty much unsuited except as an inspiration. In this case, I meant, LyX could by virtue of a special style, say lyxlayout.sty, hook into the appropriate section generating hooks and then notice all calls of sections and record them. Ok, this is somewhat half-baked: layout.sty would also need to know just _what_ command happened to call it. So it would appear that layout.sty alone would not be able to do the work. It could, however, just issue fake error messages which would then enable an external script to see which lines contained the sectionion commands, and the external script could then fill in this missing information. > and would obtain a lot of information on [Verzeichnisebenen?], math > environments, counters etc. > > In the extreme case one could simply use > "\nonstopmode\AtBeginDocument{\RequirePackage{lyxlayout}}\input{doc.tex}" > on unknown [LaTeX] documents and end up with a basic LyX .layout. Well, as I said, postprocessing with a script parsing the log file would probably also be necessary. > Idea or nonsens? I'll send a copy to lyx-devel. Well, as language, missing things like the above detail (I know propose a script for) and other stuff suggest, this was a late at night addition. Anyhow, perhaps _some_ automated way of generating layout files would be appreciated by people. Or even a manual way which asks the user a lot of questions. Or some interactive tool which you call and which let's you browse/change a layout with a menu-like structure. You might scoff at that idea and say that real men should have no problem copying an existing file and modifying from there, but face it: that sort of "real men" is not the target audience for LyX. LyX people are _glad_ they have a frontend to the structured text represented by a LaTeX file, and they would probably appreciate having one to layout files as well. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum