--- elyxer-1.2.5.orig/src/conf/base.cfg 2013-03-11 05:23:48.000000000 +0800 +++ elyxer-1.2.5/src/conf/base.cfg 2014-02-15 21:23:42.529872477 +0800 @@ -189,6 +189,19 @@ \begin_inset space:Space \begin_layout:Layout \begin_layout Abstract:Abstract +\begin_layout Lemma:Theorem +\begin_layout Definition:Theorem +\begin_layout Theorem:Theorem +\begin_layout Conjecture:Theorem +\begin_layout Proposition:Theorem +\begin_layout Problem:Theorem +\begin_layout Corollary:Theorem +\begin_layout Exercise:Theorem +\begin_layout Example:Theorem +\begin_layout Remark:Theorem +\begin_layout Claim:Theorem +\begin_layout Fact:Theorem +\begin_layout Proof:Proof \begin_layout Author:Author \begin_layout Chunk:NewfangledChunk \begin_layout Bibliography:Bibliography @@ -1474,7 +1487,7 @@ endcommand:} [NumberingConfig.layouts] -ordered:[Chapter,Section,Subsection,Subsubsection,Paragraph] +ordered:[Chapter,Section,Subsection,Subsubsection,Paragraph,Theorem] roman:[Part,Book] [NumberingConfig.sequence] @@ -1560,6 +1573,7 @@ Date:h2 Paragraph:div Part:h1 +Proof:blockquote Quotation:blockquote Quote:blockquote Section:h? @@ -1609,6 +1623,7 @@ Book:Book Chapter:Chapter Section:Section +Lemma:Lemma Subsection:Subsection Subsubsection:Subsubsection Paragraph:Paragraph --- elyxer-1.2.5.orig/src/elyxer/gen/layout.py 2013-01-12 06:11:36.000000000 +0800 +++ elyxer-1.2.5/src/elyxer/gen/layout.py 2014-02-15 21:23:29.201872836 +0800 @@ -38,6 +38,7 @@ "A layout (block of text) inside a lyx file" type = 'none' + oldlayout='none' def __init__(self): "Initialize the layout." @@ -56,6 +57,7 @@ else: self.output.tag = 'div class="' + self.type + '"' self.numerate() + Layout.oldlayout=self.type def numerate(self): "Numerate if necessary." @@ -77,6 +79,7 @@ def process(self): self.type = 'standard' + Layout.oldlayout=self.type self.output = ContentsOutput() def complete(self, contents): @@ -120,6 +123,43 @@ self.contents.insert(0, tagged) Abstract.done = True +class Theorem(Layout): + "A numbered theorem or lemma etc." + + number = 0 + type='Theorem' + + def process(self): + #self.type = self.header[1] + self.type = 'Theorem' + self.output.tag = 'div class="Theorem"' + #self.output.tag = 'i' + if Layout.oldlayout == self.header[1]: + return + Layout.oldlayout = self.header[1] + Theorem.number = Theorem.number + 1 + #message = Translator.translate('lemma') + message = self.header[1]+" "+str(Theorem.number)+'. ' + tagged = TaggedText().constant(message, 'b', True) + self.contents.insert(0, tagged) + Layout.numerate(self) + +class Proof(Layout): + "A proof of e.g. a theorem" + + type='none' + + def process(self): + self.type = self.header[1] + self.output.tag = 'div class="Proof"' + if Layout.oldlayout == self.type: + return + Layout.oldlayout = self.type + #message = Translator.translate('lemma') + message = 'Proof. ' + tagged = TaggedText().constant(message, 'i', True) + self.contents.insert(0, tagged) + class FirstWorder(Layout): "A layout where the first word is extracted" --- elyxer-1.2.5.orig/test/theorems.lyx 1970-01-01 08:00:00.000000000 +0800 +++ elyxer-1.2.5/test/theorems.lyx 2014-02-15 21:14:32.361887274 +0800 @@ -0,0 +1,197 @@ +#LyX 2.0 created this file. For more info see http://www.lyx.org/ +\lyxformat 413 +\begin_document +\begin_header +\textclass article +\use_default_options true +\begin_modules +theorems-std +\end_modules +\maintain_unincluded_children false +\language english +\language_package default +\inputencoding auto +\fontencoding global +\font_roman default +\font_sans default +\font_typewriter default +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_osf false +\font_sf_scale 100 +\font_tt_scale 100 + +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_amsmath 1 +\use_esint 1 +\use_mhchem 1 +\use_mathdots 1 +\cite_engine basic +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\use_refstyle 1 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\quotes_language english +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\end_header + +\begin_body + +\begin_layout Section +\begin_inset CommandInset label +LatexCommand label +name "sec:one" + +\end_inset + +This is a Section +\end_layout + +\begin_layout Lemma +This is lemma 1 +\end_layout + +\begin_layout Lemma +This is still lemma 1 +\end_layout + +\begin_layout Standard +This is a normal paragraph +\end_layout + +\begin_layout Lemma +\begin_inset CommandInset label +LatexCommand label +name "lem:This-is-lemma-2" + +\end_inset + +This is lemma 2 +\end_layout + +\begin_layout Corollary +\begin_inset CommandInset label +LatexCommand label +name "cor:A-Corollary" + +\end_inset + +A Corollary +\end_layout + +\begin_layout Proposition +Proposition +\end_layout + +\begin_layout Conjecture +Conjecture +\end_layout + +\begin_layout Fact +Fact +\end_layout + +\begin_layout Definition +Definition +\end_layout + +\begin_layout Example +Example +\end_layout + +\begin_layout Problem +Problem +\end_layout + +\begin_layout Exercise +Exercise +\end_layout + +\begin_layout Remark +Remark +\end_layout + +\begin_layout Proof +This is a proof +\end_layout + +\begin_layout Proof +This is part of the same proof +\end_layout + +\begin_layout Proof +This is not a proof +\end_layout + +\begin_layout Claim +Claim +\end_layout + +\begin_layout Proof +This is a proof +\end_layout + +\begin_layout Standard +See Lemma 2 at Lemma +\begin_inset CommandInset ref +LatexCommand ref +reference "lem:This-is-lemma-2" + +\end_inset + + and +\begin_inset CommandInset ref +LatexCommand formatted +reference "lem:This-is-lemma-2" + +\end_inset + +. +\end_layout + +\begin_layout Standard +We here reference Section 1 as +\begin_inset CommandInset ref +LatexCommand formatted +reference "sec:one" + +\end_inset + +, and Corollary 3 at Corollary +\begin_inset CommandInset ref +LatexCommand ref +reference "cor:A-Corollary" + +\end_inset + +. +\end_layout + +\end_body +\end_document --- elyxer-1.2.5.orig/test/theorems-good.html 1970-01-01 08:00:00.000000000 +0800 +++ elyxer-1.2.5/test/theorems-good.html 2014-02-15 21:21:49.005875530 +0800 @@ -0,0 +1,125 @@ + + + +
+ + + + +