]> git.lyx.org Git - lyx.git/commitdiff
DocBook: add support for DocBookGenerateTitle.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Thu, 22 Dec 2022 03:38:36 +0000 (04:38 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Tue, 27 Dec 2022 14:52:26 +0000 (15:52 +0100)
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).

15 files changed:
autotests/export/docbook/theorems-mathml.lyx [new file with mode: 0644]
autotests/export/docbook/theorems-mathml.xml [new file with mode: 0644]
lib/layouts/elsart.layout
lib/layouts/theorems-ams-bytype.inc
lib/layouts/theorems-ams-chap-bytype.inc
lib/layouts/theorems-ams.inc
lib/layouts/theorems-bytype.inc
lib/layouts/theorems-starred.inc
lib/layouts/theorems-without-preamble.inc
lib/layouts/theorems.inc
lib/scripts/layout2layout.py
src/Layout.cpp
src/Layout.h
src/TextClass.cpp
src/output_docbook.cpp

diff --git a/autotests/export/docbook/theorems-mathml.lyx b/autotests/export/docbook/theorems-mathml.lyx
new file mode 100644 (file)
index 0000000..89281f8
--- /dev/null
@@ -0,0 +1,148 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 613
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass article
+\use_default_options true
+\begin_modules
+theorems-std
+\end_modules
+\maintain_unincluded_children no
+\language american
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content true
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Ensure that maths are properly converted in theorems
+\end_layout
+
+\begin_layout Standard
+Equation outside environments:
+\begin_inset Formula $\pi\,r^{2}$
+\end_inset
+
+.
+\begin_inset Formula 
+\[
+\pi\,\rho^{3}
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Theorem
+This is a theorem:
+ hypothesis 
+\begin_inset Formula $a=b$
+\end_inset
+
+,
+ thesis 
+\begin_inset Formula 
+\[
+a\neq b.
+\]
+
+\end_inset
+
+Clear,
+ don't you think?
+\end_layout
+
+\begin_layout Proof
+Left as exercise for the reader.
+\end_layout
+
+\begin_layout Remark
+This is real math,
+ you know.
+\begin_inset Formula $a=b=a$
+\end_inset
+
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/autotests/export/docbook/theorems-mathml.xml b/autotests/export/docbook/theorems-mathml.xml
new file mode 100644 (file)
index 0000000..46865fa
--- /dev/null
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This DocBook file was created by LyX 2.4.0-beta2
+  See https://www.lyx.org/ for more information -->
+<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
+<title>Ensure that maths are properly converted in theorems</title>
+<para>Equation outside environments: <inlineequation>
+<alt role='tex'>\pi\,r^{2}</alt>
+<m:math display="inline">
+<m:mrow>
+ <m:mrow><m:mi>&#x3C0;</m:mi>
+  <m:mspace width="6px"/>
+  <m:msup>
+   <m:mi>r</m:mi>
+   <m:mn>2</m:mn>
+  </m:msup>
+ </m:mrow>
+</m:mrow>
+</m:math>
+</inlineequation>.
+<informalequation>
+<alt role='tex'>\pi\,\rho^{3}</alt>
+<m:math display="block">
+<m:mrow>
+ <m:mrow><m:mi>&#x3C0;</m:mi>
+  <m:mspace width="6px"/>
+  <m:msup><m:mi>&#x3C1;</m:mi>
+   <m:mn>3</m:mn>
+  </m:msup>
+ </m:mrow>
+</m:mrow>
+</m:math>
+</informalequation>
+</para>
+<figure role='theorem'>
+<title>Theorem 1.</title>
+<para>This is a theorem: hypothesis <inlineequation>
+<alt role='tex'>a=b</alt>
+<m:math display="inline">
+<m:mrow>
+ <m:mrow>
+  <m:mi>a</m:mi>
+  <m:mo>=</m:mo>
+  <m:mi>b</m:mi>
+ </m:mrow>
+</m:mrow>
+</m:math>
+</inlineequation>, thesis 
+<informalequation>
+<alt role='tex'>a\neq b.</alt>
+<m:math display="block">
+<m:mrow>
+ <m:mrow>
+  <m:mi>a</m:mi><m:mo>&#x2260;</m:mo>
+  <m:mi>b</m:mi>
+  <m:mn>.</m:mn>
+ </m:mrow>
+</m:mrow>
+</m:math>
+</informalequation>
+Clear, don&#8217;t you think?</para>
+</figure>
+<para role='proof'>Left as exercise for the reader.</para>
+<figure role='remark'>
+<title>Remark 2.</title>
+<para>This is real math, you know. <inlineequation>
+<alt role='tex'>a=b=a</alt>
+<m:math display="inline">
+<m:mrow>
+ <m:mrow>
+  <m:mi>a</m:mi>
+  <m:mo>=</m:mo>
+  <m:mi>b</m:mi>
+  <m:mo>=</m:mo>
+  <m:mi>a</m:mi>
+ </m:mrow>
+</m:mrow>
+</m:math>
+</inlineequation>.</para>
+</figure>
+</article>
\ No newline at end of file
index 63a529f67555e8d8241ce4fc34c8043ee5026668..c64aaf98b1a396b97757c42910ba2c1a71be2d08 100644 (file)
@@ -333,8 +333,10 @@ Style Theorem
          Shape               Up
          Series              Bold
        EndFont
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='theorem'
        DocBookTag            para
-       DocBookAttr           role='theorem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -364,8 +366,10 @@ Style Proof
        LabelFont
          Series              Bold
        EndFont
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proof'
        DocBookTag            para
-       DocBookAttr           role='proof'
+       DocBookGenerateTitle  true
 End
 
 
@@ -373,8 +377,10 @@ Style Lemma
        CopyStyle             Theorem
        LatexName             lem
        LabelString           "Lemma \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='lemma'
        DocBookTag            para
-       DocBookAttr           role='lemma'
+       DocBookGenerateTitle  true
 End
 
 
@@ -382,8 +388,10 @@ Style Corollary
        CopyStyle             Theorem
        LatexName             cor
        LabelString           "Corollary \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='corollary'
        DocBookTag            para
-       DocBookAttr           role='corollary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -391,8 +399,10 @@ Style Proposition
        CopyStyle             Theorem
        LatexName             prop
        LabelString           "Proposition \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -400,8 +410,10 @@ Style Criterion
        CopyStyle             Theorem
        LatexName             crit
        LabelString           "Criterion \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='criterion'
        DocBookTag            para
-       DocBookAttr           role='criterion'
+       DocBookGenerateTitle  true
 End
 
 
@@ -409,8 +421,10 @@ Style Algorithm
        CopyStyle             Theorem
        LatexName             alg
        LabelString           "Algorithm \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='algorithm'
        DocBookTag            para
-       DocBookAttr           role='algorithm'
+       DocBookGenerateTitle  true
 End
 
 
@@ -425,8 +439,10 @@ Style Definition
          Shape               Up
          Series              Bold
        EndFont
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='definition'
        DocBookTag            para
-       DocBookAttr           role='definition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -434,8 +450,10 @@ Style Conjecture
        CopyStyle             Theorem
        LatexName             conj
        LabelString           "Conjecture \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='conjecture'
        DocBookTag            para
-       DocBookAttr           role='conjecture'
+       DocBookGenerateTitle  true
 End
 
 
@@ -453,8 +471,10 @@ Style Problem
        CopyStyle             Theorem
        LatexName             prob
        LabelString           "Problem \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -462,8 +482,10 @@ Style Remark
        CopyStyle             Theorem
        LatexName             rem
        LabelString           "Remark \arabic{theorem}"
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='remark'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
 
@@ -471,8 +493,10 @@ Style Note
        CopyStyle             Theorem
        LatexName             note
        LabelString           "Note \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='note'
        DocBookTag            para
-       DocBookAttr           role='note'
+       DocBookGenerateTitle  true
 End
 
 
@@ -480,8 +504,10 @@ Style Claim
        CopyStyle             Theorem
        LatexName             claim
        LabelString           "Claim \arabic{theorem}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='claim'
        DocBookTag            para
-       DocBookAttr           role='claim'
+       DocBookGenerateTitle  true
 End
 
 
@@ -490,8 +516,10 @@ Style Summary
        LatexName             summ
        LabelCounter          summ
        LabelString           "Summary \arabic{summ}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='summary'
        DocBookTag            para
-       DocBookAttr           role='summary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -500,8 +528,10 @@ Style Case
        LatexName             case
        LabelCounter          case
        LabelString           "Case \arabic{case}"
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='case'
        DocBookTag            para
-       DocBookAttr           role='case'
+       DocBookGenerateTitle  true
 End
 
 
index 7ff26b522f0469f7fbb7e7f18c1ca66fae53107b..b60ab3c3611cecd67122fab46815f85c9524292f 100644 (file)
@@ -72,8 +72,10 @@ Style Theorem
                \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
        EndBabelPreamble
        Requires              amsthm
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='theorem'
        DocBookTag            para
-       DocBookAttr           role='theorem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -92,8 +94,10 @@ Style Corollary
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='corollary'
        DocBookTag            para
-       DocBookAttr           role='corollary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -112,8 +116,10 @@ Style Lemma
          \addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
        EndBabelPreamble
        LabelCounter          lemma
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='lemma'
        DocBookTag            para
-       DocBookAttr           role='lemma'
+       DocBookGenerateTitle  true
 End
 
 
@@ -132,8 +138,10 @@ Style Proposition
          \addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
        EndBabelPreamble
        LabelCounter          proposition
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -152,8 +160,10 @@ Style Conjecture
          \addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
        EndBabelPreamble
        LabelCounter          conjecture
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='conjecture'
        DocBookTag            para
-       DocBookAttr           role='conjecture'
+       DocBookGenerateTitle  true
 End
 
 
@@ -172,8 +182,10 @@ Style Fact
          \addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
        EndBabelPreamble
        LabelCounter          fact
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='fact'
        DocBookTag            para
-       DocBookAttr           role='fact'
+       DocBookGenerateTitle  true
 End
 
 
@@ -199,8 +211,10 @@ Style Definition
          \addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
        EndBabelPreamble
        LabelCounter          definition
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='definition'
        DocBookTag            para
-       DocBookAttr           role='definition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -222,7 +236,7 @@ Style Example
        LabelCounter          example
        DocBookWrapperTag     informalexample
        DocBookTag            para
-       DocBookAttr        ""
+       DocBookAttr           ""
 End
 
 
@@ -242,8 +256,10 @@ Style Problem
          \addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
        EndBabelPreamble
        LabelCounter          problem
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -263,8 +279,10 @@ Style Exercise
          \addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
        EndBabelPreamble
        LabelCounter          exercise
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='exercise'
        DocBookTag            para
-       DocBookAttr           role='exercise'
+       DocBookGenerateTitle  true
 End
 
 
@@ -284,8 +302,10 @@ Style Solution
                \addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
        EndBabelPreamble
        LabelCounter          solution
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='solution'
        DocBookTag            para
-       DocBookAttr           role='solution'
+       DocBookGenerateTitle  true
 End
 
 
@@ -312,8 +332,10 @@ Style Remark
          \addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
        EndBabelPreamble
        LabelCounter          remark
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='remark'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
 
@@ -333,9 +355,10 @@ Style Claim
          \addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
        EndBabelPreamble
        LabelCounter          claim
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='claim'
        DocBookTag            para
-       DocBookAttr           role='claim'
-       DocBookItemTag        ""
+       DocBookGenerateTitle  true
 End
 
 Input theorems-case.inc
index 8ef60a526054295cf3ac06e3042d3a1e23848ccc..854588078e101d586df7cde1cf618a91f5be1b93 100644 (file)
@@ -118,8 +118,10 @@ Style Theorem
                \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
        EndBabelPreamble
        Requires              amsthm
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='theorem'
        DocBookTag            para
-       DocBookAttr           role='theorem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -142,8 +144,10 @@ Style Corollary
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='corollary'
        DocBookTag            para
-       DocBookAttr           role='corollary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -166,8 +170,10 @@ Style Lemma
          \addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
        EndBabelPreamble
        LabelCounter          lemma
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='lemma'
        DocBookTag            para
-       DocBookAttr           role='lemma'
+       DocBookGenerateTitle  true
 End
 
 
@@ -190,8 +196,10 @@ Style Proposition
          \addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
        EndBabelPreamble
        LabelCounter          proposition
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -214,8 +222,10 @@ Style Conjecture
          \addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
        EndBabelPreamble
        LabelCounter          conjecture
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='conjecture'
        DocBookTag            para
-       DocBookAttr           role='conjecture'
+       DocBookGenerateTitle  true
 End
 
 
@@ -238,8 +248,10 @@ Style Fact
          \addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
        EndBabelPreamble
        LabelCounter          fact
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='fact'
        DocBookTag            para
-       DocBookAttr           role='fact'
+       DocBookGenerateTitle  true
 End
 
 
@@ -269,8 +281,10 @@ Style Definition
          \addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
        EndBabelPreamble
        LabelCounter          definition
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='definition'
        DocBookTag            para
-       DocBookAttr           role='definition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -296,7 +310,7 @@ Style Example
        LabelCounter          example
        DocBookWrapperTag     informalexample
        DocBookTag            para
-       DocBookAttr        ""
+       DocBookAttr           ""
 End
 
 
@@ -320,8 +334,10 @@ Style Problem
          \addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
        EndBabelPreamble
        LabelCounter          problem
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -345,8 +361,10 @@ Style Exercise
          \addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
        EndBabelPreamble
        LabelCounter          exercise
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='exercise'
        DocBookTag            para
-       DocBookAttr           role='exercise'
+       DocBookGenerateTitle  true
 End
 
 
@@ -370,8 +388,10 @@ Style Solution
                \addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
        EndBabelPreamble
        LabelCounter          solution
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='solution'
        DocBookTag            para
-       DocBookAttr           role='solution'
+       DocBookGenerateTitle  true
 End
 
 
@@ -402,8 +422,10 @@ Style Remark
          \addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
        EndBabelPreamble
        LabelCounter          remark
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='remark'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
 
@@ -427,9 +449,10 @@ Style Claim
          \addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
        EndBabelPreamble
        LabelCounter          claim
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='claim'
        DocBookTag            para
-       DocBookAttr           role='claim'
-       DocBookItemTag        ""
+       DocBookGenerateTitle  true
 End
 
 
index 5e265e551cde84c3f8117647372e17716e2f8aae..90ea48f3d47b2a32c4a63668510936ca83140f2d 100644 (file)
@@ -69,8 +69,10 @@ Style Theorem
          \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
        EndBabelPreamble
        Requires              amsthm
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='theorem'
        DocBookTag            para
-       DocBookAttr           role='theorem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -89,8 +91,10 @@ Style Corollary
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='corollary'
        DocBookTag            para
-       DocBookAttr           role='corollary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -109,8 +113,10 @@ Style Lemma
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='lemma'
        DocBookTag            para
-       DocBookAttr           role='lemma'
+       DocBookGenerateTitle  true
 End
 
 
@@ -129,8 +135,10 @@ Style Proposition
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -149,8 +157,10 @@ Style Conjecture
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='conjecture'
        DocBookTag            para
-       DocBookAttr           role='conjecture'
+       DocBookGenerateTitle  true
 End
 
 
@@ -169,8 +179,10 @@ Style Fact
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='fact'
        DocBookTag            para
-       DocBookAttr           role='fact'
+       DocBookGenerateTitle  true
 End
 
 
@@ -196,8 +208,10 @@ Style Definition
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='definition'
        DocBookTag            para
-       DocBookAttr           role='definition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -235,8 +249,10 @@ Style Problem
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -254,8 +270,10 @@ Style Exercise
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='exercise'
        DocBookTag            para
-       DocBookAttr           role='exercise'
+       DocBookGenerateTitle  true
 End
 
 
@@ -273,8 +291,10 @@ Style Solution
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='solution'
        DocBookTag            para
-       DocBookAttr           role='solution'
+       DocBookGenerateTitle  true
 End
 
 
@@ -301,8 +321,10 @@ Style Remark
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
        EndBabelPreamble
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='remark'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
 
@@ -320,9 +342,10 @@ Style Claim
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='claim'
        DocBookTag            para
-       DocBookAttr           role='claim'
-       DocBookItemTag        ""
+       DocBookGenerateTitle  true
 End
 
 Input theorems-case.inc
index 1967eebb0f5f88cacd06516688539222c1e64244..316812883b2dee55331f9d8ffe7af1d3cd830bbf 100644 (file)
@@ -66,8 +66,10 @@ Style Theorem
                \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
        EndBabelPreamble
        Requires              amsthm
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='theorem'
        DocBookTag            para
-       DocBookAttr           role='theorem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -86,8 +88,10 @@ Style Corollary
                \addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
        EndBabelPreamble
        LabelCounter          corollary
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='corollary'
        DocBookTag            para
-       DocBookAttr           role='corollary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -106,8 +110,10 @@ Style Lemma
                \addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
        EndBabelPreamble
        LabelCounter          lemma
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='lemma'
        DocBookTag            para
-       DocBookAttr           role='lemma'
+       DocBookGenerateTitle  true
 End
 
 
@@ -126,8 +132,10 @@ Style Proposition
                \addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
        EndBabelPreamble
        LabelCounter          proposition
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -146,8 +154,10 @@ Style Conjecture
                \addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
        EndBabelPreamble
        LabelCounter          conjecture
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='conjecture'
        DocBookTag            para
-       DocBookAttr           role='conjecture'
+       DocBookGenerateTitle  true
 End
 
 
@@ -166,8 +176,10 @@ Style Fact
                \addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
        EndBabelPreamble
        LabelCounter          fact
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='fact'
        DocBookTag            para
-       DocBookAttr           role='fact'
+       DocBookGenerateTitle  true
 End
 
 
@@ -193,8 +205,10 @@ Style Definition
                \addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
        EndBabelPreamble
        LabelCounter          definition  
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='definition'
        DocBookTag            para
-       DocBookAttr           role='definition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -216,7 +230,7 @@ Style Example
        LabelCounter          example
        DocBookWrapperTag     informalexample
        DocBookTag            para
-       DocBookAttr        ""
+       DocBookAttr           ""
 End
 
 
@@ -236,8 +250,10 @@ Style Problem
                \addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
        EndBabelPreamble
        LabelCounter          problem
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -257,8 +273,10 @@ Style Exercise
                \addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
        EndBabelPreamble
        LabelCounter          exercise
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='exercise'
        DocBookTag            para
-       DocBookAttr           role='exercise'
+       DocBookGenerateTitle  true
 End
 
 
@@ -278,8 +296,10 @@ Style Solution
                \addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
        EndBabelPreamble
        LabelCounter          solution
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='solution'
        DocBookTag            para
-       DocBookAttr           role='solution'
+       DocBookGenerateTitle  true
 End
 
 
@@ -306,8 +326,10 @@ Style Remark
                \addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
        EndBabelPreamble
        LabelCounter          remark
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='remark'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
 
@@ -327,9 +349,10 @@ Style Claim
                \addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
        EndBabelPreamble
        LabelCounter          claim
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='claim'
        DocBookTag            para
-       DocBookAttr           role='claim'
-       DocBookItemTag        ""
+       DocBookGenerateTitle  true
 End
 
 Input theorems-case.inc
index 704e88a1c8a1721995beaf1f9bc761d00895d03b..003b07d267d33be4d8098ee9491f6308ddb8bdc7 100644 (file)
@@ -19,6 +19,9 @@
 # - Claim
 # - Proof
 
+# TODO: for DocBook, there is no difference with standard (not starred) environments.
+# How to encode the subtlety?
+
 Format 98
 
 OutlinerName thm "Definitions & Theorems"
@@ -67,8 +70,10 @@ Style Theorem*
          \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
        EndBabelPreamble
        Requires              amsthm
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='theorem'
        DocBookTag            para
-       DocBookAttr           role='theorem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -86,8 +91,10 @@ Style Corollary*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='corollary'
        DocBookTag            para
-       DocBookAttr           role='corollary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -105,8 +112,10 @@ Style Lemma*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='lemma'
        DocBookTag            para
-       DocBookAttr           role='lemma'
+       DocBookGenerateTitle  true
 End
 
 
@@ -124,8 +133,10 @@ Style Proposition*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -143,8 +154,10 @@ Style Conjecture*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='conjecture'
        DocBookTag            para
-       DocBookAttr           role='conjecture'
+       DocBookGenerateTitle  true
 End
 
 
@@ -162,8 +175,10 @@ Style Fact*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='fact'
        DocBookTag            para
-       DocBookAttr           role='fact'
+       DocBookGenerateTitle  true
 End
 
 
@@ -189,8 +204,10 @@ Style Definition*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='definition'
        DocBookTag            para
-       DocBookAttr           role='definition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -210,7 +227,7 @@ Style Example*
        EndBabelPreamble
        DocBookWrapperTag     informalexample
        DocBookTag            para
-       DocBookAttr        ""
+       DocBookAttr           ""
 End
 
 
@@ -228,8 +245,10 @@ Style Problem*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -247,8 +266,10 @@ Style Exercise*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='exercise'
        DocBookTag            para
-       DocBookAttr           role='exercise'
+       DocBookGenerateTitle  true
 End
 
 
@@ -266,8 +287,10 @@ Style Solution*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='solution'
        DocBookTag            para
-       DocBookAttr           role='solution'
+       DocBookGenerateTitle  true
 End
 
 
@@ -293,8 +316,10 @@ Style Remark*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
        EndBabelPreamble
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='remark'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
 
@@ -312,8 +337,9 @@ Style Claim*
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='claim'
        DocBookTag            para
-       DocBookAttr           role='claim'
-       DocBookItemTag        ""
+       DocBookGenerateTitle  true
 End
 
index 13021ab6545add708d937bb73c2c24b99695622f..26fba7c61f4cdc568269faf21467f37b8ce8b23e 100644 (file)
@@ -74,8 +74,10 @@ Style Theorem
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='theorem'
        DocBookTag            para
-       DocBookAttr           role='theorem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -93,8 +95,10 @@ Style Corollary
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='corollary'
        DocBookTag            para
-       DocBookAttr           role='corollary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -112,8 +116,10 @@ Style Lemma
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='lemma'
        DocBookTag            para
-       DocBookAttr           role='lemma'
+       DocBookGenerateTitle  true
 End
 
 
@@ -131,8 +137,10 @@ Style Proposition
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -150,8 +158,10 @@ Style Prop
        LabelFont
          Series        Medium
        EndFont
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -176,8 +186,10 @@ Style Conjecture
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='conjecture'
        DocBookTag            para
-       DocBookAttr           role='conjecture'
+       DocBookGenerateTitle  true
 End
 
 
@@ -195,8 +207,10 @@ Style Fact
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='fact'
        DocBookTag            para
-       DocBookAttr           role='fact'
+       DocBookGenerateTitle  true
 End
 
 
@@ -222,8 +236,10 @@ Style Definition
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='definition'
        DocBookTag            para
-       DocBookAttr           role='definition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -244,7 +260,7 @@ Style Example
        EndBabelPreamble
        DocBookWrapperTag     informalexample
        DocBookTag            para
-       DocBookAttr        ""
+       DocBookAttr           ""
 End
 
 
@@ -264,8 +280,10 @@ Style Problem
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -299,8 +317,10 @@ Style Prob
        EndFont
        AddToToc        thm
        IsTocCaption    true
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -319,8 +339,10 @@ Style Solution
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='solution'
        DocBookTag            para
-       DocBookAttr           role='solution'
+       DocBookGenerateTitle  true
 End
 
 
@@ -335,8 +357,10 @@ Style Sol
          Tooltip       "Label of the corresponding problem"
          IsTocCaption true
        EndArgument
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='solution'
        DocBookTag            para
-       DocBookAttr           role='solution'
+       DocBookGenerateTitle  true
 End
 
 
@@ -355,8 +379,10 @@ Style Exercise
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='exercise'
        DocBookTag            para
-       DocBookAttr           role='exercise'
+       DocBookGenerateTitle  true
 End
 
 
@@ -375,8 +401,10 @@ Style Remark
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
        EndBabelPreamble
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='remark'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
 
@@ -390,9 +418,10 @@ Style              Claim
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='claim'
        DocBookTag            para
-       DocBookAttr           role='claim'
-       DocBookItemTag        ""
+       DocBookGenerateTitle  true
 End
 
 
@@ -411,8 +440,10 @@ Style Case
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\casename}{_(Case)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='case'
        DocBookTag            para
-       DocBookAttr           role='case'
+       DocBookGenerateTitle  true
 End
 
 
@@ -431,8 +462,10 @@ Style Property
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\propertyname}{_(Property)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='property'
        DocBookTag            para
-       DocBookAttr           role='property'
+       DocBookGenerateTitle  true
 End
 
 
@@ -451,8 +484,10 @@ Style Question
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\questionname}{_(Question)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='question'
        DocBookTag            para
-       DocBookAttr           role='question'
+       DocBookGenerateTitle  true
 End
 
 
@@ -471,7 +506,9 @@ Style Note
        BabelPreamble
          \addto\captions$$lang{\renewcommand{\notename}{_(Note)}}
        EndBabelPreamble
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='note'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
index 3310b2c4f3bbe24881eae8ba0ea0ec20ac42ebc7..0d7696dd1306af6fd31e3d325fb2cf2af88e3cd8 100644 (file)
@@ -69,8 +69,10 @@ Style Theorem
                \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
        EndBabelPreamble
        Requires              amsthm
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='theorem'
        DocBookTag            para
-       DocBookAttr           role='theorem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -89,8 +91,10 @@ Style Corollary
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='corollary'
        DocBookTag            para
-       DocBookAttr           role='corollary'
+       DocBookGenerateTitle  true
 End
 
 
@@ -109,8 +113,10 @@ Style Lemma
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='lemma'
        DocBookTag            para
-       DocBookAttr           role='lemma'
+       DocBookGenerateTitle  true
 End
 
 
@@ -129,8 +135,10 @@ Style Proposition
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='proposition'
        DocBookTag            para
-       DocBookAttr           role='proposition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -149,8 +157,10 @@ Style Conjecture
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='conjecture'
        DocBookTag            para
-       DocBookAttr           role='conjecture'
+       DocBookGenerateTitle  true
 End
 
 
@@ -169,8 +179,10 @@ Style Fact
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='fact'
        DocBookTag            para
-       DocBookAttr           role='fact'
+       DocBookGenerateTitle  true
 End
 
 
@@ -196,8 +208,10 @@ Style Definition
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='definition'
        DocBookTag            para
-       DocBookAttr           role='definition'
+       DocBookGenerateTitle  true
 End
 
 
@@ -235,8 +249,10 @@ Style Problem
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='problem'
        DocBookTag            para
-       DocBookAttr           role='problem'
+       DocBookGenerateTitle  true
 End
 
 
@@ -254,8 +270,10 @@ Style Exercise
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='exercise'
        DocBookTag            para
-       DocBookAttr           role='exercise'
+       DocBookGenerateTitle  true
 End
 
 
@@ -273,8 +291,10 @@ Style Solution
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='solution'
        DocBookTag            para
-       DocBookAttr           role='solution'
+       DocBookGenerateTitle  true
 End
 
 
@@ -301,8 +321,10 @@ Style Remark
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
        EndBabelPreamble
-       DocBookTag            note
-       DocBookItemTag        para
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='remark'
+       DocBookTag            para
+       DocBookGenerateTitle  true
 End
 
 
@@ -320,9 +342,10 @@ Style Claim
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
        EndBabelPreamble
+       DocBookWrapperTag     figure
+       DocBookWrapperAttr    role='claim'
        DocBookTag            para
-       DocBookAttr           role='claim'
-       DocBookItemTag        ""
+       DocBookGenerateTitle  true
 End
 
 Input theorems-case.inc
index cc609929ef7eab1e0f34193a7646a3570bb7eebc..4f5cb04f68f8f8acc75be53dd7d239dd6f2a43a5 100644 (file)
@@ -11,7 +11,7 @@
 # This script will update a .layout file to current format
 
 # The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 98
+currentFormat = 99
 
 
 # Incremented to format 4, 6 April 2007, lasgouttes
@@ -331,6 +331,9 @@ currentFormat = 98
 # Incremented to format 98, 5 December 2022 by rikiheck
 # Add HTMLClass for InsetLayout
 
+# Incremented to format 99, 22 December 2022 by tcuvelier
+# Add DocBookGenerateTitle for Layout
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -578,7 +581,7 @@ def convert(lines, end_format):
                 i += 1
             continue
 
-        if 87 <= format <= 97:
+        if 87 <= format <= 98:
             # nothing to do.
             i += 1
             continue
index 716da3f78c16327aa464303c26e238297c972881..c54e121d23add7f3c9091ce5dcf66fd19fed06c7 100644 (file)
@@ -111,6 +111,7 @@ enum LayoutTags {
        LT_DOCBOOKINNERTAGTYPE,
        LT_DOCBOOKININFO,
        LT_DOCBOOKABSTRACT,
+       LT_DOCBOOKGENERATETITLE,
        LT_DOCBOOKWRAPPERTAG,
        LT_DOCBOOKWRAPPERATTR,
        LT_DOCBOOKWRAPPERTAGTYPE,
@@ -240,6 +241,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass,
                { "docbookabstract",           LT_DOCBOOKABSTRACT },
                { "docbookattr",               LT_DOCBOOKATTR },
                { "docbookforceabstracttag",   LT_DOCBOOKFORCEABSTRACTTAG },
+               { "docbookgeneratetitle",      LT_DOCBOOKGENERATETITLE },
                { "docbookininfo",             LT_DOCBOOKININFO },
                { "docbookinnerattr",          LT_DOCBOOKINNERATTR },
                { "docbookinnertag",           LT_DOCBOOKINNERTAG },
@@ -872,6 +874,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass,
             lex >> docbooknofontinside_;
             break;
 
+        case LT_DOCBOOKGENERATETITLE:
+            lex >> docbookgeneratetitle_;
+            break;
+
                case LT_SPELLCHECK:
                        lex >> spellcheck;
                        break;
index 7fc8a7c7772413d81111840c070f5bf2a46d1f69..6efc5129f97ea97c5e1db94558868193b0e1d70e 100644 (file)
@@ -265,6 +265,8 @@ public:
        ///
        bool docbooknofontinside() const { return docbooknofontinside_; }
        ///
+       bool docbookgeneratetitle() const { return docbookgeneratetitle_; }
+       ///
        bool isParagraph() const { return latextype == LATEX_PARAGRAPH; }
        ///
        bool isCommand() const { return latextype == LATEX_COMMAND; }
@@ -587,10 +589,14 @@ private:
        bool docbookabstract_;
        /// Whether this element (root or not) does not accept text without a section (i.e. the first text that is met
        /// in LyX must be considered as the abstract if this is true); this text must be output with the specific tag
-       /// held by this attribute
+       /// held by this attribute.
        mutable std::string docbookforceabstracttag_;
        /// Whether font tags are allowed inside this tag.
        bool docbooknofontinside_ = false;
+       /// Whether LyX should create a title on its own, just after the wrapper tag. Typically, this parameter is required
+       /// because the wrapper tag requires a title (like a figure). The generated title will be similar to a LyXHTML label
+       /// (environment type and a number).
+       bool docbookgeneratetitle_ = false;
        /// Should we generate the default CSS for this layout, even if HTMLStyle
        /// has been given? Default is false.
        /// Note that the default CSS is output first, then the user CSS, so it is
index 8973eb0643cc469c194f6ac0afd06da37f4cb464..56054180a041804e23665e275fb8e7171c7d1ce6 100644 (file)
@@ -59,7 +59,7 @@ namespace lyx {
 // You should also run the development/tools/updatelayouts.py script,
 // to update the format of all of our layout files.
 //
-int const LAYOUT_FORMAT = 98; // rikiheck: HTMLClass for InsetLayout
+int const LAYOUT_FORMAT = 99; // tcuvelier: add docbookgeneratetitle
 
 
 // Layout format for the current lyx file format. Controls which format is
index 5e1f6d12cf2829fc281a1cd95268d9967249270f..c80a7cdb91b7e4dab05591cc308c23e63ac205ae 100644 (file)
@@ -200,9 +200,18 @@ void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar
        }
 
        // Main logic.
-       if (openWrapper)
+       if (openWrapper) {
                xml::openTag(xs, lay.docbookwrappertag(), lay.docbookwrapperattr(), lay.docbookwrappertagtype());
 
+               if (lay.docbookgeneratetitle()) {
+                       docstring const label = par->params().labelString();
+
+                       xml::openTag(xs, "title", "", "paragraph");
+                       xs << (!label.empty() ? label : from_ascii("No title"));
+                       xml::closeTag(xs, "title", "paragraph");
+               }
+       }
+
        const string & tag = lay.docbooktag();
        if (tag != "NONE") {
                auto xmltag = xml::ParTag(tag, lay.docbookattr());
@@ -508,7 +517,9 @@ void makeEnvironment(Text const &text,
                std::vector<docstring> pars_prepend;
         std::vector<docstring> pars;
         std::vector<docstring> pars_append;
-        tie(pars_prepend, pars, pars_append) = par->simpleDocBookOnePar(buf, runparams, text.outerFont(std::distance(text.paragraphs().begin(), par)), 0, false, ignoreFonts);
+        tie(pars_prepend, pars, pars_append) =
+                               par->simpleDocBookOnePar(buf, runparams, text.outerFont(std::distance(text.paragraphs().begin(), par)),
+                                                                                0, false, ignoreFonts);
 
         for (docstring const & parXML : pars_prepend)
             xs << XMLStream::ESCAPE_NONE << parXML;