Eran Tromer <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
| 
| > use of tex-mode with insets inside is a harder nut to crack...
| > (especially if we speck of insets that can themselves have tex-mode
| > inside)
| 
| Maybe I'm missing something, but why won't the following work?
| While parsing, keep a stack (or piggyback on an existing stack)
| corresponding to inset nesting levels, with an "are we in tex-mode" flag
| per level. When pushing due to new inset, set the flag of the new level
| to false. Upon "\latex latex" etc, change the flag in the current level
| only.

\latex latex
 \backslash foo
\begin_inset <someinsettext>
\latex latex
\backslash bar
\end_inset
\backslash foo bar

\layout Standard

 
| I think that's how it used to work, at least in effect. If you think 
| about fonts and footnotes ("\emph{foo \footnote{bar} baz}") and similar 
| cases, they seem to have those semantics too.
| 
| Since tex-mode wasn't properly terminated, there must be lots of
| documents out there with this problem.

Iff we can assume that all insets put inside a tex-mode is not a inset
that can have a tex-mod inside, then we can _kindo_ solve the problem.
_but_ I don't think this is true.

and a stack really does not help... since it is not allowd to have
insets inside tex-mode (and absolutely not in ERT), so we end up
changing the document anyway. (and is one change better thatn the
other...) ... it might be possible to make it work, but it will
require more code to support... (because the parsing code does not
really... hm it does... let's see I'll hack something together and you
can look at that...

-- 
        Lgb

Reply via email to