diff --git a/pretext/constants.py b/pretext/constants.py index febf111f..53a058b2 100644 --- a/pretext/constants.py +++ b/pretext/constants.py @@ -1,7 +1,7 @@ import typing as t from pathlib import Path -NEW_TEMPLATES = ["book", "article", "demo", "hello", "slideshow"] +NEW_TEMPLATES = ["book", "article", "course", "demo", "hello", "slideshow"] FORMATS = [ "html", diff --git a/templates/course/README.md b/templates/course/README.md new file mode 100644 index 00000000..2fdc851a --- /dev/null +++ b/templates/course/README.md @@ -0,0 +1,40 @@ +# Demo Course + +This is an example of how you could set up a "course" in PreTeXt. + +## Instructions + +Build the entire course with: + +```bash +pretext build web +``` + +and then view it with + +```bash +pretext view +``` + +If you want to build just a single activity, say the "Magic Beans" activity, run: + +```bash +pretext build ./source/activities/magic-beans.ptx +``` + +This will create a pdf inside the `source/activities` directory. + +Another thing to try: + +```bash +pretext build web -i ./source/main-no-syllabus.ptx +``` + +Note that there is a `web` target in `project.ptx` but it builds from `main.ptx` not `main-no-syllabus.ptx`. So using the `-i` flag, you can override the input file but still use the settings for an existing target. + +### How this is done + +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. + +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. + diff --git a/templates/course/project.ptx b/templates/course/project.ptx new file mode 100644 index 00000000..ea7a74eb --- /dev/null +++ b/templates/course/project.ptx @@ -0,0 +1,69 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/course/publication/publication.ptx b/templates/course/publication/publication.ptx new file mode 100644 index 00000000..7879b8d4 --- /dev/null +++ b/templates/course/publication/publication.ptx @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/course/source/activities.ptx b/templates/course/source/activities.ptx new file mode 100644 index 00000000..5d84c002 --- /dev/null +++ b/templates/course/source/activities.ptx @@ -0,0 +1,15 @@ + + + + In-Class Activities + + +

+ These activities are designed to be used in class to help students understand the material. They are not graded, but students are encouraged to work on them in groups and ask the instructor for help when needed. +

+
+ + + + +
\ No newline at end of file diff --git a/templates/course/source/activities/activity-template.ptx b/templates/course/source/activities/activity-template.ptx new file mode 100644 index 00000000..b9c3960d --- /dev/null +++ b/templates/course/source/activities/activity-template.ptx @@ -0,0 +1,25 @@ + + + +
+ + + + Activity Title + + +

+ This is the introduction to the activity. +

+
+ + + +

+ This is the first exercise. +

+
+
+
+
+
diff --git a/templates/course/source/activities/magic-beans.ptx b/templates/course/source/activities/magic-beans.ptx new file mode 100644 index 00000000..14427cdb --- /dev/null +++ b/templates/course/source/activities/magic-beans.ptx @@ -0,0 +1,54 @@ + + + +
+ + Magic Beans + +

+ You have traded your cow for 5 magic chocolate covered espresso beans. + Each night at midnight, each bean splits into three beans. + To take advantage of this, you eat 8 beans each morning for breakfast. + You wonder how many beans you will have after breakfast 30 days after you traded your cow. +

+ +

+ Let (b_n)_{n\ge 0} be the sequence of number of beans you have n days after trading your cow, (after breakfast, before midnight; take b_0 = 5). +

+
+ + + + + +

+ Write out the first few terms of the sequence. + Then give a recursive definition for the sequence and explain how you know it is correct. +

+
+
+ + + +

+ What do you notice about all elements of the sequence? Will they all be ...? Prove your conjecture by mathematical induction. +

+
+
+
+ + + + + +

+ Find a closed formula for b_n and prove it is correct using induction. +

+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/templates/course/source/backmatter.ptx b/templates/course/source/backmatter.ptx new file mode 100644 index 00000000..d9fc1973 --- /dev/null +++ b/templates/course/source/backmatter.ptx @@ -0,0 +1,23 @@ + + + + + + + + + Backmatter + + + + + + + + + + +

This book was authored in .

+
+
+ diff --git a/templates/course/source/course-notes.ptx b/templates/course/source/course-notes.ptx new file mode 100644 index 00000000..0a61851b --- /dev/null +++ b/templates/course/source/course-notes.ptx @@ -0,0 +1,16 @@ + + + + Course Notes + + +

+ The following notes are intended to remind you what we covered each week. They are not a substitute for attending class and not a substitute for reading the textbook. +

+
+ + + + + +
\ No newline at end of file diff --git a/templates/course/source/docinfo.ptx b/templates/course/source/docinfo.ptx new file mode 100644 index 00000000..d4fe0f08 --- /dev/null +++ b/templates/course/source/docinfo.ptx @@ -0,0 +1,43 @@ + + + + + + + + MATH12345-Spring2037 + + + + + + + + + + + + + \newcommand{\N}{\mathbb N} + \newcommand{\Z}{\mathbb Z} + \newcommand{\Q}{\mathbb Q} + \newcommand{\R}{\mathbb R} + + + + + + \usepackage{tikz, pgfplots} + \usetikzlibrary{positioning,matrix,arrows} + \usetikzlibrary{shapes,decorations,shadows,fadings,patterns} + \usetikzlibrary{decorations.markings} + + + + + + + + + + diff --git a/templates/course/source/frontmatter.ptx b/templates/course/source/frontmatter.ptx new file mode 100644 index 00000000..7fb9ac0c --- /dev/null +++ b/templates/course/source/frontmatter.ptx @@ -0,0 +1,27 @@ + + + + + + + + + Instructor Lastname + Mathematical Sciences + University of Templates + + + Last Updated: + + + + + + + + + + + + + diff --git a/templates/course/source/main-no-syllabus.ptx b/templates/course/source/main-no-syllabus.ptx new file mode 100644 index 00000000..c83368bf --- /dev/null +++ b/templates/course/source/main-no-syllabus.ptx @@ -0,0 +1,24 @@ + + + + + + + + Demo Course + + + + + + + + + + + + + + + + diff --git a/templates/course/source/main.ptx b/templates/course/source/main.ptx new file mode 100644 index 00000000..08fa33ad --- /dev/null +++ b/templates/course/source/main.ptx @@ -0,0 +1,26 @@ + + + + + + + + Demo Course + + + + + + + + + + + + + + + + + + diff --git a/templates/course/source/notes/week01.ptx b/templates/course/source/notes/week01.ptx new file mode 100644 index 00000000..be4df2a0 --- /dev/null +++ b/templates/course/source/notes/week01.ptx @@ -0,0 +1,13 @@ + + + +
+
+ Week 1 +

+ This week we covered the following topics: +

+ +
+
+
\ No newline at end of file diff --git a/templates/course/source/notes/week02.ptx b/templates/course/source/notes/week02.ptx new file mode 100644 index 00000000..3e3e2dcc --- /dev/null +++ b/templates/course/source/notes/week02.ptx @@ -0,0 +1,13 @@ + + + +
+
+ Week 2 +

+ This week we covered the following topics in the second week. +

+ +
+
+
\ No newline at end of file diff --git a/templates/course/source/syllabus.ptx b/templates/course/source/syllabus.ptx new file mode 100644 index 00000000..a65b1738 --- /dev/null +++ b/templates/course/source/syllabus.ptx @@ -0,0 +1,19 @@ + + + + Course Syllabus + +

Welcome to the course.

+ + + + Course Information +

This course is about magic beans. And about how bad copilot is at writing syllabi.

+
+ + + Grading +

This course has no grades because it is just a demo.

+
+ +
\ No newline at end of file