From 5695850a49b231d5aaa33cb7a02dd46038344ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 28 Sep 2009 11:06:53 +0000 Subject: [PATCH] * add modules to do equation/figure/table numbering sectionwise. 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 | 10 +++------- lib/layouts/amsbook.layout | 5 +++-- lib/layouts/eqs-within-sections.module | 13 +++++++++++++ lib/layouts/figs-within-sections.module | 18 ++++++++++++++++++ lib/layouts/tabs-within-sections.module | 18 ++++++++++++++++++ 5 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 lib/layouts/eqs-within-sections.module create mode 100644 lib/layouts/figs-within-sections.module create mode 100644 lib/layouts/tabs-within-sections.module diff --git a/lib/layouts/amsart.layout b/lib/layouts/amsart.layout index 5171d64c75..e459fd9084 100644 --- a/lib/layouts/amsart.layout +++ b/lib/layouts/amsart.layout @@ -8,6 +8,7 @@ # modified and modularized by Emmanuel GUREGHIAN # Tinkered with Sep. '07 by Paul Rubin # Modularized Jan '08 by Richard Heck +# Moved "number within sections" to modules Aug '09 (Paul Rubin ) 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 diff --git a/lib/layouts/amsbook.layout b/lib/layouts/amsbook.layout index a9affb83e5..c127f74657 100644 --- a/lib/layouts/amsbook.layout +++ b/lib/layouts/amsbook.layout @@ -8,6 +8,7 @@ # modified and modularized by Emmanuel GUREGHIAN # Tinkered with Sep. '07 by Paul Rubin # Modularized Jan '08 by Richard Heck +# Moved "number within sections" to modules Aug '09 (Paul Rubin ) 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 index 0000000000..4b0ffca0e6 --- /dev/null +++ b/lib/layouts/eqs-within-sections.module @@ -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 index 0000000000..98cd34bd6c --- /dev/null +++ b/lib/layouts/figs-within-sections.module @@ -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 index 0000000000..221afb8f1f --- /dev/null +++ b/lib/layouts/tabs-within-sections.module @@ -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