diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml new file mode 100644 index 0000000..36d6849 --- /dev/null +++ b/.github/workflows/pretext-cli.yml @@ -0,0 +1,117 @@ +# This file was automatically generated with PreTeXt 2.33.2. +# If you modify this file, PreTeXt will no longer automatically update it. +# +# This workflow file can be used to automatically build a project and create +# an artifact for deployment. It can also be used to deploy the project to +# GitHub Pages or Cloudflare Pages. +# +# The workflow is triggered on pull requests or can be run manually. You can uncomment +# the `push` event to have it run on pushes to the main branch as well. +name: PreTeXt-CLI Actions +on: + # Runs on pull requests + pull_request: + branches: ["*"] + ## Runs on pushes to main + #push: + # branches: ["main"] + # Runs on demand + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: oscarlevin/pretext-full + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: install deps + run: pip install -r requirements.txt + + - name: set up node + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: install local ptx files + run: pretext --version + + - name: build deploy targets + run: | + version="$(pretext --version)" + major="$(echo $version | cut -d '.' -f 1)" + minor="$(echo $version | cut -d '.' -f 2)" + if [ "$major" -ge 2 -a "$minor" -ge 5 ]; then + echo "PreTeXt version is 2.5 or greater; using new build command" + pretext build --deploys + else + echo "PreTeXt version is less than 2.5, using old build command" + pretext build + fi + - name: stage deployment + run: pretext deploy --stage-only + + - name: Bundle output/stage as artifact + uses: actions/upload-artifact@v4 + with: + name: deploy + path: output/stage + + deploy-cloudflare: + runs-on: ubuntu-latest + needs: build + if: vars.CLOUDFLARE_PROJECT_NAME != '' + permissions: + contents: read + deployments: write + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: deploy + path: deploy + - name: Create 404.html + run: echo "404 page not found" >> deploy/404.html + - name: Publish to Cloudflare + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }} + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref || github.ref_name }} + directory: deploy + + deploy-ghpages: + runs-on: ubuntu-latest + needs: build + if: vars.PTX_ENABLE_DEPLOY_GHPAGES == 'yes' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + permissions: + contents: read + pages: write + id-token: write + concurrency: + group: "page" + cancel-in-progress: false + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Download website artifact + uses: actions/download-artifact@v4 + with: + name: deploy + path: deploy + - name: Setup GitHub Pages + id: check + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: deploy + - name: Deploy to Github Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pretext-deploy.yml b/.github/workflows/pretext-deploy.yml new file mode 100644 index 0000000..5a539f1 --- /dev/null +++ b/.github/workflows/pretext-deploy.yml @@ -0,0 +1,68 @@ +# This file was automatically generated with PreTeXt 2.33.2. +# If you modify this file, PreTeXt will no longer automatically update it. +# + +name: Build and Deploy +on: + # Currently, this workflow only runs when manually selected (the `workflow_dispatch` event). + # If you would like it to run on other events, uncomment some of the lines below. + + # # Runs on pull requests + # pull_request: + # branches: ["*"] + + # # Runs on pushes to main + # push: + # branches: ["main"] + + # # Runs every day at 00:00 UTC + # schedule: + # - cron: '0 0 * * *' + + # Runs on demand + workflow_dispatch: + +permissions: + contents: write + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + container: oscarlevin/pretext-full + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: set up node + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: add gh-cli + run: | + apt-get update + apt-get install gh jq -y + + - name: setup git config + run: | + git config --global --add safe.directory $(pwd) + git config user.name "${{ github.actor }} via GitHub Actions" + git config user.email "${{ github.actor }}@github_actions.no_reply" + + - name: install deps + run: pip install -r requirements.txt --break-system-packages + + - name: install local ptx files + run: pretext --version + + - name: build deploy targets + run: pretext build --deploys + + - name: run deploy + run: pretext deploy --no-push + + - name: push gh-pages branch + run: git push origin gh-pages --force + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 706f068..3ee722e 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,107 @@ -# PreTeXt Codespace +# My PreTeXt Course -Use this template repository to quickly start a new [PreTeXt](https://pretextbook.org) project entirely in the cloud, using GitHub Codespaces. +This README was generated by running `pretext new course`. You should feel free to edit this to describe your project. ## Instructions -Look for the green button at the very top right of this page. The button should say `Use this template` (if not make sure you are logged in to GitHub). - -Click on the button and select "Create a new repository". On the next page, give your project a name, select public or private (this can be changed later), and click the "Create repository from template" button. +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. -You now have a GitHub repository saved in your account. You can come back to that page any time you want to work on your project (note the URL or else find it in the list of your repositories when you log in to GitHub). +You can build the course using -To start work on your project, go to the green button at the top of *your* repository's page, which will say `<> Code`. +```bash +pretext build course +``` -1. Click on this button. -2. Click on the tab that says "Codespaces." -3. Click "Create codespace on main." +and view it with -This will open a new tab with a browser version of VS Code including everything set up to start working. (When you first create a codespace for a project, it may take 5-10 minutes; when you restart a codespace it will be much faster). The first thing you should do is create a new PreTeXT project. +```bash +pretext view course +``` -### Creating a New Project +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, -1. Open the command palette by hitting `Ctrl+Shift+P` (or `F1`) and start typing "pretext new". You will see a command titled "PreTeXt: New Project". -2. Hit `Enter` and select what sort of project you would like to create. -3. Select the current suggested folder for the location of your project. +```bash +pretext build slides -i source/slides/chapter2.ptx +``` -The window should reload and you will have your project there. This readme will be gone, but you will get a new one with some new hints. +### Creating a landing page for multiple targets -Next time you want to work on your book, return to your newly created repository, go to the green `<> Code` button, and select the codespace you previously created. If you don't see that codespace (perhaps you deleted it to save space), you can always create a new codespace. +Build the entire course with: + +```bash +pretext build --deploys +``` + +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, + +```bash +pretext deploy --stage-only +``` + +and then view the results with, + +```bash +pretext view -d +``` + +If you then run + +```bash +pretext deploy +``` + +everything will be pushed to github pages. + +--- + +Below you will find some advice for working with PreTeXt, including help with using the [PreTeXt Codespace](https://github.com/PreTeXtBook/pretext-codespace) online editor through GitHub if you don't want to install the required software on your own computer. + +## Learning PreTeXt + +See the [PreTeXt documentation](https://pretextbook.org/documentation.html) for links to a variety of resources. + +We also recommend browsing through the [annotated sample article](https://pretextbook.org/examples/sample-article/annotated) and [annotated sample book](https://pretextbook.org/examples/sample-book/annotated/) if you want to find examples and see the PreTeXt source for those examples quickly. + +## Using GitHub Codespaces + +GitHub Codespaces are a way to set up your whole authoring system entirely in your browser. In case you are not already reading this inside a codespace, you can create one specifically designed for authoring in PreTeXt by using [this template](https://github.com/PreTeXtBook/pretext-codespace). + +### Important: how to save your files + +The most important thing to remember when authoring in a codespace is that you are making all your edits on a *virtual machine* off in some remote server farm. This means there is an extra step to save your files. You can save files in the editor (in your browser), but this just saves them to that virtual machine. To make sure you can access these files, even if the virtual machine goes away, you need to sync them to github.com. This is done by *committing* your changes and then *pushing* those commits (or "syncing" them). You might see a warning when you restart your codespace that you have "uncommitted changes" -- make sure you commit them when you are done working. + +### Troubleshooting: Latex-images and pdfs + +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 `` 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. + +1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package. + a. If you know that the package is called `mypackage` then enter the following two lines: + + ```bash + tlmgr install mypackage + tlmgr path add + ``` + b. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using + + ```bash + tlmgr search --global --all "mypackage.sty" + ``` + +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. + +### Troubleshooting: sageplot images + +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. + +Open the file `.devcontainer/devcontainer.json` and edit the line that contains + +``` + "image": "pretextbook/pretext:latest", +``` +(or perhaps instead of `latest`, you have a version number). Change this to + +``` + "image": "pretextbook/pretext-full:latest", +``` + +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. diff --git a/project.ptx b/project.ptx new file mode 100644 index 0000000..1fdadb7 --- /dev/null +++ b/project.ptx @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/publication/publication-slides-annotated.ptx b/publication/publication-slides-annotated.ptx new file mode 100644 index 0000000..788808d --- /dev/null +++ b/publication/publication-slides-annotated.ptx @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/publication/publication-slides.ptx b/publication/publication-slides.ptx new file mode 100644 index 0000000..935aadc --- /dev/null +++ b/publication/publication-slides.ptx @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/publication/publication.ptx b/publication/publication.ptx new file mode 100644 index 0000000..9bc0fbe --- /dev/null +++ b/publication/publication.ptx @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/publication/publication_standalone.ptx b/publication/publication_standalone.ptx new file mode 100644 index 0000000..48973a4 --- /dev/null +++ b/publication/publication_standalone.ptx @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ae36df8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# This file was automatically generated with PreTeXt 2.33.2. +pretext == 2.33.2 diff --git a/source/activities/01-intro-activity.ptx b/source/activities/01-intro-activity.ptx new file mode 100644 index 0000000..4d84b97 --- /dev/null +++ b/source/activities/01-intro-activity.ptx @@ -0,0 +1,23 @@ + + + + + Introduction Activity + + + +

+ This is the introduction to the activity. +

+
+ + + + +

+ This is the first exercise. +

+
+
+ +
diff --git a/source/activities/activity-template.ptx b/source/activities/activity-template.ptx new file mode 100644 index 0000000..fdd64da --- /dev/null +++ b/source/activities/activity-template.ptx @@ -0,0 +1,23 @@ + + + + + Activity Title + + + +

+ This is the introduction to the activity. +

+
+ + + + +

+ This is the first exercise. +

+
+
+ +
diff --git a/source/docinfo.ptx b/source/docinfo.ptx new file mode 100644 index 0000000..fb0b305 --- /dev/null +++ b/source/docinfo.ptx @@ -0,0 +1,33 @@ + + + + + + + + + + + + \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/source/frontmatter.ptx b/source/frontmatter.ptx new file mode 100644 index 0000000..af043b0 --- /dev/null +++ b/source/frontmatter.ptx @@ -0,0 +1,24 @@ + + + + + + + + + Andy Eisenberg + Mathematics + Temple University + + + Last Updated: + + + + + + + + + + diff --git a/source/handouts/handout-template.ptx b/source/handouts/handout-template.ptx new file mode 100644 index 0000000..e17a238 --- /dev/null +++ b/source/handouts/handout-template.ptx @@ -0,0 +1,12 @@ + + + +Handout Title + + +

+ A first paragraph with some space for notes below it. +

+ +
+
diff --git a/source/homework/homework-01.ptx b/source/homework/homework-01.ptx new file mode 100644 index 0000000..1ec82e3 --- /dev/null +++ b/source/homework/homework-01.ptx @@ -0,0 +1,21 @@ + + + + Homework 01 + +

+ Instructions: Complete all the exercises below and submit your work by the due date. +

+
+ + + + +

+ This is the first homework exercise. +

+
+
+ +
+
diff --git a/source/homework/homework-template.ptx b/source/homework/homework-template.ptx new file mode 100644 index 0000000..489d2b7 --- /dev/null +++ b/source/homework/homework-template.ptx @@ -0,0 +1,21 @@ + + + + Homework xx + +

+ Instructions: etc. +

+
+ + + + +

+ This is the first homework exercise. +

+
+
+ +
+
diff --git a/source/main.ptx b/source/main.ptx new file mode 100644 index 0000000..cc2d43b --- /dev/null +++ b/source/main.ptx @@ -0,0 +1,56 @@ + + + + + + + + + Introduction to Probability and Statistics for the Life Sciences + + Spring 2026 MATH 1044 + + + + Course Documents + + + + + + + + + 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. +

+
+ + + + +
+ + + + Homework + + + + + + + Recitations + + + +
+
\ No newline at end of file diff --git a/source/notes/week01.ptx b/source/notes/week01.ptx new file mode 100644 index 0000000..8fda3ba --- /dev/null +++ b/source/notes/week01.ptx @@ -0,0 +1,35 @@ + + +
+ Week 1 + + +

+ This is an outline of the topics we covered in the first week of class. +

+
+ + + + Monday 8/22 + +

+

+
+ + + + Wednesday 8/24 + +

+

+
+ + + + Friday 8/26 + +

+

+
+
diff --git a/source/notes/week02.ptx b/source/notes/week02.ptx new file mode 100644 index 0000000..1d09192 --- /dev/null +++ b/source/notes/week02.ptx @@ -0,0 +1,28 @@ + + +
+ Week 2 + + + Monday + +

+

+
+ + + + Wednesday + +

+

+
+ + + + Friday + +

+

+
+
diff --git a/source/slides/slides.ptx b/source/slides/slides.ptx new file mode 100644 index 0000000..f45de41 --- /dev/null +++ b/source/slides/slides.ptx @@ -0,0 +1,38 @@ + + + + + + + + Slides for MATH xxx + + + + + + + +
+ Section 1.1 + + + [topic] + + + +
+ +
+ Section 1.2 + + [topic] +

+ +

+
+
+ + +
+
diff --git a/source/syllabus/syllabus.ptx b/source/syllabus/syllabus.ptx new file mode 100644 index 0000000..b00a255 --- /dev/null +++ b/source/syllabus/syllabus.ptx @@ -0,0 +1,103 @@ + + +
+ Syllabus + + +

+

+
+ + + Course Information + +

+ This is the syllabus for Introduction to Probability and Statistics for the Life Sciences (MATH 1044) for Spring 2026. + It is a 4 credit course. +

+
  • + Instructor + +

    + Andy Eisenberg, andy.eisenberg@temple.edu. +

    +
  • + +
  • + Office Hours + +

    + TBD +

    +
  • + +
  • + Lecture + +

    + TR 11:40 am - 1:20 pm, Gladfelter L024 +

    +
  • + +
  • + Recitations + +

    + Sec 1: M 12:00 pm - 12:50 pm, Wachman 9 +

    + +

    + Sec 2: W 12:00 pm - 12:50 pm, Wachman 15 +

    + +

    + Sec 3: F 11:00 am - 11:50 am, Wachman 408 +

    + +

    + Sec 4: F 1:00 pm - 1:50 pm, Wachman 408 +

    +
  • + +
  • + Course Description + +

    + course description from catalog +

    +
  • + +
  • + Prerequisite + +

    + list of prerequisites +

    +
  • + +
  • + Textbook and course materials + +

    + textbook name + by textbook author. +

    +
  • +
    +

    + + + Course Overview + +

    +

    +
    +
    + + + Assessments and Grades + +

    +

    +
    +
    \ No newline at end of file