diff --git a/src/guide/xml/ch03.xml b/src/guide/xml/ch03.xml
index c4a5ba854..4d713807b 100644
--- a/src/guide/xml/ch03.xml
+++ b/src/guide/xml/ch03.xml
@@ -738,12 +738,9 @@ check whether a corresponding glossentry exists for a
glossterm or firstterm while you are still
writing. Corresponding Schematron schemas are not yet part of the
xslTNG framework.
-
-
- Caveats
- The use of glossdiv is not supported for automatic glossaries, all
- of the entries will appear in a flat list.
-
+
+Generating glossary divisions automatically is controlled by the
+glossary-automatic-divisions parameter.
diff --git a/src/guide/xml/ref-params.xml b/src/guide/xml/ref-params.xml
index f7efd6df7..846173224 100644
--- a/src/guide/xml/ref-params.xml
+++ b/src/guide/xml/ref-params.xml
@@ -2022,7 +2022,7 @@ the first term is used.
glossary-sort-entries
- true()
+ 'true'
@@ -2030,7 +2030,7 @@ the first term is used.
Description
-If glossary-sort-entries is true, the entries in a
+If glossary-sort-entriesis true, the entries in a
glossary or glosslist will be sorted before transformation.
This saves the author from the burden of maintaining the list in a strictly
alphabetic order.
@@ -2038,6 +2038,41 @@ alphabetic order.
+
+
+
+ glossary-automatic-divisions
+ 'false'
+
+
+
+ Divide glossaries into sections?
+
+
+Description
+If glossary-automatic-divisionsis true,
+the entries in an automatically constructed glossary will be grouped. The actual grouping
+is performed by the t:glossary-divisions template. This parameter is
+false by default for backwards compatibility.
+
+
+Automatic divisions can be specified on a per-glossary basis with a
+db processing instruction
+
+db processing instruction
+ using the glossary-divisions
+db processing instruction
+glossary-divisions pseudo-attribute
+
+pseudo-attribute with a value of true or false.
+
+This parameter only applies if
+glossary-sort-entriesis true and the glossary
+is not already grouped with glossdiv elements by hand.
+
+
+
+
diff --git a/src/guide/xml/ref-templates.xml b/src/guide/xml/ref-templates.xml
index 7fadbb182..da040b117 100644
--- a/src/guide/xml/ref-templates.xml
+++ b/src/guide/xml/ref-templates.xml
@@ -665,4 +665,25 @@ element with an xlink:href attribute) and extended links.
+
+
+
+t:glossary-divisions
+{http://docbook.org/ns/docbook/templates}glossary-divisions
+
+
+t:glossary-divisions
+Groups entries in a glossary
+template
+
+
+Description
+If glossary-automatic-divisionsis true,
+this template is used to construct the divisions. By default, it makes groups based on the
+(upper-case) first letter of the terms. It does not add a grouping wrapper if there’s only
+one group.
+
+
+
+
diff --git a/src/main/scss/media-all.scss b/src/main/scss/media-all.scss
index af4f497d5..873e14e51 100644
--- a/src/main/scss/media-all.scss
+++ b/src/main/scss/media-all.scss
@@ -1506,11 +1506,14 @@ li[db-mark='box'] {
/* ============================================================ */
-
.glossdiv {
margin-top: 1em;
}
+.glossdiv dl dt {
+ padding-left: 1em;
+}
+
/* ============================================================ */
.sidebar {
diff --git a/src/main/xslt/modules/glossary.xsl b/src/main/xslt/modules/glossary.xsl
index 80fee8137..c59da9f32 100644
--- a/src/main/xslt/modules/glossary.xsl
+++ b/src/main/xslt/modules/glossary.xsl
@@ -19,27 +19,76 @@
+
+
+
-
-
+
-
+
@@ -175,7 +175,7 @@
-
+
diff --git a/src/test/resources/expected/glossary.001.html b/src/test/resources/expected/glossary.001.html
index 2214ec751..5d4d77bae 100644
--- a/src/test/resources/expected/glossary.001.html
+++ b/src/test/resources/expected/glossary.001.html
@@ -42,4 +42,4 @@
flowering vine in the family Piperaceae, cultivated for its fruit, which is usually
dried and used as a spice and seasoning. Long pepper has a taste similar to, but sweeter
and less pungent than, that of its close relative Piper nigrum – from which black, green
- and white pepper are obtained.