On Wednesday 29 October 2003 10:04, Martin Vermeer wrote:
> On Tue, Oct 28, 2003 at 11:32:40AM +0000, Jose' Matos spake thusly:
> >   This code is a mess (it is my code so I am allowed to say that). I have
> > discussed this two years ago with Jürgen Vigna and it appears that the
> > latex output code was redone to take in account the nested environments.
>
> Speaking about which, looking at buffer.C:
>
>    1794         case LATEX_COMMAND:
>    1795             if (depth != 0)
>    1796                 error(ErrorItem(_("Error"), _("Wrong depth for
> LatexType Command."), par->id(), 0, par->size())); 1797
>
> Apparently depth != 0 is not supposed to happen for a
> (paragraph-style) command (apparently mostly sectioning headers,
> right?)

  It shouldn't but it is possible. You put a chapter inside a list in lyx, the 
resulting document isn't valid, but it is possible. This is the case I want 
to catch.

> Then a bit lower:
>
>    1845             sgml::openTag(ofs, depth + command_depth, false,
> command_name); 1846
>    1847             item_name = c_params.empty() ? "title" : c_params;
>    1848             sgml::openTag(ofs, depth + 1 + command_depth, false,
> item_na
>
> and
>
>    1901         // write closing SGML tags
>    1902         switch (style->latextype) {
>    1903         case LATEX_COMMAND:
>    1904             end_tag = c_params.empty() ? "title" : c_params;
>    1905             sgml::closeTag(ofs, depth + command_depth,
>    1906                      false, end_tag);
>    1907             break;
>
> Do we really need 'depth + command_depth' here, rather than just
> 'command_depth'? Apparently it only affects the indent in the .sgml
> output file.

  The second argument of open and closeTag are only related with indentation. 
The idea was to have a nice output. But sure we can get rid of them.

> ...and should we somehow get rid of the '// environment tag closing'
> stanza at the beginning? Yes, this looks messy :-) but I don't dare to
> touch it without a non-trivial DocBook LyX test file...

   Such as it is now no, for that we need to have in account the nested 
structure, I will have a look to the lastex export model and report it later.  

> - Martin

-- 
José Abílio

Reply via email to