diff --git a/CHANGES.md b/CHANGES.md
index 8efa6a35..62a73afc 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -30,6 +30,7 @@ This file describes changes in the AutoDoc package.
Markdown-like text; `@listing`, `@example`, and `@log` info strings
select the corresponding GAPDoc element
- Add `@Index` command for generating index entries
+ - Allow overriding the LaTeX bibliography style via `scaffold.bibstyle`
- In Markdown-like inline backtick code spans, emit
`...` for GAP keywords (as returned by
`ALL_KEYWORDS()`), otherwise as before `...`
diff --git a/gap/AutoDocMainFunction.gi b/gap/AutoDocMainFunction.gi
index e0195957..13856adf 100644
--- a/gap/AutoDocMainFunction.gi
+++ b/gap/AutoDocMainFunction.gi
@@ -134,7 +134,11 @@ InstallGlobalFunction( CreateMainPage,
fi;
if IsBound( opt.bib ) and opt.bib <> false then
- AppendTo( filestream, "\n" );
+ AppendTo( filestream, "\n" );
fi;
if IsBound( opt.index ) and opt.index = true then
diff --git a/gap/Magic.gd b/gap/Magic.gd
index 45ba650a..4b5ceb3a 100644
--- a/gap/Magic.gd
+++ b/gap/Magic.gd
@@ -148,6 +148,15 @@
#! then it is assumed that you want to use this as your bibliography.
#!
#!
+#! bibstyle
+#! -
+#! Overrides the bibliography style used for LaTeX output.
+#! This is written as the Style attribute of the generated
+#! <Bibliography .../> element, so valid values are the
+#! bibliography style names understood by &GAPDoc; and BibTeX, such
+#! as alpha, alphaurl, or plain.
+#!
+#!
#! entities
#! -
#! A record whose keys are taken as entity names, set to the corresponding
diff --git a/tst/AutoDocTest/makedoc-entities-list.g b/tst/AutoDocTest/makedoc-entities-list.g
index 2a5a0839..7254af48 100644
--- a/tst/AutoDocTest/makedoc-entities-list.g
+++ b/tst/AutoDocTest/makedoc-entities-list.g
@@ -11,6 +11,7 @@ AutoDoc(rec(
includes := [ "chapter1.xml" ],
appendix := [ "appendix1.xml" ],
bib := "AutoDocTest.bib",
+ bibstyle := "alphaurl",
entities := [
"Legacy Package",
[ "Package", "LegacyListEntity" ],
diff --git a/tst/AutoDocTest/makedoc-entities-record.g b/tst/AutoDocTest/makedoc-entities-record.g
index 2e1593f2..c8497691 100644
--- a/tst/AutoDocTest/makedoc-entities-record.g
+++ b/tst/AutoDocTest/makedoc-entities-record.g
@@ -11,6 +11,7 @@ AutoDoc(rec(
includes := [ "chapter1.xml" ],
appendix := [ "appendix1.xml" ],
bib := "AutoDocTest.bib",
+ bibstyle := "alphaurl",
entities := rec(
AutoDocTestTag := "RecordEntity",
RECORDNOTE := "record entity",
diff --git a/tst/AutoDocTest/makedoc.g b/tst/AutoDocTest/makedoc.g
index fbee1fe7..1e606dbd 100644
--- a/tst/AutoDocTest/makedoc.g
+++ b/tst/AutoDocTest/makedoc.g
@@ -11,5 +11,6 @@ AutoDoc(rec(
includes := [ "chapter1.xml" ],
appendix := [ "appendix1.xml" ],
bib := "AutoDocTest.bib",
+ bibstyle := "alphaurl",
),
));
diff --git a/tst/AutoDocTest/tst/manual-entities-list.expected/AutoDocTest.xml b/tst/AutoDocTest/tst/manual-entities-list.expected/AutoDocTest.xml
index 48f0b743..ee13c4a6 100644
--- a/tst/AutoDocTest/tst/manual-entities-list.expected/AutoDocTest.xml
+++ b/tst/AutoDocTest/tst/manual-entities-list.expected/AutoDocTest.xml
@@ -15,6 +15,6 @@