Skip to content

Commit 46e1eee

Browse files
authored
Course template updates (#1096)
* start cleaning up course template * update template readme's * update changelog
1 parent 7c86590 commit 46e1eee

29 files changed

Lines changed: 893 additions & 1640 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Instructions: Add a subsection under `[Unreleased]` for additions, fixes, change
99

1010
## [Unreleased]
1111

12+
### Changed
13+
14+
- Improved `course` template and updated readme's for main templates.
15+
1216
## [2.33.0] - 2025-12-06
1317

1418
Includes updates to core through commit: [1c97959](https://github.com/PreTeXtBook/pretext/commit/1c97959297d51749717f9b34ce5da131c960b92d)

templates/article/README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The most important thing to remember when authoring in a codespace is that you a
3535

3636
We have tried to keep the codespace small (so it starts up quickly and doesn't eat through your monthly storage allotment), so we do not include a full TeXLive distribution. We have tried to include most packages and fonts you are likely to need to generate images using `<latex-image>` elements, and to generate PDF print output. However, if you run into a situation where the LaTeX gives errors about packages missing (like it cannot find a `mypackage.sty` file), here is what you should do.
3737

38-
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
38+
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
3939
a. If you know that the package is called `mypackage` then enter the following two lines:
4040

4141
```bash
@@ -48,12 +48,21 @@ We have tried to keep the codespace small (so it starts up quickly and doesn't e
4848
tlmgr search --global --all "mypackage.sty"
4949
```
5050
51-
2. To ensure that you don't have to repeat this step every time you recreate the codespace, add the package name to the list of installs inside the file `.devcontainer/installLatex.sh` which gets run every time a codespace is created.
52-
53-
3. Better yet, post the name of the missing package to this [GitHub issue](https://github.com/PreTeXtBook/pretext-codespace/issues/21) and we will add it to the devcontainer. This has the advantage that you will still get updates that other authors submit (if you edit the `installLatex.sh` file, then it won't be updated when you run `pretext update`).
51+
2. Then please post the name of the missing package to this [GitHub issue](https://github.com/PreTeXtBook/pretext-codespace/issues/21) and we will add it to the devcontainer. This has the advantage that you will still get updates that other authors submit. The next time you update PreTeXt, you should get the better version of the devcontainer and everyone else will benefit as well.
5452
5553
### Troubleshooting: sageplot images
5654
57-
By far the largest space-hog in a PreTeXt authoring environment is SageMath, which is only required if you generate images using sageplots. By default, SageMath is not installed in a PreTeXt codespace, but it should be easy to install if you need it.
55+
By far the largest space-hog in a PreTeXt authoring environment is SageMath, which is only required if you generate images using sageplots. By default, SageMath is not installed in a PreTeXt codespace, but it should be easy to install if you need it.
56+
57+
Open the file `.devcontainer/devcontainer.json` and edit the line that contains
58+
59+
```
60+
"image": "pretextbook/pretext:latest",
61+
```
62+
(or perhaps instead of `latest`, you have a version number). Change this to
63+
64+
```
65+
"image": "pretextbook/pretext-full:latest",
66+
```
5867
59-
Just open the command palette (`Ctrl+Shift+P` of `F1`) and search for "PreTeXt: Install SageMath". This will also update the `.devcontainer/devcontainer.json` file so that the next time you create a codespace for this project, it should install automatically.
68+
VS Code should prompt you to rebuild your codespace, which you should do (you do not need to do a "full rebuild" though). This docker image contains sagemath and you should be able to add sageplots and generate them successfully now.

templates/book/README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The most important thing to remember when authoring in a codespace is that you a
3636

3737
We have tried to keep the codespace small (so it starts up quickly and doesn't eat through your monthly storage allotment), so we do not include a full TeXLive distribution. We have tried to include most packages and fonts you are likely to need to generate images using `<latex-image>` elements, and to generate PDF print output. However, if you run into a situation where the LaTeX gives errors about packages missing (like it cannot find a `mypackage.sty` file), here is what you should do.
3838

39-
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
39+
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
4040
a. If you know that the package is called `mypackage` then enter the following two lines:
4141

4242
```bash
@@ -49,12 +49,21 @@ We have tried to keep the codespace small (so it starts up quickly and doesn't e
4949
tlmgr search --global --all "mypackage.sty"
5050
```
5151
52-
2. To ensure that you don't have to repeat this step every time you recreate the codespace, add the package name to the list of installs inside the file `.devcontainer/installLatex.sh` which gets run every time a codespace is created.
53-
54-
3. Better yet, post the name of the missing package to this [GitHub issue](https://github.com/PreTeXtBook/pretext-codespace/issues/21) and we will add it to the devcontainer. This has the advantage that you will still get updates that other authors submit (if you edit the `installLatex.sh` file, then it won't be updated when you run `pretext update`).
52+
2. Then please post the name of the missing package to this [GitHub issue](https://github.com/PreTeXtBook/pretext-codespace/issues/21) and we will add it to the devcontainer. This has the advantage that you will still get updates that other authors submit. The next time you update PreTeXt, you should get the better version of the devcontainer and everyone else will benefit as well.
5553
5654
### Troubleshooting: sageplot images
5755
58-
By far the largest space-hog in a PreTeXt authoring environment is SageMath, which is only required if you generate images using sageplots. By default, SageMath is not installed in a PreTeXt codespace, but it should be easy to install if you need it.
56+
By far the largest space-hog in a PreTeXt authoring environment is SageMath, which is only required if you generate images using sageplots. By default, SageMath is not installed in a PreTeXt codespace, but it should be easy to install if you need it.
57+
58+
Open the file `.devcontainer/devcontainer.json` and edit the line that contains
59+
60+
```
61+
"image": "pretextbook/pretext:latest",
62+
```
63+
(or perhaps instead of `latest`, you have a version number). Change this to
64+
65+
```
66+
"image": "pretextbook/pretext-full:latest",
67+
```
5968
60-
Just open the command palette (`Ctrl+Shift+P` of `F1`) and search for "PreTeXt: Install SageMath". This will also update the `.devcontainer/devcontainer.json` file so that the next time you create a codespace for this project, it should install automatically.
69+
VS Code should prompt you to rebuild your codespace, which you should do (you do not need to do a "full rebuild" though). This docker image contains sagemath and you should be able to add sageplots and generate them successfully now.

templates/course/README.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,56 @@
11
# My PreTeXt Course
22

3-
This README was generated by running `pretext new course`. You should feel free to edit this to describe your project. Thanks to Mitch Keller for his contributions to this template.
3+
This README was generated by running `pretext new course`. You should feel free to edit this to describe your project.
44

55
## Instructions
66

7-
Build the entire course with:
7+
The course template includes a single PreTeXt "book" that contains (as chapters) different course documents you might want to share with students. What is included is determined by the `main.ptx` file in the `source` folder. The starts of files for a syllabus, weekly notes, activities (worksheets), handouts, and homework are also included.
8+
9+
You can build the course using
810

911
```bash
10-
pretext build --deploys
12+
pretext build course
1113
```
1214

13-
and then view it with
15+
and view it with
1416

1517
```bash
16-
pretext deploy --stage-only
17-
pretext view -d
18+
pretext view course
1819
```
1920

20-
If you want to build just a single activity, say the "Magic Beans" activity, run:
21+
Also included is the start of a slide deck. This is a single file in the `source/slides` folder. You could use this for all the slides in a course (as a single slideshow), or create separate slideshows. In that case, you might want to build those separate ones with something like,
2122

2223
```bash
23-
pretext build pdf -i ./source/activities/magic-beans.ptx
24+
pretext build slides -i source/slides/chapter2.ptx
2425
```
2526

26-
This will create a pdf inside the `output/pdfs` directory.
27+
### Creating a landing page for multiple targets
2728

28-
Another thing to try:
29+
Build the entire course with:
2930

3031
```bash
31-
pretext build scorm -i ./source/activities/magic-beans.ptx
32+
pretext build --deploys
3233
```
3334

35+
This will build both the course "book" and the slide deck. You can create a landing page with links to each of these automatically with the command,
3436

35-
### How this is done
37+
```bash
38+
pretext deploy --stage-only
39+
```
3640

37-
Look at the source files, in particular `source/acitivies.ptx` and `source/activities/magic-beans.ptx` to see how the activities are included in the main document and can also build on their own.
41+
and then view the results with,
3842

39-
The use of `xpointer="/1/1/1"` is a little mysterious; we could have also used `xpoint="Activity-magic-beans"` to refer to the activity by its `xml:id`, although this would require us changing that for each included activity.
43+
```bash
44+
pretext view -d
45+
```
4046

47+
If you then run
48+
49+
```bash
50+
pretext deploy
51+
```
52+
53+
everything will be pushed to github pages.
4154

4255
---
4356

@@ -61,7 +74,7 @@ The most important thing to remember when authoring in a codespace is that you a
6174

6275
We have tried to keep the codespace small (so it starts up quickly and doesn't eat through your monthly storage allotment), so we do not include a full TeXLive distribution. We have tried to include most packages and fonts you are likely to need to generate images using `<latex-image>` elements, and to generate PDF print output. However, if you run into a situation where the LaTeX gives errors about packages missing (like it cannot find a `mypackage.sty` file), here is what you should do.
6376

64-
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
77+
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
6578
a. If you know that the package is called `mypackage` then enter the following two lines:
6679

6780
```bash
@@ -74,12 +87,21 @@ We have tried to keep the codespace small (so it starts up quickly and doesn't e
7487
tlmgr search --global --all "mypackage.sty"
7588
```
7689
77-
2. To ensure that you don't have to repeat this step every time you recreate the codespace, add the package name to the list of installs inside the file `.devcontainer/installLatex.sh` which gets run every time a codespace is created.
78-
79-
3. Better yet, post the name of the missing package to this [GitHub issue](https://github.com/PreTeXtBook/pretext-codespace/issues/21) and we will add it to the devcontainer. This has the advantage that you will still get updates that other authors submit (if you edit the `installLatex.sh` file, then it won't be updated when you run `pretext update`).
90+
2. Then please post the name of the missing package to this [GitHub issue](https://github.com/PreTeXtBook/pretext-codespace/issues/21) and we will add it to the devcontainer. This has the advantage that you will still get updates that other authors submit. The next time you update PreTeXt, you should get the better version of the devcontainer and everyone else will benefit as well.
8091
8192
### Troubleshooting: sageplot images
8293
83-
By far the largest space-hog in a PreTeXt authoring environment is SageMath, which is only required if you generate images using sageplots. By default, SageMath is not installed in a PreTeXt codespace, but it should be easy to install if you need it.
94+
By far the largest space-hog in a PreTeXt authoring environment is SageMath, which is only required if you generate images using sageplots. By default, SageMath is not installed in a PreTeXt codespace, but it should be easy to install if you need it.
95+
96+
Open the file `.devcontainer/devcontainer.json` and edit the line that contains
97+
98+
```
99+
"image": "pretextbook/pretext:latest",
100+
```
101+
(or perhaps instead of `latest`, you have a version number). Change this to
102+
103+
```
104+
"image": "pretextbook/pretext-full:latest",
105+
```
84106
85-
Just open the command palette (`Ctrl+Shift+P` of `F1`) and search for "PreTeXt: Install SageMath". This will also update the `.devcontainer/devcontainer.json` file so that the next time you create a codespace for this project, it should install automatically.
107+
VS Code should prompt you to rebuild your codespace, which you should do (you do not need to do a "full rebuild" though). This docker image contains sagemath and you should be able to add sageplots and generate them successfully now.

templates/course/project.ptx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- This file, the project manifest, provides the overall configuration for your PreTeXt project. To edit the content of your document, open `source/main.ptx`. See https://pretextbook.org/doc/guide/html/processing-CLI.html#cli-project-manifest. -->
3+
34
<project ptx-version="2">
45
<targets>
5-
<target name="syllabus-web" source="syllabus.ptx" format="html"
6-
publication="publication-syllabus.ptx" deploy-dir="syllabus" />
7-
<target name="syllabus-canvas" source="syllabus.ptx" format="html"
8-
compression="scorm" publication="publication_scorm_syllabus.ptx"
9-
output-filename="syllabus.zip" />
10-
<target name="syllabus-print" source="syllabus.ptx" format="pdf"
11-
output-filename="syllabus.pdf" publication="publication-syllabus.ptx" />
6+
<!-- Main course for html or pdf -->
7+
<target name="web" source="main.ptx" format="html"
8+
publication="publication.ptx" deploy-dir="course" />
9+
<target name="print" source="main.ptx" format="pdf"
10+
output-filename="course.pdf" publication="publication.ptx" />
11+
12+
<target name="slides" source="slides/slides.ptx" format="revealjs"
13+
publication="publication-slides.ptx" deploy-dir="slides"
14+
output-filename="index.html"/>
15+
<target name="slides-annotated" source="slides/slides.ptx" format="revealjs"
16+
publication="publication-slides-annotated.ptx" deploy-dir="slides-annotated"
17+
output-filename="index.html"/>
1218

13-
<target name="activities-web" format="html" source="activities.ptx"
14-
publication="publication.ptx" deploy-dir="worksheets" />
15-
<target name="activities-print" format="pdf" source="activities.ptx"
16-
output-filename="activities.pdf" publication="publication.ptx" />
1719

18-
<target name="notes-web" format="html" source="notes.ptx"
19-
publication="publication.ptx" deploy-dir="notes" />
20-
<target name="notes-print" format="pdf" source="notes.ptx"
21-
publication="publication.ptx" output-filename="notes.pdf"/>
2220

23-
<!-- The following targets are used to create stand-alone documents, -->
24-
<!-- either scorm archives or pdfs. Run with `pretext build scorm -i source/[filename.ptx]`-->
25-
<target name="scorm" standalone="yes" format="html" compression="scorm"
26-
output-dir="scorms" publication="publication_standalone.ptx"
27-
/>
28-
<target name="pdf" standalone="yes" format="pdf"
29-
output-dir="pdfs" publication="publication_standalone.ptx" />
21+
<!-- The following targets are used to create stand-alone documents, which could be additional slide decks, pdfs, or SCORM archives. Run with `pretext build slides -i source/slides/[filename.ptx]`, for example. -->
22+
<target name="pdf" standalone="yes" format="pdf"
23+
output-dir="pdfs" publication="publication_standalone.ptx"/>
24+
<target name="slides" standalone="yes" format="revealjs"
25+
output-dir="slides" publication="publication-slides.ptx"/>
26+
<target name="slides-annotated" standalone="yes" format="revealjs"
27+
output-dir="slides" publication="publication-slides-annotated.ptx"/>
28+
<target name="scorm" standalone="yes" format="html" compression="scorm"
29+
output-dir="scorms" publication="publication_standalone.ptx"/>
3030
</targets>
3131
</project>
3232

@@ -89,4 +89,4 @@
8989
/>
9090
</targets>
9191
</project>
92-
-->
92+
-->
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
3+
<!-- This is for annotated versions of slides. -->
4+
<!-- Adapted from work of Mitch Keller -->
5+
<publication>
6+
<source>
7+
<directories external="../assets" generated="../generated-assets"/>
8+
<!-- add component="a" to parts of the slides that should show up in the "annotated" version. The next line makes sure this is included. -->
9+
<version include="a" />
10+
</source>
11+
12+
<revealjs>
13+
<appearance theme="white"/>
14+
<!-- these are "resources" defaults, but best for a sample -->
15+
<!-- @minified is not even necessary with @host = 'cdn' -->
16+
<resources host="cdn"/>
17+
<!-- display="yes" is the default so we can see arrows -->
18+
<!-- tutorial="yes" is the default -->
19+
<!-- layout="bottom-right" is the default, "edges" is an option -->
20+
<!-- backarrows="faded" is the default, -->
21+
<!-- "hidden and "visible" are options -->
22+
<controls display="yes" tutorial="yes" layout="bottom-right" backarrows="faded"/>
23+
<!-- mode="default" is horizontal/vertical two-level navigation -->
24+
<!-- mode="grid" allows direct movement between adjacent vertical segments -->
25+
<!-- mode="linear" is more traditional left/right movement for all slides -->
26+
<navigation mode="default"/>
27+
</revealjs>
28+
29+
</publication>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
3+
<publication>
4+
<source>
5+
<directories external="../assets" generated="../generated-assets"/>
6+
<!-- add component="b" to parts of the slides that should show up in the "blank" (unannotated) version. The next line makes sure this is included -->
7+
<version include="b" />
8+
</source>
9+
<common>
10+
<fillin mathstyle="underline" />
11+
</common>
12+
<revealjs>
13+
<appearance theme="white"/>
14+
<!-- these are "resources" defaults, but best for a sample -->
15+
<!-- @minified is not even necessary with @host = 'cdn' -->
16+
<resources host="cdn"/>
17+
<!-- display="yes" is the default so we can see arrows -->
18+
<!-- tutorial="yes" is the default -->
19+
<!-- layout="bottom-right" is the default, "edges" is an option -->
20+
<!-- backarrows="faded" is the default, -->
21+
<!-- "hidden and "visible" are options -->
22+
<controls display="yes" tutorial="yes" layout="bottom-right" backarrows="faded"/>
23+
<!-- mode="default" is horizontal/vertical two-level navigation -->
24+
<!-- mode="grid" allows direct movement between adjacent vertical segments -->
25+
<!-- mode="linear" is more traditional left/right movement for all slides -->
26+
<navigation mode="default"/>
27+
</revealjs>
28+
</publication>

0 commit comments

Comments
 (0)