]> git.lyx.org Git - lyx.git/commitdiff
* add modules to do equation/figure/table numbering sectionwise.
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 28 Sep 2009 11:06:53 +0000 (11:06 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 28 Sep 2009 11:06:53 +0000 (11:06 +0000)
  Use these modules in the AMS classes (instead of preamble hardcoding).

This is bug 6123.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31475 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/amsart.layout
lib/layouts/amsbook.layout
lib/layouts/eqs-within-sections.module [new file with mode: 0644]
lib/layouts/figs-within-sections.module [new file with mode: 0644]
lib/layouts/tabs-within-sections.module [new file with mode: 0644]

index 5171d64c75320c02ff24dee2cbf5fb78bfa4660a..e459fd90849ae8bbf4a68d2eca3288e4897ca1d8 100644 (file)
@@ -8,6 +8,7 @@
 # modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
 # Tinkered with Sep. '07 by Paul Rubin <rubin@msu.edu>
 # Modularized Jan '08 by Richard Heck <rgheck@brown.edu>
+# Moved "number within sections" to modules Aug '09 (Paul Rubin <rubin@msu.edu>)
 
 Format 11
 Columns                 1
@@ -20,6 +21,8 @@ ClassOptions
 End
 
 DefaultModule theorems-ams
+DefaultModule eqs-within-sections
+DefaultModule figs-within-sections
 
 Style Standard
        Category              MainText
@@ -33,13 +36,6 @@ Style Standard
        LabelType             No_Label
 End
 
-
-Preamble
-       \numberwithin{equation}{section} %% Comment out for sequentially-numbered
-       \numberwithin{figure}{section} %% Comment out for sequentially-numbered
-EndPreamble
-
-
 Input stdfloats.inc
 Input stdcounters.inc
 Input stdinsets.inc
index a9affb83e5a8d0a1a5964408e69aaa929f52ece2..c127f7465765167deb7b1b689ebe66e497e3574d 100644 (file)
@@ -8,6 +8,7 @@
 # modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
 # Tinkered with Sep. '07 by Paul Rubin <rubin@msu.edu>
 # Modularized Jan '08 by Richard Heck <rgheck@brown.edu>
+# Moved "number within sections" to modules Aug '09 (Paul Rubin <rubin@msu.edu>)
 
 
 Format 11
@@ -21,6 +22,8 @@ ClassOptions
 End
 
 DefaultModule theorems-ams
+DefaultModule eqs-within-sections
+DefaultModule figs-within-sections
 
 Style Standard
        Category              MainText
@@ -37,8 +40,6 @@ End
 
 Preamble
        \numberwithin{section}{chapter}
-       \numberwithin{equation}{section} %% Comment out for sequentially-numbered
-       \numberwithin{figure}{section} %% Comment out for sequentially-numbered
 EndPreamble
 
 
diff --git a/lib/layouts/eqs-within-sections.module b/lib/layouts/eqs-within-sections.module
new file mode 100644 (file)
index 0000000..4b0ffca
--- /dev/null
@@ -0,0 +1,13 @@
+#\DeclareLyXModule{Number Equations by Section}
+#DescriptionBegin
+#Resets the equation number at section start and prepends
+#the section number to the equation number, as in '(2.1)'.
+#DescriptionEnd
+
+Format 11
+
+Requires amsmath
+
+AddToPreamble
+       \numberwithin{equation}{section}
+EndPreamble
diff --git a/lib/layouts/figs-within-sections.module b/lib/layouts/figs-within-sections.module
new file mode 100644 (file)
index 0000000..98cd34b
--- /dev/null
@@ -0,0 +1,18 @@
+#\DeclareLyXModule{Number Figures by Section}
+#DescriptionBegin
+#Resets the figure number at section start and prepends
+#the section number to the figure number, as in 'fig. 2.1'.
+#DescriptionEnd
+
+Format 11
+
+Requires amsmath
+
+AddToPreamble
+       \numberwithin{figure}{section}
+EndPreamble
+
+Float
+       Type                  figure
+       NumberWithin          section
+End
diff --git a/lib/layouts/tabs-within-sections.module b/lib/layouts/tabs-within-sections.module
new file mode 100644 (file)
index 0000000..221afb8
--- /dev/null
@@ -0,0 +1,18 @@
+#\DeclareLyXModule{Number Tables by Section}
+#DescriptionBegin
+#Resets the table number at section start and prepends
+#the section number to the table number, as in 'Table 2.1'.
+#DescriptionEnd
+
+Format 11
+
+Requires amsmath
+
+AddToPreamble
+       \numberwithin{table}{section}
+EndPreamble
+
+Float
+       Type                  figure
+       NumberWithin          section
+End