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).
--- /dev/null
+#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
--- /dev/null
+<?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>π</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>π</m:mi>
+ <m:mspace width="6px"/>
+ <m:msup><m:mi>ρ</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>≠</m:mo>
+ <m:mi>b</m:mi>
+ <m:mn>.</m:mn>
+ </m:mrow>
+</m:mrow>
+</m:math>
+</informalequation>
+Clear, don’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
Shape Up
Series Bold
EndFont
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='theorem'
DocBookTag para
- DocBookAttr role='theorem'
+ DocBookGenerateTitle true
End
LabelFont
Series Bold
EndFont
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proof'
DocBookTag para
- DocBookAttr role='proof'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName lem
LabelString "Lemma \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='lemma'
DocBookTag para
- DocBookAttr role='lemma'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName cor
LabelString "Corollary \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='corollary'
DocBookTag para
- DocBookAttr role='corollary'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName prop
LabelString "Proposition \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName crit
LabelString "Criterion \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='criterion'
DocBookTag para
- DocBookAttr role='criterion'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName alg
LabelString "Algorithm \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='algorithm'
DocBookTag para
- DocBookAttr role='algorithm'
+ DocBookGenerateTitle true
End
Shape Up
Series Bold
EndFont
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='definition'
DocBookTag para
- DocBookAttr role='definition'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName conj
LabelString "Conjecture \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='conjecture'
DocBookTag para
- DocBookAttr role='conjecture'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName prob
LabelString "Problem \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName rem
LabelString "Remark \arabic{theorem}"
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='remark'
+ DocBookTag para
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName note
LabelString "Note \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='note'
DocBookTag para
- DocBookAttr role='note'
+ DocBookGenerateTitle true
End
CopyStyle Theorem
LatexName claim
LabelString "Claim \arabic{theorem}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='claim'
DocBookTag para
- DocBookAttr role='claim'
+ DocBookGenerateTitle true
End
LatexName summ
LabelCounter summ
LabelString "Summary \arabic{summ}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='summary'
DocBookTag para
- DocBookAttr role='summary'
+ DocBookGenerateTitle true
End
LatexName case
LabelCounter case
LabelString "Case \arabic{case}"
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='case'
DocBookTag para
- DocBookAttr role='case'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
EndBabelPreamble
Requires amsthm
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='theorem'
DocBookTag para
- DocBookAttr role='theorem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='corollary'
DocBookTag para
- DocBookAttr role='corollary'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
EndBabelPreamble
LabelCounter lemma
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='lemma'
DocBookTag para
- DocBookAttr role='lemma'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
EndBabelPreamble
LabelCounter proposition
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
EndBabelPreamble
LabelCounter conjecture
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='conjecture'
DocBookTag para
- DocBookAttr role='conjecture'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
EndBabelPreamble
LabelCounter fact
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='fact'
DocBookTag para
- DocBookAttr role='fact'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
EndBabelPreamble
LabelCounter definition
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='definition'
DocBookTag para
- DocBookAttr role='definition'
+ DocBookGenerateTitle true
End
LabelCounter example
DocBookWrapperTag informalexample
DocBookTag para
- DocBookAttr ""
+ DocBookAttr ""
End
\addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
EndBabelPreamble
LabelCounter problem
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
EndBabelPreamble
LabelCounter exercise
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='exercise'
DocBookTag para
- DocBookAttr role='exercise'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
EndBabelPreamble
LabelCounter solution
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='solution'
DocBookTag para
- DocBookAttr role='solution'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
EndBabelPreamble
LabelCounter remark
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='remark'
+ DocBookTag para
+ DocBookGenerateTitle true
End
\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
\addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
EndBabelPreamble
Requires amsthm
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='theorem'
DocBookTag para
- DocBookAttr role='theorem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='corollary'
DocBookTag para
- DocBookAttr role='corollary'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
EndBabelPreamble
LabelCounter lemma
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='lemma'
DocBookTag para
- DocBookAttr role='lemma'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
EndBabelPreamble
LabelCounter proposition
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
EndBabelPreamble
LabelCounter conjecture
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='conjecture'
DocBookTag para
- DocBookAttr role='conjecture'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
EndBabelPreamble
LabelCounter fact
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='fact'
DocBookTag para
- DocBookAttr role='fact'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
EndBabelPreamble
LabelCounter definition
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='definition'
DocBookTag para
- DocBookAttr role='definition'
+ DocBookGenerateTitle true
End
LabelCounter example
DocBookWrapperTag informalexample
DocBookTag para
- DocBookAttr ""
+ DocBookAttr ""
End
\addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
EndBabelPreamble
LabelCounter problem
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
EndBabelPreamble
LabelCounter exercise
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='exercise'
DocBookTag para
- DocBookAttr role='exercise'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
EndBabelPreamble
LabelCounter solution
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='solution'
DocBookTag para
- DocBookAttr role='solution'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
EndBabelPreamble
LabelCounter remark
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='remark'
+ DocBookTag para
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
EndBabelPreamble
LabelCounter claim
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='claim'
DocBookTag para
- DocBookAttr role='claim'
- DocBookItemTag ""
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
EndBabelPreamble
Requires amsthm
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='theorem'
DocBookTag para
- DocBookAttr role='theorem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='corollary'
DocBookTag para
- DocBookAttr role='corollary'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='lemma'
DocBookTag para
- DocBookAttr role='lemma'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='conjecture'
DocBookTag para
- DocBookAttr role='conjecture'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='fact'
DocBookTag para
- DocBookAttr role='fact'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='definition'
DocBookTag para
- DocBookAttr role='definition'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='exercise'
DocBookTag para
- DocBookAttr role='exercise'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='solution'
DocBookTag para
- DocBookAttr role='solution'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
EndBabelPreamble
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='remark'
+ DocBookTag para
+ DocBookGenerateTitle true
End
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
\addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
EndBabelPreamble
Requires amsthm
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='theorem'
DocBookTag para
- DocBookAttr role='theorem'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
EndBabelPreamble
LabelCounter corollary
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='corollary'
DocBookTag para
- DocBookAttr role='corollary'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
EndBabelPreamble
LabelCounter lemma
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='lemma'
DocBookTag para
- DocBookAttr role='lemma'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
EndBabelPreamble
LabelCounter proposition
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
EndBabelPreamble
LabelCounter conjecture
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='conjecture'
DocBookTag para
- DocBookAttr role='conjecture'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
EndBabelPreamble
LabelCounter fact
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='fact'
DocBookTag para
- DocBookAttr role='fact'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
EndBabelPreamble
LabelCounter definition
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='definition'
DocBookTag para
- DocBookAttr role='definition'
+ DocBookGenerateTitle true
End
LabelCounter example
DocBookWrapperTag informalexample
DocBookTag para
- DocBookAttr ""
+ DocBookAttr ""
End
\addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
EndBabelPreamble
LabelCounter problem
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
EndBabelPreamble
LabelCounter exercise
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='exercise'
DocBookTag para
- DocBookAttr role='exercise'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
EndBabelPreamble
LabelCounter solution
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='solution'
DocBookTag para
- DocBookAttr role='solution'
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
EndBabelPreamble
LabelCounter remark
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='remark'
+ DocBookTag para
+ DocBookGenerateTitle true
End
\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
# - 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"
\addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
EndBabelPreamble
Requires amsthm
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='theorem'
DocBookTag para
- DocBookAttr role='theorem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='corollary'
DocBookTag para
- DocBookAttr role='corollary'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='lemma'
DocBookTag para
- DocBookAttr role='lemma'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='conjecture'
DocBookTag para
- DocBookAttr role='conjecture'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='fact'
DocBookTag para
- DocBookAttr role='fact'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='definition'
DocBookTag para
- DocBookAttr role='definition'
+ DocBookGenerateTitle true
End
EndBabelPreamble
DocBookWrapperTag informalexample
DocBookTag para
- DocBookAttr ""
+ DocBookAttr ""
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='exercise'
DocBookTag para
- DocBookAttr role='exercise'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='solution'
DocBookTag para
- DocBookAttr role='solution'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
EndBabelPreamble
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='remark'
+ DocBookTag para
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='claim'
DocBookTag para
- DocBookAttr role='claim'
- DocBookItemTag ""
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='theorem'
DocBookTag para
- DocBookAttr role='theorem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='corollary'
DocBookTag para
- DocBookAttr role='corollary'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='lemma'
DocBookTag para
- DocBookAttr role='lemma'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
LabelFont
Series Medium
EndFont
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='conjecture'
DocBookTag para
- DocBookAttr role='conjecture'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='fact'
DocBookTag para
- DocBookAttr role='fact'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='definition'
DocBookTag para
- DocBookAttr role='definition'
+ DocBookGenerateTitle true
End
EndBabelPreamble
DocBookWrapperTag informalexample
DocBookTag para
- DocBookAttr ""
+ DocBookAttr ""
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
EndFont
AddToToc thm
IsTocCaption true
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='solution'
DocBookTag para
- DocBookAttr role='solution'
+ DocBookGenerateTitle true
End
Tooltip "Label of the corresponding problem"
IsTocCaption true
EndArgument
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='solution'
DocBookTag para
- DocBookAttr role='solution'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='exercise'
DocBookTag para
- DocBookAttr role='exercise'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
EndBabelPreamble
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='remark'
+ DocBookTag para
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\claimname}{_(Claim)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='claim'
DocBookTag para
- DocBookAttr role='claim'
- DocBookItemTag ""
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\casename}{_(Case)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='case'
DocBookTag para
- DocBookAttr role='case'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\propertyname}{_(Property)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='property'
DocBookTag para
- DocBookAttr role='property'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\questionname}{_(Question)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='question'
DocBookTag para
- DocBookAttr role='question'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\notename}{_(Note)}}
EndBabelPreamble
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='note'
+ DocBookTag para
+ DocBookGenerateTitle true
End
\addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
EndBabelPreamble
Requires amsthm
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='theorem'
DocBookTag para
- DocBookAttr role='theorem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\corollaryname}{_(Corollary)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='corollary'
DocBookTag para
- DocBookAttr role='corollary'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='lemma'
DocBookTag para
- DocBookAttr role='lemma'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\propositionname}{_(Proposition)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='proposition'
DocBookTag para
- DocBookAttr role='proposition'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\conjecturename}{_(Conjecture)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='conjecture'
DocBookTag para
- DocBookAttr role='conjecture'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\factname}{_(Fact)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='fact'
DocBookTag para
- DocBookAttr role='fact'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\definitionname}{_(Definition)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='definition'
DocBookTag para
- DocBookAttr role='definition'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\problemname}{_(Problem)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='problem'
DocBookTag para
- DocBookAttr role='problem'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\exercisename}{_(Exercise)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='exercise'
DocBookTag para
- DocBookAttr role='exercise'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\solutionname}{_(Solution)}}
EndBabelPreamble
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='solution'
DocBookTag para
- DocBookAttr role='solution'
+ DocBookGenerateTitle true
End
BabelPreamble
\addto\captions$$lang{\renewcommand{\remarkname}{_(Remark)}}
EndBabelPreamble
- DocBookTag note
- DocBookItemTag para
+ DocBookWrapperTag figure
+ DocBookWrapperAttr role='remark'
+ DocBookTag para
+ DocBookGenerateTitle true
End
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
# 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
# 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").
i += 1
continue
- if 87 <= format <= 97:
+ if 87 <= format <= 98:
# nothing to do.
i += 1
continue
LT_DOCBOOKINNERTAGTYPE,
LT_DOCBOOKININFO,
LT_DOCBOOKABSTRACT,
+ LT_DOCBOOKGENERATETITLE,
LT_DOCBOOKWRAPPERTAG,
LT_DOCBOOKWRAPPERATTR,
LT_DOCBOOKWRAPPERTAGTYPE,
{ "docbookabstract", LT_DOCBOOKABSTRACT },
{ "docbookattr", LT_DOCBOOKATTR },
{ "docbookforceabstracttag", LT_DOCBOOKFORCEABSTRACTTAG },
+ { "docbookgeneratetitle", LT_DOCBOOKGENERATETITLE },
{ "docbookininfo", LT_DOCBOOKININFO },
{ "docbookinnerattr", LT_DOCBOOKINNERATTR },
{ "docbookinnertag", LT_DOCBOOKINNERTAG },
lex >> docbooknofontinside_;
break;
+ case LT_DOCBOOKGENERATETITLE:
+ lex >> docbookgeneratetitle_;
+ break;
+
case LT_SPELLCHECK:
lex >> spellcheck;
break;
///
bool docbooknofontinside() const { return docbooknofontinside_; }
///
+ bool docbookgeneratetitle() const { return docbookgeneratetitle_; }
+ ///
bool isParagraph() const { return latextype == LATEX_PARAGRAPH; }
///
bool isCommand() const { return latextype == LATEX_COMMAND; }
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
// 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
}
// 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());
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;