"needPackage" for EXAMPLEs in documentation

15 views
Skip to first unread message

Friedemann Groh

unread,
Jun 16, 2024, 6:38:08 AM (13 days ago) Jun 16
to Macaulay2
Hallo,

Is it possible to include a package within EXAMPLE { "needPackage ...", ... }? How do you write the quotation marks " here?

best regards,
Friedemann

Doug Torrance

unread,
Jun 16, 2024, 9:09:43 AM (13 days ago) Jun 16
to Macaulay2
A few options:

* Escape the quotation marks with a backslash:  "needsPackage \"Foo\""
* Use the alternate three-forward slash syntax for strings:  ///needsPackage "Foo"///
* Use SimpleDoc for the documentation, where the entire documentation node is inside one big string:
doc ///
...
  Description
    Example
      needsPackage "Foo"
...
///

Friedemann Groh

unread,
Jun 16, 2024, 10:16:07 AM (13 days ago) Jun 16
to Macaulay2
Thank you, it works fine.
Reply all
Reply to author
Forward
0 new messages