A similar patch would be required for LyXHTML, but it will come later. The main impact is that some text isn't output in XHTML (like DocBook before this patch).
The code isn't as clean as it could be. I avoided touching anything not related to DocBook, as the release of 2.4 is nearing, while leaving comments for parts to improve for the next release cycle. Given that the code compiles, there are no risks for TeX or XHTML outputs; for DocBook, less content is skipped, which is a net improvement for users.
With the current settings, a theorem with several paragraphs will have several wrapper tags (i.e. two `<db:figure>`, with one paragraph each, one next to the other when it's the same theorem), while there should be only one (one `<db:figure>` with two paragraphs).
It makes me wonder whether DocBookWrapperMergeWithPrevious should be the default value. I don't see a case where it would be set to `false` with a wrapper tag, but the test suite isn't developed enough to make the change with peace of mind (i.e. remove the parameter `DocBookWrapperMergeWithPrevious` and consider it is always `true` in the code).
For the record, the current code also works with two subsequent theorems with two paragraphs each (see new test case).
I've modified all the non-AMS theorem modules so they would be independent of packages. currently
the code support \theoremstyle, but only with definition, plain and remark.
I'v added a new theorem module that support the thmtools \listoftheorems.
I've modified the syntax of all theorem modules, such that it would be easier to
create a new one, or maintaining the ones that exists. Instead of using \newtheorem
in the preamble of a lyaout, I wrote \lyx@newtheorem, and in each module I've defiened
\lyx@newtheorem as fitted. This way, there is only need in the files thorems-base, and theorems-extended,
instead of an .inc file for each module.
I've added theorems-labels.inc, a file that suppose to be included in a "Numbered by type" module,
to change the Label and the LabelCounter of the layouts in theorems-base.inc.
Note that in this configuration, all non-AMS modules will clash with the AMS ones, and so as the
proof versions. theorems-proof-std.inc suppose to be in the non-AMS while theorems-proof.inc
should be included only in AMS variants.
The new parameter allows more flexibility when encoding some elements that have a poor mapping in DocBook, like theorems. The major use is to wrap the environment in a generic container, figure, which requires a title (but none is available).
DocBook comes in another commit, as the modifications are not required to keep the code compilable.
A semicolon is no more used between an index term and the places it appears, because some languages need a space before it and others not: this wasn't handled at all. With a dash, this problem disappears.
This is important for commands like !`, that are equivalent to \textexclamdown. However, ! is matched earlier, because the logic works with prefixes, hence the output doesn't make sense.
In one paragraph, there was both a float and a list of floats in a paragraph: the list of floats has no DocBook output, so that there should be no surrounding <para>.
More generally, ensures that paragraphs in abstracts do not have something else configured.
A major problem in making the layout more useful is that article titles are not supposed to be in TOC.
For elements that should behave like sections (for now, mostly prefaces).
A second paragraph of PartBacktext can only wreak havok: it should start a section, and nothing else (otherwise, it's a real nightmare to implement).
It's invalid to have an <inlineequation> outside a paragraph. Another solution would have been to change InsetMathHull::docbook to generate an <informalequation>, but that function would have required more knowledge about its context than now.
Need more tests to determine if <inlineequation> should only be output for hullSimple or in more cases like:
const static std::set<HullType> inlineHulls = {
hullUnknown,
hullNone,
hullSimple,
hullEquation,
hullMultline,
hullGather,
hullRegexp
};