Jean-Marc Lasgouttes wrote:
rgheck <rgh...@bobjweil.com> writes:
I did the necessary infrastructure bits, but I'll at least need a lot
of help on the tex2lyx part. I don't know anything about tex2lyx, at
this point, anyway.

What part of it is in branch, BTW?

Come to think of it, none. The changes, as I recall, were pretty large, and we deferred committing to branch at that time. I'll prepare a patch for branch, but I won't have time until later this week.

Perhaps some conversation about how to approach the problem would help.

I would say that, for branch, all we can do now is to make sure that
modules that are required by a textclass are correctly loaded to that
relevant layouts are recognized. We cannot at this point allow fancy
code that guesses what modules to add since we do not produce a new
enough format.

OK. Maybe an even simpler, brute force solution would be just to load a huge number of modules on import. We can't load them all, since some conflict with others, but we could load as many of the ones we ship as possible, and then we'd be nearly sure to catch what we need to catch. Custom modules would still be a problem, of course, but that has to wait until we get the fancy code.

By the way, when looking at this, it occurred to me that there's something else we could also do here that would make a good deal of sense in general and already help a lot with this problem. If we see a construct like
   \begin{unk}
   ...
   \end{unk}
then, as LyX now stands, we can still import that as an environment. It will just be treated as "unknown". Then one could restore things by selecting the appropriate modules by hand. The problem with this is that, if that's all we do, then of course LaTeX output would be messed up until or unless you restore those modules. But we could create a trivial layout for this environment and write it to the local_layout part of the preamble. This could be as simple as:
   Style unk
       LaTeXType Environment
       LaTeXName unk
   EndStyle
The LyX file would then look a lot nicer than it does now, and it would be *much* easier to fix things up properly, since you wouldn't just have ERT all over the place. Maybe we could even do the same for simple commands like "\unk{text in here}" by creating trivial InsetLayouts for them?

Richard

Reply via email to