Skip to content

Commit ae86867

Browse files
mahrudd-torrance
authored andcommitted
add M2 citation guide to Macaulay2Doc
1 parent 50d6f3f commit ae86867

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

M2/Macaulay2/m2/help.m2

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ documentationValue(Nothing, Sequence) := (S, s) -> (
215215
-- TODO: simplify this process
216216
-- e.g. Macaulay2Doc :: Macaulay2Doc
217217
documentationValue(Symbol, Package) := (S, pkg) -> if pkg =!= Core then (
218+
isM2Doc := pkg#"pkgname" === "Macaulay2Doc";
218219
-- package filename
219220
fn := pkg#"pkgname" | ".m2";
220221
-- authors
221222
au := pkg.Options.Authors;
222223
-- citation
223-
if #au > 0 then
224-
ci := citePackage pkg;
224+
ci := if isM2Doc then citePackage "M2" else if #au > 0 then citePackage pkg;
225225
-- exported symbols
226226
-- TODO: this misses exported symbols from Macaulay2Doc; is this intentional?
227227
e := toSequence pkg#"exported symbols";
@@ -271,16 +271,17 @@ documentationValue(Symbol, Package) := (S, pkg) -> if pkg =!= Core then
271271
DIV {
272272
SUBSECTION "Version",
273273
PARA { "This documentation describes version ", BOLD pkg.Options.Version, " of ",
274-
if pkg#"pkgname" === "Macaulay2Doc" then "Macaulay2" else pkg#"pkgname",
274+
if isM2Doc then "Macaulay2" else pkg#"pkgname",
275275
if pkg.Options.Date =!= null then { ", released ", BOLD pkg.Options.Date }, "." }},
276-
if #au > 0 then
276+
if isM2Doc or #au > 0 then
277277
if instance(ci, DIV) then ci else DIV {
278278
SUBSECTION "Citation",
279-
PARA "If you have used this package in your research, please cite it as follows:",
279+
PARA { "If you have used ", if isM2Doc then "Macaulay2" else "this package",
280+
" in your research, please cite it as follows:" },
280281
TABLE {"class" => "examples",
281282
TR TD PRE prepend("class" => "language-bib", CODE ci)}
282283
},
283-
if pkg#"pkgname" =!= "Macaulay2Doc" and #e + #m > 0 then DIV {
284+
if not isM2Doc and #e + #m > 0 then DIV {
284285
SUBSECTION "Exports",
285286
DIV { "class" => "exports",
286287
fixup UL {

0 commit comments

Comments
 (0)