├── .devcontainer.json ├── .github └── workflows │ └── pretext-cli.yml ├── .gitignore ├── GenerateAssetsHelp.md ├── LICENSE.md ├── README.md ├── assets ├── first-notebook.ipynb ├── g4m.png ├── g4m.svg ├── git-branches-source.xml ├── git-branches.png ├── screenshots │ ├── codespace-explorer-newfile.png │ ├── codespace-preview-md.png │ ├── codespace-python-extension.png │ ├── codespace-python-script.png │ ├── codespace-timeout-retention.png │ ├── copilot-icon.png │ ├── github-codespace.png │ ├── github-com.png │ ├── github-dev.png │ ├── pages-actions.png │ ├── pages-setting.png │ └── pages-template.png ├── website-example.html └── website-example.zip ├── project.ptx ├── publication └── publication.ptx ├── requirements.txt ├── site └── CNAME └── source ├── ax-additional-topics.ptx ├── ax-related.ptx ├── ch-coding.ptx ├── ch-collaboration.ptx ├── ch-copilot.ptx ├── ch-first-repo.ptx ├── ch-git-github.ptx ├── ch-jupyter.ptx ├── ch-manim.ptx ├── ch-projects.ptx ├── ch-website.ptx ├── colophon.ptx ├── frontmatter.ptx ├── main.ptx └── pr-acknowledgements.ptx /.devcontainer.json: -------------------------------------------------------------------------------- 1 | // 2 | // (delete the above line to manage this file manually) 3 | ////////////////////////////////////////////////////////////// 4 | // 5 | // This file provides configuration options so that a PreTeXt 6 | // project can be edited and built using GitHub's Codespaces. 7 | // It is recommended to keep this in your repository even if you 8 | // do not use this feature, as it will allow other to explore 9 | // your project easily. 10 | // This file will be automatically generated by PreTeXt with the 11 | // latest updates unless you remove the first comment line above. 12 | // 13 | /////////////////////////////////////////////////////////////// 14 | { 15 | "name": "PreTeXt-Codespaces", 16 | 17 | // This Docker image includes some LaTeX support, but is still not to large. Note that if you keep your codespace running, it will use up your GitHub free storage quota. Additional options are listed below. 18 | // "image": "oscarlevin/pretext:small", 19 | // If you need to generate more complicated assets (such as sageplots) or use additional fonts when building to PDF, comment out the above line and uncomment the following line. 20 | "image": "oscarlevin/pretext:full", 21 | // If you only intend to build for web and don't have any latex-image generated assets, you can use a smaller image: 22 | // "image": "oscarlevin/pretext:lite", 23 | 24 | // Add gh cli as a feature (to support codechat) 25 | "features": { 26 | "ghcr.io/devcontainers/features/github-cli:1": {} 27 | }, 28 | 29 | // Respect the project's designated dependencies 30 | "postCreateCommand": "pip install -r requirements.txt", 31 | 32 | // Port forwarding 33 | // --------------- 34 | // This is needed by the CodeChat Server. 35 | "forwardPorts": [ 36 | // The port used for a Thrift connection between the VSCode CodeChat 37 | // extension and the CodeChat Server. 38 | 27376, 39 | // The port used for an HTTP connection from the CodeChat Client to 40 | // the CodeChat Server. 41 | 27377, 42 | // The port used by a websocket connection between the CodeChat 43 | // Server and the CodeChat Client. 44 | 27378 45 | ], 46 | // See the [docs](https://containers.dev/implementors/json_reference/#port-attributes). 47 | "portsAttributes": { 48 | "27376": { 49 | "label": "VSCode extension <-> CodeChat Server", 50 | "requireLocalPort": true 51 | }, 52 | "27377": { 53 | "label": "CodeChat Client", 54 | "requireLocalPort": true 55 | }, 56 | "27378": { 57 | "label": "CodeChat Client<->Server websocket", 58 | "requireLocalPort": true 59 | // This port needs to be public; however, there's no way to specify port visibility here. See `server.py` in the CodeChat Server for details. 60 | } 61 | }, 62 | 63 | // Configure tool-specific properties. 64 | "customizations": { 65 | "codespaces": { 66 | "openFiles": ["source/main.ptx"] 67 | }, 68 | "vscode": { 69 | "settings": { 70 | "editor.quickSuggestions": { 71 | "other": "off" 72 | }, 73 | "editor.snippetSuggestions": "top", 74 | "xml.validation.enabled": false, 75 | "CodeChat.CodeChatServer.Command": "CodeChat_Server" 76 | }, 77 | "extensions": [ 78 | "ms-vscode.live-server", 79 | "oscarlevin.pretext-tools", 80 | "CodeChat.codechat" 81 | ] 82 | } 83 | } 84 | 85 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 86 | // "remoteUser": "root" 87 | } 88 | -------------------------------------------------------------------------------- /.github/workflows/pretext-cli.yml: -------------------------------------------------------------------------------- 1 | # 2 | # (delete the above line to manage this file manually) 3 | 4 | name: PreTeXt-CLI Actions 5 | on: 6 | # Runs on pull requests 7 | pull_request: 8 | branches: ["*"] 9 | # Runs on pushes to main 10 | push: 11 | branches: ["main"] 12 | # Runs on demand 13 | workflow_dispatch: 14 | 15 | jobs: 16 | build: 17 | runs-on: ubuntu-latest 18 | container: oscarlevin/pretext:full 19 | 20 | steps: 21 | - name: Checkout source 22 | uses: actions/checkout@v4 23 | 24 | - name: install deps 25 | run: pip install -r requirements.txt 26 | 27 | - name: install local ptx files 28 | run: pretext --version 29 | 30 | - name: build deploy targets 31 | run: | 32 | version="$(pretext --version)" 33 | major="$(echo $version | cut -d '.' -f 1)" 34 | minor="$(echo $version | cut -d '.' -f 2)" 35 | if [ "$major" -ge 2 -a "$minor" -ge 5 ]; then 36 | echo "PreTeXt version is 2.5 or greater; using new build command" 37 | pretext build --deploys 38 | else 39 | echo "PreTeXt version is less than 2.5, using old build command" 40 | pretext build 41 | fi 42 | - name: stage deployment 43 | run: pretext deploy --stage-only 44 | 45 | - name: Bundle output/stage as artifact 46 | uses: actions/upload-artifact@v4 47 | with: 48 | name: deploy 49 | path: output/stage 50 | 51 | deploy-cloudflare: 52 | runs-on: ubuntu-latest 53 | needs: build 54 | if: vars.CLOUDFLARE_PROJECT_NAME != '' 55 | permissions: 56 | contents: read 57 | deployments: write 58 | 59 | steps: 60 | - name: Download artifact 61 | uses: actions/download-artifact@v4 62 | with: 63 | name: deploy 64 | path: deploy 65 | - name: Create 404.html 66 | run: echo "404 page not found" >> deploy/404.html 67 | - name: Publish to Cloudflare 68 | uses: cloudflare/pages-action@v1 69 | with: 70 | apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} 71 | accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} 72 | projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }} 73 | gitHubToken: ${{ secrets.GITHUB_TOKEN }} 74 | branch: ${{ github.head_ref || github.ref_name }} 75 | directory: deploy 76 | 77 | deploy-ghpages: 78 | runs-on: ubuntu-latest 79 | needs: build 80 | if: vars.PTX_ENABLE_DEPLOY_GHPAGES == 'yes' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) 81 | permissions: 82 | contents: read 83 | pages: write 84 | id-token: write 85 | concurrency: 86 | group: "page" 87 | cancel-in-progress: false 88 | environment: 89 | name: github-pages 90 | url: ${{ steps.deployment.outputs.page_url }} 91 | steps: 92 | - name: Download website artifact 93 | uses: actions/download-artifact@v4 94 | with: 95 | name: deploy 96 | path: deploy 97 | - name: Setup GitHub Pages 98 | id: check 99 | uses: actions/configure-pages@v4 100 | - name: Upload artifact 101 | uses: actions/upload-pages-artifact@v3 102 | with: 103 | path: deploy 104 | - name: Deploy to Github Pages 105 | id: deployment 106 | uses: actions/deploy-pages@v4 107 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # (delete the above line to manage this file manually) 3 | 4 | # Boilerplate list of files in a PreTeXt project for git to ignore 5 | # ensure this file is tracked 6 | !.gitignore 7 | 8 | # don't track unpublished builds or stage (note: Runestone uses `published`) 9 | output 10 | published 11 | 12 | # don't track assets generated from source 13 | generated-assets 14 | 15 | # don't track the executables.ptx file 16 | executables.ptx 17 | 18 | # don't track node packages 19 | node_modules 20 | 21 | # don't track error logs 22 | .error_schema.log 23 | logs 24 | 25 | # don't track OS related files (windows/macos/linux) 26 | .DS_Store 27 | .DS_Store? 28 | ._* 29 | .AppleDouble 30 | .LSOverride 31 | .Spotlight-V100 32 | .Trashes 33 | Icon 34 | .AppleDB 35 | .AppleDesktop 36 | Network Trash Folder 37 | Temporary Items 38 | .apdisk 39 | Thumbs.db 40 | Thumbs.db:encryptable 41 | ehthumbs.db 42 | ehthumbs_vista.db 43 | *.stackdump 44 | *.lnk 45 | *.cab 46 | *.msi 47 | *.msix 48 | *.msm 49 | *.msp 50 | [Dd]esktop.ini 51 | .directory 52 | .fuse_hidden* 53 | .Trash-* 54 | .nfs* 55 | 56 | # Don't include VSCode generated files 57 | .vscode 58 | *.code-workspace 59 | 60 | # Don't inlucde SublimeText files 61 | # Cache files for Sublime Text 62 | *.tmlanguage.cache 63 | *.tmPreferences.cache 64 | *.stTheme.cache 65 | 66 | # Workspace files are user-specific 67 | *.sublime-workspace 68 | 69 | # Project files should be checked into the repository, unless a significant 70 | # proportion of contributors will probably not be using Sublime Text 71 | *.sublime-project 72 | 73 | # SFTP configuration file 74 | sftp-config.json 75 | sftp-config-alt*.json 76 | 77 | # Package control specific files 78 | Package Control.last-run 79 | Package Control.ca-list 80 | Package Control.ca-bundle 81 | Package Control.system-ca-bundle 82 | Package Control.cache/ 83 | Package Control.ca-certs/ 84 | Package Control.merged-ca-bundle 85 | Package Control.user-ca-bundle 86 | oscrypto-ca-bundle.crt 87 | bh_unicode_properties.cache 88 | 89 | # Sublime-github package stores a github token in this file 90 | # https://packagecontrol.io/packages/sublime-github 91 | GitHub.sublime-settings 92 | 93 | 94 | # Don't include Dropbox settings and caches 95 | .dropbox 96 | .dropbox.attr 97 | .dropbox.cache 98 | 99 | # Don't track codechat config (will be generated automatically) 100 | codechat_config.yaml 101 | 102 | # Don't track deprecated workflows 103 | .github/workflows/deploy.yml 104 | .github/workflows/test-build.yml 105 | -------------------------------------------------------------------------------- /GenerateAssetsHelp.md: -------------------------------------------------------------------------------- 1 | # Help for LaTeX-based builds (PDF) and Generating Assets in PreTeXt-Codespace 2 | 3 | There are three docker images available trading off between size and functionality. If you find that the default "small" image leads to compilation errors when building LaTeX or when generating some assets, switch to the "full" tag. If you only build web targets and don't have any latex-image assets to generate, you can use the "lite" tag to save more space. 4 | 5 | To change the docker image, open the file `.devcontainer/devcontainer.json`, comment out the line starting with `"image":` and uncomment the appropriate alternative line below that. 6 | 7 | Once you save the `devcontainer.json` file, VS Code should offer to rebuild your container. You can also force a rebuild using the command pallet or clicking the "Codespaces" button in the bottom status bar. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This work is licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0). 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitHub for Mathematicians 2 | 3 | A handbook for mathematical researchers and instructors to start using GitHub services to 4 | maintain open and collaborative digital products. 5 | 6 | ## Contributing 7 | 8 | Contributions are very welcome! Please feel free to open an Issue or 9 | make a Pull Request to the main repository at 10 | . By making a 11 | contribution, you are agreeing to transfer ownership of any contributed intellectual 12 | property to the author, which will in turn be made available for free and 13 | public use under an open license. 14 | 15 | ## Copyright 16 | 17 | This work is copyright 2023-2024 Steven Clontz, available for free and public use 18 | under an [open license](./LICENSE.md). 19 | -------------------------------------------------------------------------------- /assets/first-notebook.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "This notebook is adapted from\n", 8 | "\n", 9 | "\n", 10 | "\n", 11 | "under the terms of its\n", 12 | "[MIT license](https://github.com/jvdkwast/Python3_Jupyter_Notebook/blob/7fa1d238d56b8baa6f19a90a37c273f8699c2bad/LICENSE)." 13 | ] 14 | }, 15 | { 16 | "cell_type": "markdown", 17 | "metadata": {}, 18 | "source": [ 19 | "# 1. Very simple 'programs'\n", 20 | "## 1.1 Running Python from the command line\n", 21 | "In order to test pieces of code we can run Python from the command line. In this Jupyter Notebook we are going to simulate this. You can type the commands in the fields and execute them.
\n", 22 | "In the field type:
\n", 23 | "```python\n", 24 | "print('Hello, World')\n", 25 | "```\n", 26 | "Then press ` + ` to execute the command.\n", 27 | "\n" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [] 36 | }, 37 | { 38 | "cell_type": "markdown", 39 | "metadata": {}, 40 | "source": [ 41 | "What happened?\n", 42 | "\n", 43 | "You just created a program, that prints the words 'Hello, World'. The Python environment that you are in immediately compiles whatever you have typed in. This is useful for testing things, e.g. define a few variables, and then test to see if a certain line will work. That will come in a later lesson, though." 44 | ] 45 | }, 46 | { 47 | "cell_type": "markdown", 48 | "metadata": {}, 49 | "source": [ 50 | "## 1.2 Math in Python\n", 51 | "Type
\n", 52 | "```python\n", 53 | "1 + 1\n", 54 | "```\n", 55 | "and execute the code." 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "metadata": { 62 | "scrolled": true 63 | }, 64 | "outputs": [], 65 | "source": [] 66 | }, 67 | { 68 | "cell_type": "markdown", 69 | "metadata": {}, 70 | "source": [ 71 | "Now type\n", 72 | "```python\n", 73 | "20 + 80\n", 74 | "```\n", 75 | "and execute the code." 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": null, 81 | "metadata": {}, 82 | "outputs": [], 83 | "source": [] 84 | }, 85 | { 86 | "cell_type": "markdown", 87 | "metadata": {}, 88 | "source": [ 89 | "These are additions. We can of course use other mathematical operators.
\n", 90 | "Try this subtraction:
\n", 91 | "```python\n", 92 | "6 - 5\n", 93 | "```" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": null, 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "and this multiplication:
\n", 108 | "```python\n", 109 | "2 * 5\n", 110 | "```" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": null, 116 | "metadata": {}, 117 | "outputs": [], 118 | "source": [] 119 | }, 120 | { 121 | "cell_type": "markdown", 122 | "metadata": {}, 123 | "source": [ 124 | "Try:\n", 125 | "```python\n", 126 | "5 ** 2\n", 127 | "```" 128 | ] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "execution_count": null, 133 | "metadata": {}, 134 | "outputs": [], 135 | "source": [] 136 | }, 137 | { 138 | "cell_type": "markdown", 139 | "metadata": {}, 140 | "source": [ 141 | "`**` is the exponential operator, so we executed 5 squared." 142 | ] 143 | }, 144 | { 145 | "cell_type": "markdown", 146 | "metadata": {}, 147 | "source": [ 148 | "Type:\n", 149 | "```python\n", 150 | "print('1 + 2 is an addition')\n", 151 | "```" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": null, 157 | "metadata": {}, 158 | "outputs": [], 159 | "source": [] 160 | }, 161 | { 162 | "cell_type": "markdown", 163 | "metadata": {}, 164 | "source": [ 165 | "You see that the `print` statement writes something on the screen.\n", 166 | "\n", 167 | "Try this:\n", 168 | "```python\n", 169 | "print('one kilobyte is 2^10 bytes, or', 2 ** 10, 'bytes')\n", 170 | "```" 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "execution_count": null, 176 | "metadata": {}, 177 | "outputs": [], 178 | "source": [] 179 | }, 180 | { 181 | "cell_type": "markdown", 182 | "metadata": {}, 183 | "source": [ 184 | "This demonstrates that you can print text and calculations in a sentence. The commas separating each section are a way of separating strings (text) from calculations or variable." 185 | ] 186 | }, 187 | { 188 | "cell_type": "markdown", 189 | "metadata": {}, 190 | "source": [ 191 | "Now try this:\n", 192 | "```python\n", 193 | "23 / 3\n", 194 | "```" 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": null, 200 | "metadata": {}, 201 | "outputs": [], 202 | "source": [] 203 | }, 204 | { 205 | "cell_type": "markdown", 206 | "metadata": {}, 207 | "source": [ 208 | "And this:
\n", 209 | "```python\n", 210 | "23 % 3\n", 211 | "```" 212 | ] 213 | }, 214 | { 215 | "cell_type": "code", 216 | "execution_count": null, 217 | "metadata": {}, 218 | "outputs": [], 219 | "source": [] 220 | }, 221 | { 222 | "cell_type": "markdown", 223 | "metadata": {}, 224 | "source": [ 225 | "`%` returns the remainder of the division." 226 | ] 227 | }, 228 | { 229 | "cell_type": "markdown", 230 | "metadata": {}, 231 | "source": [ 232 | "## 1.3 Order of Operations" 233 | ] 234 | }, 235 | { 236 | "cell_type": "markdown", 237 | "metadata": {}, 238 | "source": [ 239 | "Remember that thing called order of operation that they taught in maths? Well, it applies in Python, too. Here it is, if you need reminding:
\n", 240 | "1. Parenthesis `()`\n", 241 | "2. Exponents `**`\n", 242 | "3. Multiplication `*`, division `/` and remainder `%`\n", 243 | "4. Addition `+` and subtraction `-`" 244 | ] 245 | }, 246 | { 247 | "cell_type": "markdown", 248 | "metadata": {}, 249 | "source": [ 250 | "Here are some examples that you might want to try, if you're rusty on this:
\n", 251 | "```python\n", 252 | "1 + 2 * 3\n", 253 | "(1 + 2) * 3\n", 254 | "```" 255 | ] 256 | }, 257 | { 258 | "cell_type": "code", 259 | "execution_count": null, 260 | "metadata": {}, 261 | "outputs": [], 262 | "source": [] 263 | }, 264 | { 265 | "cell_type": "code", 266 | "execution_count": null, 267 | "metadata": {}, 268 | "outputs": [], 269 | "source": [] 270 | }, 271 | { 272 | "cell_type": "markdown", 273 | "metadata": {}, 274 | "source": [ 275 | "## 1.4 Comments, Please\n", 276 | "The final thing you'll need to know to move on to multi-line programs is the comment. Type the following (and yes, the output is shown):\n", 277 | "```python\n", 278 | "# I am a comment. Fear my wrath!\n", 279 | "```" 280 | ] 281 | }, 282 | { 283 | "cell_type": "code", 284 | "execution_count": null, 285 | "metadata": {}, 286 | "outputs": [], 287 | "source": [] 288 | }, 289 | { 290 | "cell_type": "markdown", 291 | "metadata": {}, 292 | "source": [ 293 | "A comment is a piece of code that is not run. In Python, you make something a comment by putting a hash in front of it. A hash comments everything after it in the line, and nothing before it. So you could type this:\n", 294 | "```python\n", 295 | "print(\"food is very nice\") #eat me\n", 296 | "```" 297 | ] 298 | }, 299 | { 300 | "cell_type": "code", 301 | "execution_count": null, 302 | "metadata": {}, 303 | "outputs": [], 304 | "source": [] 305 | }, 306 | { 307 | "cell_type": "markdown", 308 | "metadata": {}, 309 | "source": [ 310 | "This results in a normal output, without the smutty comment, thank you very much.\n", 311 | "\n", 312 | "Now try this:\n", 313 | "```python\n", 314 | "# print(\"food is very nice\")\n", 315 | "```" 316 | ] 317 | }, 318 | { 319 | "cell_type": "code", 320 | "execution_count": null, 321 | "metadata": {}, 322 | "outputs": [], 323 | "source": [] 324 | }, 325 | { 326 | "cell_type": "markdown", 327 | "metadata": {}, 328 | "source": [ 329 | "Nothing happens, because the code was after a comment." 330 | ] 331 | }, 332 | { 333 | "cell_type": "markdown", 334 | "metadata": {}, 335 | "source": [ 336 | "Comments are important for adding necessary information for another programmer to read, but not the computer. For example, an explanation of a section of code, saying what it does, or what is wrong with it. You can also comment bits of code by putting a `#` in front of it - if you don't want it to compile, but can't delete it because you might need it later." 337 | ] 338 | }, 339 | { 340 | "cell_type": "markdown", 341 | "metadata": {}, 342 | "source": [ 343 | "# Assignment 1\n", 344 | "\n", 345 | "Type in the cell below an expression to find out how many seconds are there in a 365-day year." 346 | ] 347 | }, 348 | { 349 | "cell_type": "code", 350 | "execution_count": null, 351 | "metadata": {}, 352 | "outputs": [], 353 | "source": [] 354 | }, 355 | { 356 | "cell_type": "markdown", 357 | "metadata": {}, 358 | "source": [ 359 | "# Assignment 2\n", 360 | "\n", 361 | "The Earth can be approximated as a sphere with a radius of 6370 km. Use the cell below to find out the volume of such a shape in cubic meters." 362 | ] 363 | }, 364 | { 365 | "cell_type": "code", 366 | "execution_count": null, 367 | "metadata": {}, 368 | "outputs": [], 369 | "source": [] 370 | }, 371 | { 372 | "cell_type": "markdown", 373 | "metadata": {}, 374 | "source": [ 375 | "# Assignment 3\n", 376 | "\n", 377 | "Get the answer of the following expression, using the cell below:\n", 378 | "\n", 379 | "$$\\frac{1}{2}+\\frac{\\frac{1}{3}}{\\frac{1}{4}+\\frac{1}{5}}$$" 380 | ] 381 | }, 382 | { 383 | "cell_type": "code", 384 | "execution_count": null, 385 | "metadata": {}, 386 | "outputs": [], 387 | "source": [] 388 | } 389 | ], 390 | "metadata": { 391 | "kernelspec": { 392 | "display_name": "Python 3 (ipykernel)", 393 | "language": "python", 394 | "name": "python3" 395 | }, 396 | "language_info": { 397 | "codemirror_mode": { 398 | "name": "ipython", 399 | "version": 3 400 | }, 401 | "file_extension": ".py", 402 | "mimetype": "text/x-python", 403 | "name": "python", 404 | "nbconvert_exporter": "python", 405 | "pygments_lexer": "ipython3", 406 | "version": "3.11.4" 407 | } 408 | }, 409 | "nbformat": 4, 410 | "nbformat_minor": 4 411 | } 412 | -------------------------------------------------------------------------------- /assets/g4m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/g4m.png -------------------------------------------------------------------------------- /assets/g4m.svg: -------------------------------------------------------------------------------- 1 | 2 | 198 | -------------------------------------------------------------------------------- /assets/git-branches-source.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /assets/git-branches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/git-branches.png -------------------------------------------------------------------------------- /assets/screenshots/codespace-explorer-newfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/codespace-explorer-newfile.png -------------------------------------------------------------------------------- /assets/screenshots/codespace-preview-md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/codespace-preview-md.png -------------------------------------------------------------------------------- /assets/screenshots/codespace-python-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/codespace-python-extension.png -------------------------------------------------------------------------------- /assets/screenshots/codespace-python-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/codespace-python-script.png -------------------------------------------------------------------------------- /assets/screenshots/codespace-timeout-retention.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/codespace-timeout-retention.png -------------------------------------------------------------------------------- /assets/screenshots/copilot-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/copilot-icon.png -------------------------------------------------------------------------------- /assets/screenshots/github-codespace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/github-codespace.png -------------------------------------------------------------------------------- /assets/screenshots/github-com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/github-com.png -------------------------------------------------------------------------------- /assets/screenshots/github-dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/github-dev.png -------------------------------------------------------------------------------- /assets/screenshots/pages-actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/pages-actions.png -------------------------------------------------------------------------------- /assets/screenshots/pages-setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/pages-setting.png -------------------------------------------------------------------------------- /assets/screenshots/pages-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/screenshots/pages-template.png -------------------------------------------------------------------------------- /assets/website-example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My website! 5 | 6 | 7 |

Thanks for visiting!

8 | 9 | 10 | -------------------------------------------------------------------------------- /assets/website-example.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code4mathorg/github-for-mathematicians/92ba1a88efa84e3a2c0fbf273768f266f27e3c3a/assets/website-example.zip -------------------------------------------------------------------------------- /project.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /publication/publication.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | 117 | 118 | 125 | 126 | 127 | 128 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | pretext == 2.11.3 3 | -------------------------------------------------------------------------------- /site/CNAME: -------------------------------------------------------------------------------- 1 | g4m.clontz.org 2 | -------------------------------------------------------------------------------- /source/ax-additional-topics.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Additional Topics 5 |
6 | GitHub Desktop 7 |

TODO

8 |
9 |
10 | VS Code Application 11 |

TODO

12 |
13 |
14 | Using the Terminal 15 |

TODO

16 |
17 |
-------------------------------------------------------------------------------- /source/ax-related.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Additional Reading 5 |

6 |

    7 |
  • 8 |

    9 | 10 | Version Control with Git 11 | 12 |

    13 |
  • 14 |
  • 15 |

    16 | 17 | Programming with Python 18 | 19 |

    20 |
  • 21 |
22 |

23 |
-------------------------------------------------------------------------------- /source/ch-coding.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | Writing and Running Code 4 |
5 | Codespaces 6 |

7 | While the quick GitHub.dev interface we used 8 | to get started in is great 9 | for quick uploads or edits, many projects require the ability 10 | to run applications and execute code as you would on 11 | your personal computer. Fortunately, GitHub offers a 12 | service to run such programs on their servers. 13 |

14 | 15 | 16 |

17 | A Codespace is a dev environment service 18 | offered by GitHub. 19 | Each codespace is essentially a personal virtual computer that 20 | runs in the cloud, that you access through your web browser. 21 |

22 |

23 | Full documentation on Codespaces is available on 24 | docs.github.com. 25 |

26 |
27 |
28 | 29 |

30 | To create a Codespace on any repository you own, use the green 31 | Code button, select the Codespaces tab, and press 32 | the green Create codespace on [branchname] button. 33 |

34 |
35 |

36 | After the Codespace boots up, you'll have an interface similar 37 | to the GitHub.dev environment you learned about in 38 | . 39 |

40 | 41 |

42 | Here are a few key differences between 43 | GitHub.dev and Codespaces. 44 |

    45 |
  1. 46 |

    47 | A GitHub.dev URL looks like github.dev/username/reponame, 48 | while a Codespace URL looks like 49 | random-word-123randomcharacters789.github.dev. 50 |

    51 |
  2. 52 |
  3. 53 |

    54 | GitHub.dev is quicker to load than a Codespace. 55 |

    56 |
  4. 57 |
  5. 58 |

    59 | GitHub.dev has a much more limited selection of VS Code 60 | extensions to use. 61 |

    62 |
  6. 63 |
  7. 64 |

    65 | You can only install applications and execute code on a Codespace. 66 |

    67 |
  8. 68 |
69 |

70 |
71 |

72 | One similarity between GitHub.dev and Codespaces 73 | (besides the obviously similar VS Code user interfaces), 74 | is that your work is still private to you and can only be 75 | shared with the public (and retained in the long term) by 76 | committing and pushing your progress every so often to your 77 | GitHub.com repository. The Source Control tool works slightly 78 | different in a Codespace, however. 79 |

80 | 81 |

82 | One quick way to commit and push your changes from a Codespace 83 | is to use Source Control from the left toolbar. 84 |

    85 |
  • 86 |

    87 | Enter a short commit message describing 88 | your changes as a note to yourself. (This is 89 | required and can be a pain to fix if you forget 90 | to do so!) 91 |

    92 |
  • 93 |
  • 94 |

    95 | Select Commit & Sync from the menu 96 | next to the green Commit button. 97 |

    98 |
  • 99 |
  • 100 |

    101 | In the dialogs that follow, I suggest choosing 102 | to Always stage all your changes and commit them 103 | directly, then OK, Don't Show Again when told 104 | this action will pull and push commits from and to 105 | origin/main, and finally Yes that you 106 | would like your Codespace to periodically run 107 | git fetch. 108 |

    109 |
  • 110 |
111 |

112 |
113 |
114 |
115 | Writing and Running Code 116 |

117 | Now that we've provisioned our Codespace virtual cloud computer, 118 | we can use it to write and execute code using our web browser for 119 | essentially any programming lanugage. 120 |

121 |

122 | Our first example will be Python, a popular general-purpose programming 123 | language (and the same language we will use in 124 | for Jupyter notebooks). In your Codespace, right-click on the file Explorer 125 | to create a New File.... Name this file something.py so your 126 | Codespace recognizes the file as a Python script (due to the .py file 127 | extension). 128 | This should trigger the prompt shown in 129 | to install a Python extension - go ahead and do it. 130 |

131 |
132 | 133 | 134 | A screenshot of the prompt that displays in a Codespace 135 | to install the Python extension. 136 | 137 | 138 | Prompt to install the Python extension. 139 |
140 |

141 | Add the line print("Hello world!") to your file. 142 | A play icon () should be displayed 143 | in the upper-right corner of the text editor (thanks to the 144 | Python extension you installed). Clicking 145 | this button should execute the code to print a greeting 146 | as in . 147 |

148 |
149 | 150 | 151 | A screenshot of a Python script being executed within a Codespace. 152 | 153 | 154 | Running a Python script in a Codespace. 155 |
156 |

157 | Unless your Codespace has been customized via a 158 | .devcontainer.json file (which we won't get 159 | into here), you'll be using the default Codespace 160 | image provided by GitHub. This environment is ready 161 | to execute code from various standard programming 162 | lanugages, though for some of them you may 163 | need to run the script using the Terminal. 164 |

165 | 166 | 167 |

168 | A terminal is a command-line prompt used to 169 | run programs that don't have a graphical user interface. 170 | Type the command and hit Enter to run it. 171 |

172 |
173 |
174 | 175 | 176 |

177 | To open a terminal on demand in a Codespace, use the shortcut 178 | Ctrl/Cmd+Shift+`. 179 |

180 |
181 |
182 |

183 | What do you think the programs in 184 | , 185 | , and 186 | 187 | will output? Copy-paste them into a file in your Codespace, 188 | then run to find out! 189 |

190 | 191 | 192 | 193 | # name this Python file something.py 194 | # execute using the ▶ button or by running this in a terminal: 195 | # python something.rb 196 | a,b = 1,1 197 | print(a) 198 | print(b) 199 | for _ in range(10): 200 | print(a+b) 201 | a,b = b,a+b 202 | 203 | 204 | Sample Python code 205 | 206 | 207 | 208 | 209 | # name this Ruby file something.rb 210 | # execute by running this in a terminal: 211 | # ruby something.rb 212 | a,b = 1,1 213 | puts a 214 | puts b 215 | 10.times do 216 | puts a+b 217 | a,b = b,a+b 218 | end 219 | 220 | 221 | Sample Ruby code 222 | 223 | 224 | 225 | 226 | // name this Javascript file something.js 227 | // execute by running this in a terminal: 228 | // node something.js 229 | let a = 1, b = 1 230 | console.log(a) 231 | console.log(b) 232 | Array.from({ length: 10 }, _ => { 233 | console.log(a+b) 234 | let _a = a 235 | a = b 236 | b = _a + b 237 | }) 238 | 239 | 240 | 241 | Sample Javascript code 242 | 243 |
244 |
245 | Managing Your Codespaces 246 |

247 | GitHub users are provided with a limited amount of free Codespace 248 | hours and storage each month, with additional resources available 249 | to Pro users, including those with the free GitHub Education 250 | benefit (). If needed, 251 | there is the option to pay for additional resources. 252 |

253 |

254 | As a mathematician 255 | who almost exclusively uses GitHub Codespaces for doing the kinds 256 | of work described in this handbook (and does so for much longer 257 | periods of time than a typical mathematician), 258 | I've only surpassed GitHub's free quota on the rare occassion 259 | (and when I do, I've paid only \$2-\$6 per month). 260 | I accomplish this by halting 261 | my Codespaces when I'm not actively working on them. 262 |

263 | 264 |

265 | To manage your Codespace resources, visit 266 | . 267 | You can stop a Codespace temporarily to preserve your hourly quota, 268 | and delete a Codespace you don't plan to use for a while to save 269 | on your storage quota. While actively working in a Codespace, 270 | you can stop it by pressing 271 | Ctrl/Cmd+Shift+P, 272 | typing stop current codespace, and confirming. 273 |

274 |

275 | In any case, a 276 | stopped Codespace can be restarted later when you want to 277 | resume work, even if you haven't committed and pushed your changes. 278 | (But be warned: a stopped Codespace and its uncommitted changes may 279 | be deleted by GitHub after a few days of inactivity, so don't leave it 280 | alone for long.) 281 |

282 |

283 | A deleted Codespace can always be recreated later based upon your most 284 | recent commit. 285 |

286 |
287 | 288 |

289 | shows a screenshot of 290 | some settings available on 291 | github.com/settings/codespaces 292 | to adjust the default time your Codespace can idle before it times out 293 | (to save your compute time resources), and to adjust the default time 294 | your Codespace will be retained before it is deleted 295 | (to save your storage resources). 296 |

297 |
298 |
299 | Screenshot of Codespace management settings 300 | 301 | 302 |

Screenshot of a web browser. Its text follows:

303 |

Default idle timeout

304 |

A codespace will suspend after a period of inactivity. You can specify a default idle timeout value, which will apply to all codespaces created after the default is changed. You will be charged for the entire time your codespace is running, even if it is idle. The maximum value is 240 minutes (4 hours).

305 |

Default retention period

306 |

Inactive codespaces are automatically deleted 30 days after the last time they were stopped. A shorter retention period can be set, and will apply to all codespaces created going forward. The default and maximum value is 30 days. Learn about retention setting

307 |
308 | 309 |
310 |

311 | Putting it all together, we have seen three ways to access files on your repo. 312 | Going from the least easy to edit to the most editable we have: GitHub.com, 313 | GitHub.dev, random-codespace-string.github.dev. 314 | Here is what these environments look like. 315 |

316 |
317 | 318 | 319 | 320 | Repo from different points of view. 321 |
322 |
323 |
324 | Powering up your Codespce 325 |

326 | As of January 2025, a default codespace will use a 327 | 2-core processor and 8GB of RAM, with a quota of 328 | 60 usage hours and 15GB storage per month. (This is increased 329 | to 90 usage hours and 20GB storage for Pro/Education users.) 330 | This is fine for many tasks, 331 | but if you're doing data analysis () or 332 | formalized mathematics () you may want some 333 | more resources at your disposal. 334 |

335 | 336 |

337 | You can double (or quadruple, or 8\times, etc.) your resources 338 | by changing the machine type. There are several ways to accomplish 339 | this, via , or by typing 340 | Change Machine Type in the Codespace command pallette 341 | (accessed via Ctrl/Cmd+Shift+P). 342 |

343 |

344 | Note however, that if you double your resources, you are also doubling your 345 | usage time (e.g. running a 4-core machine uses one hour of your quota 346 | every 30 minutes). 347 |

348 |
349 |
350 |
351 | Custom Codespaces 352 |

353 | A key feature of Codespaces is that they can be customized by the use of a 354 | .devcontainer.json file (or .devcontainer directory). Such files describe 355 | the virtual machine that should be provisioned when creating a Codespace, 356 | allowing for the automatic installation of appropriate software/libraries/dependencies 357 | necessary for the use of a given repository. 358 |

359 | 360 |

361 | Setting up a custom .devcontainer is a slick way to 362 | ensure you and your collaborators/students are running exactly 363 | the same software (including versions, dependencies, etc.)! 364 | No more It works on my machine while I can't get it 365 | to work on my machine! 366 |

367 |

368 | See VisualStudio.com/docs/devcontainers 369 | to learn more. 370 |

371 |
372 |
373 |
-------------------------------------------------------------------------------- /source/ch-collaboration.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | Collaborating with Others 4 |
5 | Collaborators and Pull Requests 6 |

7 | A direct way to allow multiple people you trust to work on the 8 | same repository is to add these GitHub users as collaborators. 9 |

10 | 11 | 12 |

13 | A collaborator for a GitHub repository has the ability 14 | to commit and sync changes to the project, as well as adjust certain settings 15 | of the repository. 16 | 17 | GitHub documentation 18 | 19 | provides some details on the different permissions/abilities that owners 20 | have in comparison to collaborators. 21 |

22 |
23 |
24 |

25 | Collaborators are added by going to your repository's Settings tab, 26 | using the Collaborators link in the sidebar. Each collaborator will 27 | need their own GitHub account, and must accept the invitation to 28 | collaborate before gaining access. 29 |

30 |

31 | Once they have access, a collaborator can either use GitHub.dev 32 | () or create their own 33 | Codespace (). 34 |

35 | 36 |

37 | If two collaborators on the same repository make commits on 38 | the same branch, they will desynchronize your project's history: 39 | person A's history will think that commit X is followed by 40 | Y on branch main, but person B's history will think that 41 | commit X is followed by Z on branch main. 42 |

43 |

44 | As seen in , Git is meant to 45 | support non-linear history. However, to support this, contributors 46 | must name their distinct branches. 47 |

48 |
49 | 50 |

51 | Our recommendation to support multiple collaborators on the same 52 | repository is to never directly commit to the main branch, 53 | even if you're the owner. 54 |

55 |

56 | To commit to an alternative branch in GitHub.dev or Codespaces, select 57 | main in the bottom toolbar, then type the name of your new branch, 58 | and select Create new branch. It's a good idea to name your 59 | branch in the form UserName/short-description-of-topic, 60 | or if you're unsure of the topic, you can just use the current 61 | date: UserName/YYYYMMDD. Note that prefixing with your 62 | UserName helps prevent two people from accidentally using the same 63 | branch name. 64 |

65 |
66 |

67 | Once a collaborator is working on a branch, they are free to edit as 68 | they wish, and can (and should) commit and push/sync with GitHub to 69 | persist their contributions to the team's repository. 70 |

71 |

72 | To facilitate communication among collaborators working on 73 | different branches, it's good practice to open a draft pull request 74 | once a new branch is created. 75 |

76 | 77 | 78 |

79 | A pull request (or PR for short) 80 | is a discussion thread for a branch 81 | that proposes changes to a different (often, the main) branch. 82 | When the branch's changes are ready to be merged, this can be 83 | accomplished by pressing a button on the pull request webpage. 84 |

85 |

86 | A PR can be marked as a draft 87 | or ready to review. 88 |

89 |
90 |
91 | 92 |

93 | Depending on whether the collaborator is using GitHub.dev or 94 | Codespaces, they may be prompted to create a pull request when first 95 | pushing/syncing changes. If not, a pull request can be created by 96 | navigating to the repository page on GitHub.com. 97 |

98 |

99 | Recent pushes to a 100 | branch will reveal a prompt to create the pull request immediately. 101 | Otherwise, the PR can be created by using the Pull Requests tab 102 | of the page. 103 |

104 |

105 | Unless the PR is for a single commit that's immediately 106 | ready for review, a new PR should be created as 107 | a draft. 108 |

109 |
110 |

111 | With a draft pull request created, the contributor can 112 | continue to commit and push/sync to the branch until it is 113 | ready for review. The discussion features of GitHub can allow 114 | contributors to discuss the proposed changes, whether they are in 115 | draft or review-ready status. 116 |

117 | 118 |

119 | A draft pull request has a large button near the end of the 120 | discussion thread to mark the pull request as ready for review. 121 |

122 |

123 | A ready for review pull request can be converted to a draft 124 | by using a small link on the right sidebar. 125 |

126 |
127 |

128 | Depending on the complexity or maturity of the project, 129 | you may wish to develop a review process with your collaborators, 130 | or simply use the PR workflow to clearly communicate when changes 131 | are being made to the main branch, and ensure no two collaborators 132 | make incompatible changes to the same branch. Whatever you choose, 133 | you'll eventually want to incorporate these branched changes into 134 | your main branch. 135 |

136 | 137 |

138 | There are several options for merging a branch's pull request. 139 | I recommend the Squash and Merge option, which converts all 140 | the branch's commits/changes into a single new commit extending the 141 | target branch. 142 |

143 |
144 |

145 | As long as contributions are made using appropriate branches 146 | and pull requests, you will have minimal problems with conflicting 147 | changes made between different collaborators, with GitHub handling 148 | the merging process automatically, even if two collaborators edit 149 | the same file. (But not always, see .) 150 |

151 |

152 | But a common error that I frequently make myself: what if you forget 153 | to create a branch with your work, and you acccidentally commit 154 | to main directly? The first safety rail I recommend is to 155 | set up a policy on your repository that will prevent this accidental 156 | commit to be pushed to GitHub. 157 |

158 | 159 |

160 | To prevent unintended changes to your main branch, 161 | follow the instructions at 162 | 163 | GitHub's documentation, 164 | using main as your Branch name pattern, and 165 | enabling required pull requests. 166 |

167 |
168 |
169 |
170 | Undoing accidental commmits to <c>main</c> 171 |

172 | Unfortunately, there's no button to push that will fix a commit 173 | made to the local copy of main accidentally, but there 174 | is a quick-enough fix nonetheless. 175 |

176 | 177 |

178 | This fix must be done in a Codespace, 179 | not GitHub.dev. 180 |

181 |
182 | 183 |

184 | With branch protection enabled, 185 | if you accidentally make updates directly to your personal main 186 | branch, attempting to push these from a Codespace will result in 187 | the error message Can't push refs to remote. 188 | Try running "Pull" first to integrate your changes. 189 |

190 |

191 | To fix this, open a Terminal 192 | () 193 | and type , 194 | changing my-new-branch to the branch name you want to create. 195 | Use Enter to execute the command. 196 |

197 |

198 | Then, copy-paste and your local 199 | main branch will match the official repository, and any changes 200 | you've made will be reflected on the my-new-branch branch 201 | instead. 202 |

203 |
204 | 205 | 206 | 207 | BRANCH=my-new-branch 208 | 209 | 210 | Defining the name for a new branch 211 | 212 | 213 | 214 | 215 | git stash 216 | git branch $BRANCH 217 | git reset --hard origin/main 218 | git checkout $BRANCH 219 | git stash pop 220 | 221 | 222 | Moving local changes to main to a branch 223 | 224 |
225 |
226 | Forks 227 |

228 | One great thing about working with open source on GitHub is that 229 | not only can you collaborate with your trusted colleagues, but 230 | you can also work with collaborators who do not have write access 231 | to your repository. 232 |

233 | 234 | 235 |

236 | A fork for a public repository is a copy of the project's 237 | entire history, made either for the main branch or for all publicly 238 | shared branches. 239 |

240 |
241 |
242 |

243 | Managing contributions from forked repositories is done using the 244 | same workflow as we recommend for collaborating with trusted colleagues 245 | that you've given write access to your repository 246 | (). The only difference 247 | is that an outside collaborator is creating branches and making commits 248 | on their forked copy of your project, not a branch of your original 249 | repository. But GitHub still gives essentially the same options for 250 | the outside collaborator to create a pull request to your project, 251 | without given them access to any data you aren't already sharing with 252 | the public. 253 |

254 | 255 |

256 | To create a fork of a public repository, press the Fork button 257 | on its GitHub.com homepage. You can name this fork whatever you like, 258 | it will be tracked on GitHub as a fork of the original project, with 259 | the ability to make upstream contributions by way of 260 | pull requests. 261 |

262 |
263 |

264 | Those of us who work in open source typically love getting 265 | pull requests from random collaborators. For example, if you find a 266 | typo in this book, you can fxi 267 | it by creating a fork at 268 | , 269 | editing the appropriate source/*.ptx file to fix the word, 270 | and open a pull request. 271 |

272 |
273 |
274 | Handling Merge Conflicts 275 |

276 | Perhaps the most complicated scenario when collaborating 277 | on a Git repository is the dreaded merge conflict. 278 |

279 | 280 | 281 |

282 | While Git is fairly good about merging together changes 283 | made by different contributors to different 284 | files within a project into a cohesive whole, a 285 | merge conflict can occur when two different 286 | contributors attempt to make changes to the same file 287 | (particularly, the same line) at the same time. When the 288 | second contributor opens a pull request, GitHub will warn 289 | about this conflict. 290 |

291 |
292 |
293 |

294 | Handling merge conflicts can be tricky! 295 | Git/GitHub have various tools to help you review and correct 296 | a merge conflict. If you're fortunate, you'll be able to resolve 297 | things on the pull request page: see 298 | 299 | Resolving a merge conflict on GitHub 300 | for full details. 301 |

302 |

303 | You'll be presented with files with some strange markers as in 304 | . The lines between 305 | <<<<<<< HEAD and 306 | ======= were merged first, and the lines between 307 | ======= and 308 | >>>>>>> branch-a are the conflicting 309 | changes trying to be merged. 310 |

311 | 312 | 313 | If you have questions, please 314 | <<<<<<< HEAD 315 | open an Issue 316 | ======= 317 | ask them in Discussions. 318 | >>>>>>> branch-a 319 | 320 | 321 | A merge conflict 322 | 323 |

324 | You can then choose which change to retain, deleting all the 325 | extra <<<<<<< HEAD, 326 | =======, and 327 | >>>>>>> branch-a lines. 328 |

329 |

330 | However, sometimes the merge conflict is too involved to be 331 | corrected using the web interface. In that situation, you will 332 | need to use a Codespace and follow the instructions at either 333 | Resolving a merge conflict using the command line 334 | or 335 | Using Git source control in VS Code | Merge conflicts. 336 |

337 |
338 |
-------------------------------------------------------------------------------- /source/ch-copilot.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Copilot and Other AI Assistants 5 | 6 | Oscar Levin 7 | 8 | 9 |

10 | In this chapter we will explore GitHub's Copilot features, as well as how other AI assistants can be used with GitHub and VS Code. 11 |

12 | 13 |

14 | Note that almost everything in this chapter will likely be out of date almost immediately. 15 | The current suggestions here are up to date as of 2025-01-08. 16 |

17 |
18 | 19 |
20 | AI Assistant Options 21 | 22 |

23 | Copilot is GitHub's AI assistant, tightly integrated with GitHub and VS Code through a pair of extensions. There is currently a free tier that allows for a limited number of interactions each month, as well as a $10/month plan that provides unlimited interactions with Copilot (there is a free trial of the paid version as well). 24 |

25 | 26 |

27 | Depending on what you want to do with your project, other AI assistants might be a better fit. 28 | One notable alternative that might work even better for coding projects is Codeium. 29 | In particular, Codeium has a free tier that appears to offer unlimited interactions. 30 | Like Copilot, Codeium also works with VS Code through an extension and the two use similar interfaces, so it should be relatively easy to switch between the two. 31 |

32 | 33 |

34 | All of the specific commands described below will be those of Copilot, but often the same commands will work with Codeium. 35 | In any event, we will focus on general principles of how to use these coding assistants. 36 |

37 |
38 | 39 |
40 | Setup 41 | 42 |

43 | We will assume you want to use Copilot from inside VS Code, either on your own machine or in a Github Codespace. 44 | To get set up, follow the Quick Start Guide from the Copilot documentation. 45 |

46 | 47 |

48 | In particular, make sure you have 49 |

    50 |
  • 51 |

    52 | Enabled Copilot in your Github account. 53 |

    54 |
  • 55 | 56 |
  • 57 |

    58 | Installed the Copilot extension in VS Code. 59 |

    60 |
  • 61 |
62 |

63 | 64 |

65 | That should be it. 66 |

67 |
68 | 69 |
70 | Features 71 | 72 |

73 | There are three main ways you can interact with Copilot from inside VS Code: 74 |

    75 |
  1. 76 |

    77 | By accepting ghost text suggestions as you type. 78 | Copilot will will show you the most likely words to appear next to your cursor in light gray text. 79 | Hitting TAB will accept the current suggestion in full; CTRL+RightArrow will accept one word at a time. 80 |

    81 |
  2. 82 | 83 |
  3. 84 |

    85 | Use Copilot Chat by clicking the Copilot icon at the top of the VS Code window, right of the search bar (see ). 86 | Select Open chat to open a panel on the right side of the window. 87 | This panel allows you to Ask Copilot questions, similar to using ChatGPT or another AI chatbot. 88 | The key difference is that Copilot uses your current file or workspace (or another selected source) as its context. 89 | You can also use voice commands to ask questions and have Copilot read its answers aloud. 90 |

    91 |
  4. 92 | 93 |
  5. 94 |

    95 | By using Copilot's inline chat. 96 | While typing in the editor, or with a selection highlighted, you can use CTRL+I to get a floating chat window that can provide suggestions based on your cursor position or the current selection. 97 | You can accept or discard edits suggested by copilot easily from this interface. 98 |

    99 |
  6. 100 |
101 |

102 | 103 |
104 | The copilot icon at the top of VS Code. 105 | 106 | 107 | screenshot of vs code with the copilot icon clicked. 108 | 109 | 110 |
111 |
112 | 113 |
114 | Things to Try 115 | 116 |

117 | Here are a few features of Copilot you might want to try out. 118 |

    119 |
  • 120 |

    121 | Suppose you are trying to write some code in a language you are not that familiar with. 122 | Copilot will suggest the next bit of code for you as you type. 123 | To get better suggestions, put in a comment describing what you want to do. 124 | (Hint: if you don't know the syntax for comments, hit CTRL+/ to start a comment in most languages.) 125 |

    126 |
  • 127 | 128 |
  • 129 |

    130 | Does the code do what you want it to? Is it confusing? Ask Copilot to explain the code to you. 131 | You can select the code, hit CTRL+I, and then type /explain (note the forward slash). 132 |

    133 |
  • 134 | 135 |
  • 136 |

    137 | Along these lines, try asking Copilot to document your code for you. 138 | Select the code, hit CTRL+I, and then type /doc. 139 |

    140 |
  • 141 | 142 |
  • 143 |

    144 | Here is something I just did while writing this. 145 | I realized that I wanted all the keyboard shortcuts to be displayed as code, which in is done by enclosing them in c tags. 146 | So I selected the entire document, hit CTRL+I and typed wrap all keyboard shortcuts here with c tags. Copilot then let me see where it made changes (line by line) and let me accept them or not. 147 |

    148 | 149 |

    150 | A very new Copilot feature is Copilot Edits, which allow you to do such things for multiple files at the same time. 151 | I suspect this could also be useful for finding typos. 152 |

    153 |
  • 154 | 155 |
  • 156 |

    157 | If you are working on a mathematical proof or a complex equation, you can ask Copilot to help you format it correctly in LaTeX. 158 | Simply type your equation or proof in plain text, select it, hit CTRL+I, and ask Copilot to convert it to LaTeX. 159 | This can save you a lot of time and ensure that your mathematical notation is accurate. 160 |

    161 | 162 |

    163 | NOTE: I don't know if that's true, the above paragraph was generated by Copilot from the prompt Write a suggestion of something Copilot can do for a mathematician. 164 |

    165 |
  • 166 |
167 |

168 | 169 |

170 | One final thing you might want to try: Turn off completions. 171 | It can be distracting to see what Copilot thinks you should type next; I have found that it often interrupts the idea I have in my head. 172 | You can turn off completions by clicking the Copilot icon at the bottom of the VS Code window and selecting Disable completions. You can also disable completions for particular types of files. 173 |

174 |
175 |
176 | -------------------------------------------------------------------------------- /source/ch-first-repo.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | Your First Repository 4 |
5 | Making an Account 6 |

7 | All the features of GitHub we'll be using are available 8 | using a free GitHub account. 9 |

10 | 11 |

12 | Anyone can create a free GitHub account by 13 | visiting . 14 |

15 |
16 |

17 | For additional free resources, you may also be eligible for 18 | a waiver. 19 |

20 | 21 |

22 | Many students and faculty of schools, colleges, and universties 23 | are eligible to request an 24 | educator discount, providing Pro features at no cost, 25 | by visiting 26 | 27 | while logged into their GitHub account. 28 |

29 |
30 |

31 | You do not need to wait for approval of your educator 32 | discount before continuing to the next section. 33 |

34 |
35 |
36 | Creating the Repo 37 |

38 | Once logged in, a new repository can be created by 39 | pressing the + button in the toolbar, 40 | or visiting . 41 |

42 |

43 | The repository will need a name, which can be something 44 | like my-first-repo for this tutorial. (GitHub 45 | will also suggest a cute random name like 46 | ubiquitous-space-tribble if you have writer's block.) 47 |

48 |

49 | Repositories can be public to everyone 50 | on the internet or private to only people you 51 | approved. I encourage you to work publicly, 52 | to make it easier to collaborate with the open-source 53 | community I can personally attest to 54 | publishing many garbage repositories on GitHub 55 | (along with my hopefully-useful ones), and no one 56 | has called me out for it yet! 57 |

58 |

59 | The last option we'll make sure to select is to 60 | Initialize this repository with: 61 | Add a README file. Then click Create repository. 62 |

63 |
64 |
65 | Editing README.md 66 |

67 | While logged into GitHub.com, you have the ability to edit 68 | individual files on your repositories. (If your repository 69 | is public, others can see those files, but cannot edit them 70 | unless you make them a collaborator, 71 | see .) 72 |

73 |

74 | An easy way to edit an individual file is just to click 75 | the pencil icon such as the one that appears on your README. 76 | This file is written in Markdown. 77 |

78 | 79 | 80 |

81 | Markdown is a markup language 82 | that takes plain text like *this* and renders it 83 | like this. Sites like 84 | and 85 | offer more 86 | complete tutorials. 87 |

88 |
89 |
90 |

91 | Try to edit your file to say something like I'm learning how to 92 | use GitHub!, perhaps adding a link back to this document 93 | using [this markup](https://g4m.clontz.org). You 94 | can click the Preview tab to see what your README will look like. 95 | GitHub also provides a panel of several formatting options 96 | you can click on. 97 |

98 |

99 | When you're happy with your updated README, click the 100 | Commit changes button. This will create a new 101 | commit, representing a new moment in your 102 | project's history. You should write a useful commit message 103 | summarizing the work you've done since your last commit 104 | (or perhaps keep the default Update README.md) 105 | Doing this will update the README visible on your repository 106 | homepage on GitHub.com. 107 |

108 | 109 |

110 | README files are important! If you ever want to share your 111 | repository source with someone else, it's the first thing 112 | they will read. Likewise, if you want to use someone else's 113 | repository, they will hopefully include first steps in their 114 | own README file. 115 |

116 |
117 |

118 | Finally, you might be interested in visiting the Insights 119 | tab for your repository, and specifically the Network page. 120 | It should reveal a graphic similar to 121 | visualizing the history of your project across all GitHub collaborators. 122 | Right now you don't have any collaborators and just a couple commits, 123 | but keeping in mind this model for your project history will be 124 | useful as we juggle various commits and pushes and syncs and so on 125 | down the line. 126 |

127 |
128 |
129 | Using <c>GitHub.dev</c> 130 |

131 | Using the GitHub.com interface to author or edit just one file 132 | can be useful (I do this all the time to make quick typo fixes on 133 | my blog), but you will likely be using GitHub to manage 134 | projects that involve editing mulitple files at the same 135 | time, and likely you will have non-text files (such as images) 136 | that you need to include in your work as well. 137 |

138 |

139 | One way to quickly be able to manage several files at once is 140 | to use the GitHub.dev service 141 | offered by GitHub. Try clicking that link - you should have a 142 | fully-functional VS Code text editor right inside your web browser. 143 |

144 | 145 |

146 | It's best to use an updated version 147 | of Chrome, Edge, or Firefox when using GitHub. In particular, Safari tends 148 | to show off its rough edges when using advanced web applications like 149 | GitHub.dev, so it's best to choose an alternative. 150 |

151 |
152 |

153 | You can create files, edit them, upload images, and do whatever you 154 | like at GitHub.dev. But this isn't your repository - it's just an 155 | example. So, we'll need a way to tell GitHub.dev we want to work on 156 | the repository we just made instead. 157 |

158 | 159 |

160 | There are two very easy ways to access the GitHub.dev service. 161 | The first is to just 162 | change the address of your repository from GitHub.com to 163 | GitHub.dev in your browser. For example, if your repository lives at 164 | https://github.com/YourUserName/YourGreatRepo, you should visit 165 | https://github.dev/YourUserName/YourGreatRepo. 166 |

167 |

168 | The other trick is even fancier. When you are visiting 169 | https://github.com/YourUserName/YourGreatRepo in your web browser 170 | and not writing in a text box, press the period (.) key. 171 |

172 |
173 |

174 | Either way, you should now have a GitHub.dev window where you can manage 175 | all the files of your project. Using the Explorer sidebar 176 | (), you can create 177 | new files, rename files, move files, upload files, and more. Selecting 178 | a file opens it, and lets you edit it as needed. Your changes are saved 179 | automatically in GitHub.dev, but they won't show up at GitHub.com just yet. 180 |

181 |
182 | 183 | Explorer sidebar and New File button 184 |
185 |
186 |
187 | Commiting Your Work 188 |

189 | After you're tried creating/editing/uploading a few files, now it's 190 | time to commit those changes to your repository. The easiest way 191 | to do this is to use the Source Control sidebar. You may have 192 | noticed that a numerical badge appeared by the Source Control icon as you 193 | created, edited, or deleted files. This number represents the number of files 194 | that have been changed in some way since the previous commit. By opening 195 | the Source Control panel, you'll see a list of these files. 196 |

197 |

198 | Clicking these 199 | file names not only lets you open the file and edit it further, but you 200 | are shown a diff - a summary of the lines that have been altered 201 | since the previous commit. (This is a good reason to not write in a long 202 | continuous line, but to break lines every 80ish characters or so. That way 203 | you can easily see where exactly a change is made between each commit.) 204 |

205 |

206 | The idea is this: edit as you see fit, knowing that your files are being 207 | saved at GitHub.dev and won't be lost if you accidentally refresh your 208 | web browser. However, you'll need to eventually commit those changes to 209 | the repository in order to share your work with anyone else, and to ensure 210 | that the work is preserved in the long term. The Source Control panel 211 | provides a place to write a commit message, a short 212 | phrase or sentence that summarizes the work you've done. (Writer's block? 213 | For now just type learning GitHub.dev.) Then once you click 214 | the Commit and Push button, your work will be logged as a permanent 215 | commit to the repository. 216 |

217 |

218 | This is a good point to review your commit history again. You probably 219 | have three commits: the initial commit made when you created the repository, 220 | the README.md update you made using GitHub.com's editing interface, 221 | and this more elaborate GitHub.dev commit involving possibly several files. 222 | To visualize this history, you can go to the Insights/Network page 223 | described earlier, or click on the 3 commits link 224 | from your GitHub.com repository 225 | homepage to see a linearization of this history. From there you can click 226 | on each commit to see exactly what has changed from the previous commit across 227 | all files. 228 |

229 |
230 |
231 | Next steps 232 |

233 | Now that you've gotten the hang of the basics of 234 | committing and pushing changes to a repository, 235 | you can move on to using Codespaces to write 236 | and execute programs and code () 237 | or setting up a webpage hosted by GitHub 238 | (). 239 |

240 |
241 |
-------------------------------------------------------------------------------- /source/ch-git-github.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | Intro to Git & GitHub 4 |
5 | What Is Git? 6 |
7 | 8 | An illustration of Git history 9 | 10 | 11 | An illustration of a project's history 12 | controlled by Git 13 | 14 |
15 |

16 | Git is a distributed version control system 17 | that tracks changes in any set of computer files. 18 | This software was originally authored by Linus Torvalds in 2005 19 | for development of the Linux kernel. 20 | Importantly, Git is free and open-source software, which means you 21 | have the legal and practical ability to use it however you want, 22 | and even modify it for your purposes if you wanted. 23 |

24 |

25 | Two core concepts of Git are commits (illustrated 26 | in by circles) and branches 27 | (illustrated in by lines). A 28 | commit represents the state of your project at a particular 29 | point in its history. Branches allow this history to not be 30 | linear: you can branch off to experiment on a particular new 31 | feature, then merge this feature branch back into 32 | the main branch when it's complete. This is particularly 33 | useful when multiple people collaborate 34 | () 35 | on a Git-managed project. Finally, a Git project is often called a 36 | repository, or repo for short. 37 |

38 |

39 | Since you're reading 40 | GitHub for Mathematicians, I'm obligated to 41 | describe Git history as either a finite partial order, or a loopless directed 42 | graph, depending on your preferred flavor of mathematical models. In particular, 43 | you might consider the normal history of a file to be a linear order 44 | or directed path: 45 | article.tex, then article-dec-1.tex, then article-dec-1-fixed.tex, 46 | and so on. But with Git, you don't need to track your version history with filenames, 47 | you (and your colleagues) can branch your history into several timelines, you 48 | can merge them back together again, and look up the state of your project at any point 49 | where you committed your work. 50 |

51 |
52 |
53 | What Is Git<em>Hub</em>? 54 |

55 | Another key feature of Git is the ability to share 56 | your project, along with its history, with other people. 57 | This is generally accomplished by hosting your repository 58 | on a service such as GitHub: 59 | GitHub.com. 60 | (Other such services 61 | include BitBucket.org 62 | and GitLab.com.) 63 |

64 |

65 | Importantly, GitHub 66 | is not itself open-source software, but is a service owned and operated 67 | by Microsoft. However, Microsoft makes GitHub available for use at no cost to the public, 68 | with additional pro features available for free to instructors and researchers. 69 |

70 |

71 | We'll use GitHub not only as a host for our repositories, but also 72 | to take advantage of all the tools it provides to author content 73 | using only a web browser. If you've looked into using Git in the past, 74 | you may have hesitated due to the apparent need for software developer 75 | experience to get started. However, using GitHub's web applications, 76 | there will be no need for complicated installations or 77 | memorizing command line incantations like git commit -m "foobar" 78 | to type into a terminal. 79 | (Of course, you still can choose to use such tools to get as much 80 | control over your Git project as you want, should the need ever arise: 81 | see ) 82 |

83 |

84 | Another reason to use GitHub: community! GitHub is often marketed as a 85 | social coding platform, because it not only provides tools to create 86 | and deliver digital content, but it also provides social features such as 87 | Following users, Starring repositories, participation in Discussions and Issues, 88 | and more. Particular in open-source, we like to work together and support each other, 89 | and GitHub provides much of the social cyberinfrastructure necessary to do so 90 | efficiently. 91 |

92 |
93 |
94 | G4M on <c>GitHub.com</c> 95 |

96 | An example of a project using Git and GitHub is the 97 | document you're reading right now! 98 | This book is open-sourced and shared at 99 | , 100 | and was authored completely in a web browser using only the GitHub features 101 | we will explore together in this handbook. 102 |

103 |
104 |
105 | -------------------------------------------------------------------------------- /source/ch-jupyter.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | Jupyter Notebooks 4 | 5 |

6 | In you wrote and ran a few short 7 | scripts in various programming languages. But often, we want 8 | to not only be able to write and execute code, but do so 9 | piece-by-piece, and share the results with other people 10 | without requiring them to run the code themselves... 11 |

12 |
13 |
14 | Intro to Jupyter 15 | 16 | 17 |

18 | A Jupyter notebook is a file that stores 19 | commentary, code, and output in an all-in-one format suitable for 20 | sharing with other people. 21 |

22 |
23 |
24 |

25 | Jupyter is a popular open-source tool used in 26 | data science, scientific computing, and computational journalism. 27 | GitHub provides a Codespace ready for running Jupyter notebooks 28 | out of the box: 29 | . 30 |

31 |
32 |
33 | GitHub's Jupyter Codespace 34 |

35 | Let's begin by going to 36 | 37 | github/codespaces-jupyter 38 | directly. Before we dive into editing a notebook ourselves, 39 | we can first browse the notebooks directory on 40 | the repository page. We see three files, each with the 41 | extension *.ipynb 42 | (short for IPYthon NoteBook, 43 | Jupyter's original name). 44 |

45 |

46 | Clicking on each file, you'll note that while there's code, 47 | most of the file is actually narrative and visualization. 48 | That's the appeal of Jupyter for many people: it's about 49 | communicating stories, not just data or software. 50 |

51 |

52 | Additionally, you'll see a data directory, which 53 | includes a *.csv Comma Separated 54 | Values spreadsheet. This file can be read into a 55 | notebook for analysis. 56 |

57 |

58 | Now, let's follow the instructions of the repository's 59 | README file (). As of writing, 60 | it recommends to just use the Code button to open 61 | a Codespace, without needing to fork () 62 | the repository. This allows you to try out the Codespace 63 | without saving your work long-term, but you can still create a fork 64 | with your changes later if you decide to. 65 |

66 |
67 |
68 | Kernels 69 |

70 | At the core of any Jupyter notebook is its kernel. 71 |

72 | 73 | 74 |

75 | The kernel of a Jupyter notebook is a process that wires up 76 | a notebook to a particular programming language. 77 |

78 |
79 |
80 |

81 | Kernels for several different programming languages exist. We will use 82 | a Python kernel in this book, not least of which because it's one of the 83 | most commonly used kernels, and the kernel that's already set up for use 84 | with the GitHub Jupyter Codespace repo. 85 |

86 |

87 | In your Codespace, use the Select kernel button, to choose 88 | a Python environment. You should be able to select the default 89 | global environment without needing to create a new one. Your notebook 90 | is ready once you see Python 3.x.y (for some values of x,y) 91 | in the upper-right corner of the notebook. 92 |

93 |
94 |
95 | Cells 96 |

97 | A notebook is composed of many consecutive parts, known as cells. 98 |

99 | 100 | 101 |

102 | A cell of a notebook encapsulates either 103 | commentary/documentation (as a Markdown cell) or 104 | code (as a Code cell). Cells can be rearranged, 105 | inserted, cut, pasted, and so on. 106 |

107 |
108 |
109 |

110 | Each Markdown cell uses, well, Markdown () 111 | to describe content that should be displayed to the reader, similar 112 | to a README file in your repository. 113 |

114 |

115 | But it's the Code cells that set a notebook apart. Each Code cell 116 | in a notebook is run consecutively, with the result of the final 117 | line of code being displayed for the reader. Importantly, these 118 | outputs are saved to the notebook itself, meaning that by sharing 119 | the notebook with a colleague, they can see the output of your 120 | code without running it themselves! This is not only convenient, 121 | but it's essential when communicating the result of code that 122 | uses software your reader does not have installed themselves. 123 | Likewise, it allows for showing the results of code via a web 124 | browser, such as at 125 | this link. 126 |

127 |
128 |
129 | A sample notebook 130 |

131 | I've provided a 132 | sample notebook 133 | that you can upload to your Codespace to experiment with. 134 |

135 |
136 |
137 | Handling big datasets 138 |

139 | A (possible) disadvantage of using Codespaces compared to your 140 | own computer is that all processing happens in the cloud, so 141 | you're limited by the resources made available to you by 142 | GitHub. But describes 143 | how to beef up your Codespace with more resources, should you 144 | need to crunch a particularly large dataset. 145 |

146 |
147 |
148 | Using R with Jupyter 149 |

150 | To use R instead of Python with your Jupyter notebook, 151 | a custom dev container () 152 | configured for R notebooks is available at 153 | . 154 |

155 |
156 |
-------------------------------------------------------------------------------- /source/ch-manim.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | Manim 4 | 5 |

6 | This chapter is co-authored by Tien Chih. 7 |

8 |
9 |
10 | What Is Manim? 11 |

12 | Manim stands for Math Animation. 13 | The Community Manim Python package is a 14 | publically maintained, open-source commmunity version of a custom 15 | Python package initially created by Grant Sanderson, more commonly known as 16 | 3Blue1Brown. 17 |

    18 |
  • 19 |

    20 | https://www.3blue1brown.com/ 21 |

    22 |
  • 23 |
  • 24 |

    25 | https://www.youtube.com/c/3blue1brown 26 |

    27 |
  • 28 |
29 |

30 |

31 | Manim provides tools that can bring mathematical ideas and concepts to life that 32 | static words and explanations may not capture. As an example, the 33 | TBIL.org Calculus I video series 34 | 35 | at this YouTube playlist 36 | 37 | was animated entirely by Tien Chih using Manim. 38 |

39 |
40 | 41 |
42 | Creating a Manim Codespace 43 | 44 |

45 | A turn-key repository for creating a Codespace 46 | () for Manim is available at 47 | 48 | StevenClontz/manim-workshop 49 | . Follow the instructions there to obtain an interface 50 | for authoring Manim content using just your web browser 51 | (Chrome/Edge/Firefox recommended). 52 |

53 |
54 | 55 |
56 | Hello World! 57 | 58 |

59 | Let's run our very first Manim animation. 60 |

61 |
62 | 63 | 64 |

65 | Open main.py and look for the line 66 | class HelloWorld(Scene):. 67 |

68 |
69 | 70 | 71 |

72 | Open a Terminal and execute the command 73 | manim render -ql main.py HelloWorld. 74 | (See the README file for other options 75 | to render Manim scenes.) 76 |

77 |
78 |
79 | 80 | 81 |

82 | Open the file 83 | media/videos/main/480p15/HelloWorld.mp4 84 | to view your newly rendered video. 85 |

86 |
87 |
88 | 89 | 90 |

91 | See if you can add these lines to the code so 92 | the video ends by saying My name is YOUR NAME HERE. 93 |

    94 |
  • 95 |

    96 | name = MathTex(r"\text{My name is YOUR NAME HERE.}") 97 |

    98 |
  • 99 |
  • 100 |

    101 | self.play(Transform(hello, name)) 102 |

    103 |
  • 104 |
105 | Don't forget to re-run 106 | manim render -ql main.py HelloWorld 107 | to update your rendered video. 108 |

109 |
110 |
111 | 112 | 113 |

114 | See if you can make the circle GREEN instead 115 | of PINK. 116 |

117 |
118 |
119 |
120 |
121 | 122 | 123 | 124 |
125 | More Animations 126 | 127 | 128 | 129 |

130 | Open main.py and look for the line 131 | class TanLine(Scene):. 132 |

133 |

134 | Review the comments and the code within this block. 135 | This particular scene TanLine creates a curve, displays 136 | the algebraic work needed to find a tangent line, and then displays 137 | said tangent line. 138 |

139 | 140 |
141 | 142 | 143 | 144 |

145 | Run manim render -ql main.py TanLine 146 | to produce a video file at 147 | media/videos/main/480p15/TanLine.mp4. 148 |

149 |
150 |
151 | 152 | 153 | 154 |

155 | Edit the code to find and display the line tangent 156 | to the curve when x=2. 157 |

158 |
159 |
160 | 161 | 162 | 163 |

164 | Change the window so that x ranges from 165 | 0 to 10. 166 |

167 |
168 |
169 | 170 | 171 | 172 |

173 | Choose a function f and x value of your 174 | choice, and edit the code to find 175 | and display the line tangent to y=f(x) at your 176 | chosen x value. 177 |

178 |
179 |
180 | 181 |
182 | 183 | 184 |

185 | The web-based Desmos 186 | tool can be very helpful 187 | in determining appropriate window sizes and scaling. 188 |

189 |
190 | 191 | 192 | 193 | 194 |

195 | Open main.py and look for the line 196 | class SinChange(Scene):. 197 |

198 |

199 | This particular block of code plots a transformed sine function 200 | of the form y=a\sin(bx)+c. Where initially 201 | a=1, b=1, c=0. We then adjust the values for a, b 202 | and c over time. 203 |

204 |
205 | 206 | 207 | 208 |

209 | Run the code to produce a video file. 210 |

211 |
212 |
213 | 214 | 215 | 216 |

217 | Edit the array a=[1,2, 2, 2, -1/3], and the rhs entries to adjust the vertical stretch. 218 |

219 |
220 |
221 | 222 | 223 | 224 |

225 | Edit the array b=[1,1, 1/2,1/2,-2], and the rhs entries to adjust the horizontal stretch. 226 |

227 |
228 |
229 | 230 | 231 | 232 |

233 | Edit the array c=[0,0, 0, -3, 2], and the rhs entries to adjust the vertical shift. 234 |

235 |
236 |
237 | 238 | 239 | 240 |
241 | 242 | 243 | 244 | 245 |

246 | Open main.py and look for the lines 247 | class FindProduct(Scene):, 248 | class FindQuotient(Scene):, and 249 | class FindPower(Scene):. 250 |

251 |

252 | The scene FindProduct displays a product rule computation, 253 | FindQuotient displays a quotient rule computation, 254 | and FindPower displays a faux-quotient rule computation 255 | using powers. 256 |

257 |
258 | 259 |

260 | Run the function FindProduct to produce a video file. 261 |

262 |
263 | 264 | 265 |

266 | Pick your favorite product of functions and edit the code to 267 | produce the appropriate derivation. 268 |

269 |
270 | 271 | 272 |

273 | Copy and paste the FindProduct function and rename it 274 | FindChain. 275 |

276 |
277 | 278 | 279 |

280 | Edit this new command to display an animation for your favorite 281 | chain rule derivation. 282 |

283 |
284 | 285 |
286 | 287 | 288 | 289 |

290 | Open main.py and look for the line 291 | class Riemann(Scene):. 292 |

293 |

294 | This code displays a Riemann sum for a funcion, and displays the ongoing sum for 295 | R_n. 296 |

297 |
298 | 299 | 300 | 301 |

302 | Run the code to see the output. 303 |

304 |
305 |
306 | 307 | 308 | 309 | 310 |

311 | Change the function to a function of your choice. You may need to resize the window. 312 | Recall the identitites \sum_{i=1}^n i = \frac{n(n+1)}{2}, \sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6}, 313 | \sum_{i=1}^n i^3 = \left( \frac{n(n+1)}{2}\right)^2. 314 |

315 |
316 |
317 | 318 | 319 | 320 |
321 | 322 | 323 |
324 | 325 |
326 | Additional Resources: 327 | 328 |

329 | Here are a list of helpful links regarding Manim authoring: 330 |

    331 |
  • 332 |

    333 | 334 | https://docs.manim.community/en/stable/index.html. This is Tien's goto 335 | place for FAQ's, working examples etc.. 336 |

    337 |
  • 338 | 339 |
  • 340 |

    341 | 342 | https://www.youtube.com/watch?v=KsemDUSJeWk&list=PLwXCBkIf7xBODPeQxULagMeWSK4YtLYog. 343 | This is a video playlist of Calculus I material authored by Tien. 344 |

    345 |
  • 346 | 347 |
  • 348 |

    349 | https://www.youtube.com/@MathVisualProofs. 350 | This the youtube video channel Mathematical Visual Proofs 351 | by Dr. Tom Edgar, an expert on Manim. 352 |

    353 |
  • 354 | 355 |
  • 356 |

    357 | https://www.free-stock-music.com/. 358 | This is a website for royalty-free, Creative-Commons 359 | licensed stock music. 360 |

    361 |
  • 362 | 363 |
  • 364 |

    365 | https://discord.com/invite/bYCyhM9Kz2 366 | a Discord for Manim, people can help here and you can run Python code within the Discord. 367 |

    368 |
  • 369 |
370 |

371 |
372 | 373 |
374 | 375 | 376 |
377 | -------------------------------------------------------------------------------- /source/ch-projects.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | Math Projects Powered by GitHub 4 |
5 | PreTeXt authoring system 6 |

7 | PreTeXt 8 | is an authoring and publishing system for 9 | scholarly documents, especially in STEM disciplines. 10 | Works authored in PreTeXt can be converted to HTML, 11 | PDF, braille, and many other formats. This book was 12 | written in PreTeXt! 13 |

14 |

15 | PreTeXt is particularly well-suited for the creation of 16 | interactive and accessible Open Educational Resources in 17 | mathematics and computer science. Works authored in PreTeXt 18 | can be deployed to 19 | Runestone Academy, 20 | allowing students to log into their textbook and persist progress 21 | on exercises and activities. 22 |

23 |

24 | The 25 | PROSE Consortium 26 | forms the broader ecosystem serving open-source STEM open educational 27 | resources and offers regular drop-in meetings for community members 28 | to learn more about its products, which also include 29 | WeBWorK and 30 | Doenet. 31 |

32 |

33 | 34 | Getting Started with PreTeXt 35 | is a tutorial that uses GitHub Codespaces to get authors 36 | up and writing quickly, and helps them share their works on 37 | GitHub and GitHub Pages. 38 |

39 |
40 |
41 | 42 | <m>\pi</m>-Base Community Database of Topological Counterexamples 43 | 44 |

45 | To paraphrase Mary Ellen Rudin, topology is a dense forest of 46 | counterexamples, and a usable map of the forest is a fine thing.. 47 | The \pi-Base 48 | aims to serve as this atlas, turning the classic text 49 | Counterexamples 50 | in Topology into an open, living, and 51 | interactive database supported 52 | by a community of researchers, instructors, and students. 53 |

54 |

55 | To learn how to contribute to the \pi-Base, 56 | a tutorial 57 | is available to walk through the process of editing its data and 58 | previewing it in your own Codespace. 59 |

60 |
61 |
62 | Lean Theorem Prover 63 |

64 | The Lean theorem prover 65 | is an interactive proof assistant that allows mathematicians to formally 66 | verify their proofs by computer. 67 |

68 |

69 | The textbook 70 | 71 | Mathematics in Lean 72 | 73 | provides an excellent introduction to authoring in Lean, with GitHub 74 | Codespaces support. 75 |

76 |

77 | (For a more casual experience outside GitHub, the 78 | Lean game server has fun 79 | tutorials for both Peano axioms and naive set theory.) 80 |

81 |
82 |
83 | <c>code4math</c> 84 |

85 | In December 2023, the American Institute of Mathematics 86 | hosted a workshop of researchers to explore the future 87 | of sociotechnical infrastructure for mathematics. One outcome 88 | of this work was the establishment of 89 | , a community for mathematicians 90 | engaged in this work. 91 |

92 |
93 |
94 | PROSE Consortium 95 |

96 | The PROSE Consortium is a community of 97 | instructors, developers, and researchers focusd on open-source 98 | tools and resources for mathematics and computer science education. 99 | You can engage with this group by visiting their homepage at 100 | . 101 |

102 |
103 |
104 | -------------------------------------------------------------------------------- /source/ch-website.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | GitHub Pages 4 |
5 | Creating a Simple Webpage 6 |

7 | Having made your first repository in , and 8 | committed a few changes, you are now ready to share your work with the 9 | public. One way is to share a link to your repository at GitHub.com; 10 | as long as you made it a public repository, anyone can see your files. 11 |

12 |

13 | Another option is to use GitHub Pages to host 14 | a customizable website with your work. This can be done with 15 | any existing repository by manually authoring HTML files, so let's try it 16 | out with our existing example first. (Or, you can skip ahead 17 | to to create a portfolio website 18 | without using HTML.) 19 |

20 |

21 | Use GitHub.dev () 22 | to create three files in the root of a new or existing repository. 23 |

    24 |
  • 25 |

    26 | Create a file named .nojekyll 27 | (note the period at the start) but don't add any text to it. 28 | Simply creating this file will disable some advanced features 29 | of GitHub Pages we don't need right now. 30 |

    31 |
  • 32 |
  • 33 |

    34 | Create an index.html file. This book won't discuss in depth 35 | how to author HTML, as 36 | we'll learn how to author our website content in Markdown in the next 37 | section, but for now add the following content: 38 |

    39 | 40 | 41 | 42 | 43 | 44 |
  • 45 |
  • 46 |

    47 | Download 48 | git-branches.png 49 | (used for ) 50 | and upload it to GitHub.dev. 51 |

    52 |
  • 53 |
54 | You can alternatively use this 55 | ZIP file 56 | which has all three files created for you (be sure to unzip it 57 | first!). 58 |

59 |

60 | Commit this update to your repository using Source Control, 61 | and confirm you see the two new files on your GitHub.com repository 62 | webpage. 63 |

64 | 65 |

66 | To enable GitHub Pages, go to your repository Settings, and choose 67 | Pages from the sidebar. From there you can select to 68 | Deploy from a branch, using the main branch 69 | and the / (root) 70 | directory, and after a few moments your site will be enabled. 71 |

72 | 73 | Settings to deploy a web page. 74 |
75 |

76 |
77 |

78 | Once enabled, GitHub will provide a link to your public GitHub Pages 79 | website, hosted at GitHub.io. Click it and you'll see the 80 | content of your index.html file, which displays the image 81 | downloaded as git-branches.png. (It should look like 82 | this.) 83 |

84 | 85 |

86 | It's good to remember how to 87 | distinguish the three GitHub domains: 88 |

    89 |
  • 90 |

    91 | GitHub.com is where your repository lives. It can be public 92 | or private. 93 |

    94 |
  • 95 |
  • 96 |

    97 | GitHub.dev is where you can make changes to your repository 98 | through your web browser. This is private to you and you must commit 99 | and push your changes to the GitHub.com repository every so often. 100 | (See also .) 101 |

    102 |
  • 103 |
  • 104 |

    105 | GitHub.io is your public GitHub Pages website, which you can 106 | edit by updating your repository files. 107 |

    108 |
  • 109 |
110 |

111 |
112 |

113 | I recommend you add a link to your GitHub.io website from 114 | your GitHub.com repository page. 115 |

116 | 117 |

118 | On your repository page, you can edit the About sidebar 119 | to add useful information about your project. In particular, 120 | there's a checkbox to automatically 121 | display your GitHub.io link to make it easy 122 | for others (and yourself!) to find your GitHub Pages site. 123 |

124 |
125 |
126 |
127 | 128 | Using a Template 129 |

130 | While you can create a custom website by authoring HTML, it'd be 131 | great to not have to! There are several templates available for 132 | GitHub Pages that allow you to author your content in Markdown, 133 | as well as providing nice themes, automatic linking between different 134 | sections of your website, and so on. 135 |

136 | 142 | 169 | 170 | 171 |

172 | A template repository on GitHub provides other GitHub users 173 | the ability to easily obtain a shallow copy of the latest commit to the 174 | template, created as a new repository they control. 175 |

176 |
177 |
178 |

179 | This is meant for situations like a GitHub Pages website, where 180 | you probably don't care about every single change that was made to create the 181 | template you're using, and you don't plan on contributing any of your changes 182 | back to the original repository. Instead, 183 | you just want the latest working files so you can insert your own 184 | content and get it online. 185 |

186 |

187 | Visit 188 | 189 | this page 190 | 191 | and click Use this template, and Create a new repository. 192 | This creates a new repository you own on GitHub.com, and 193 | you can follow the instructions in 194 | to enable GitHub Pages. 195 |

196 | 197 | Use this template button. 198 |
199 | Once that's done, visit your new GitHub.io website to see the 200 | placeholder content of your new website 201 | (don't forget to add a link to your About sidebar, see 202 | ). 203 |

204 | 205 |

206 | Deploying to GitHub Pages can take some time, so visiting the 207 | Actions tab on your repository page will let you see how this 208 | process is progressing. You can also see the status of this process 209 | by looking for the following icon next to your commit message: 210 | an orange dot (in progress), a green checkmark 211 | (deployed), or a red X (failure). 212 |

213 |
214 | 215 | Actions tab on Github.com. 216 |
217 |
218 |
219 |
220 | Customizing Your Site 221 | 222 |

223 | Now that you have the template website hosted by GitHub Pages, you of course 224 | will want to customize it to yourself. For this book, I'll get you started by 225 | handling a few of the obvious first steps, assuming you're 226 | using the GitHub.dev service (). 227 |

228 |
229 | 230 | Configuration 231 |

232 | First things first, let's configure some basic elements of your site. 233 | These settings are found in /_config.yml. There are several 234 | pieces of this file you likely aren't interested in editing 235 | (nor do you need to know at this point what they do), but you should 236 | at least find the title: and description: lines 237 | and edit them with your own information. The same goes for the 238 | author: name: and author: bio: entries as well. 239 |

240 |

241 | To see that this worked, use Source Control to Commit and Push your 242 | edits. After a while () you should 243 | be able to refresh your website and see your updated title, name, etc. 244 | (In , we will learn how to 245 | preview our edits more quickly, and without needing to push them to a 246 | live website, provided we're comfortable using a Codespace as explored in 247 | .) You can repeat this process after each of the 248 | edits described below to see your results reflected on the live website. 249 |

250 |
251 | 252 | Photo 253 |

254 | Next, let's add your photo. A placeholder is available 255 | at /assets/images/bio-photo.jpg. You can drag your own JPG-format 256 | photo onto it in the File Explorer. Then you can delete the placeholder 257 | bio-photo.jpg and rename your photo to bio-photo.jpg. 258 |

259 |
260 | 261 | Pages 262 |

263 | By default you have five files in your /_pages/ directory. 264 | The 404.md file describes what visitors see when a page isn't found, 265 | and the three *-archive.md files can be used to customize 266 | pages that display certain blog posts. 267 |

268 |

269 | The about.md file describes the content of your About page. 270 | The top few lines () 271 | describe some metadata about the page. You can edit the 272 | permalink to change the web address that will be used for 273 | this page, and the title to change the title shown in the browser 274 | tab for this page. 275 |

276 | 277 | About page metadata 278 | 279 | 280 | --- 281 | permalink: /about/ 282 | title: "About" 283 | --- 284 | 285 | 286 | 287 |

288 | Below the metadata is Markdown source that can be edited to include 289 | whatever content you'd like to appear within the page. 290 |

291 |

292 | To create additional pages, copy-paste about.md to create new 293 | files in the /_pages/ directory, making sure to assign each 294 | page its own permalink. If you want these pages to appear in the navigation 295 | bar on top of your site, edit the /_data/navigation.yml configuration 296 | file to point to each permalink. 297 |

298 |

You can preview a compiled version of your markdown files (.md ) on the web, without having to run any commands. 299 | It is enough to open a markdown file and split the screen. 300 |

301 |
302 | 303 | Split screen to preview markdown file. 304 |
305 |
306 | 307 | Posts 308 |

309 | Posts are similar to pages, and live in the /_posts/ directory. 310 | To create a new post, copy-paste any of the existing post files and 311 | rename it into the form YYYY-MM-DD-my-new-post.md (where 312 | YYYY-MM-DD is the date you want associated with the post). 313 |

314 |

315 | The content of your post is just Markdown, as with pages. However, 316 | you have slightly different metadata to edit (). 317 | In the date you can set the specific time of day you want your 318 | post to be associated with. You can also choose to assign each post 319 | categories and tags, which allow your posts to be sorted 320 | into appropriate category and tag pages, which are generated automatically 321 | for you. 322 |

323 | 324 | Post metadata 325 | 326 | 327 | --- 328 | title: "Welcome to Jekyll!" 329 | date: 2019-04-18T15:34:30-04:00 330 | categories: 331 | - blog 332 | tags: 333 | - Jekyll 334 | - update 335 | --- 336 | 337 | 338 | 339 |
340 |
341 |
342 | Previewing GitHub Pages 343 |

344 | Another useful application of Codespaces is the ability 345 | to preview your GitHub Pages site created in 346 | . Return to that repository 347 | on GitHub.com and create a new Codespace 348 | (). 349 |

350 |

351 | To spin up your live preview, open a terminal by using the 352 | shortcut noted in . To make 353 | sure the necessary software has been installed, type bundle 354 | and hit Enter. Then, you can enter jekyll serve 355 | to start the preview server. 356 |

357 |

358 | You'll see some output, and eventually 359 | Server address: http://127.0.0.1:4000. At that time an 360 | alert will appear that says Your application on port 4000 361 | is available. You can use its Open in browser button, 362 | or hover over the http://127.0.0.1:4000 link to be given 363 | the same option. 364 |

365 |

366 | This should open a URL such as 367 | random-words-123randomletters789-4000.app.github.dev, 368 | which will show a live preview of your GitHub Pages site in a new 369 | tab. As soon as you make edits in your Codespace tab, you can 370 | return to this tab to (within a second or two) see how your edits 371 | will update your live site. Note that this URL is private to you, 372 | and your public site won't be updated until you Commit & Sync 373 | your changes 374 | (). 375 |

376 |

377 | Personally, I use GitHub.dev (or even just the 378 | GitHub.com edit button) rather than a full 379 | Codespace when adding a quick post or making a quick edit on 380 | many of my GitHub Pages websites. But the Codespace option is very 381 | handy for when bigger changes are necessary, and you want to make 382 | sure everything looks just right before pushing it live to the public. 383 |

384 |
385 |
-------------------------------------------------------------------------------- /source/colophon.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | g4m.clontz.org 7 | 8 | 9 | 10 | 20232024 11 | Steven Clontz 12 | 13 | This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit CreativeCommons.org 14 | 15 | 16 |

17 | This work includes materials used under license from the 18 | following works: 19 |

20 |
    21 |
  • 22 |

    Wikipedia

    23 |
      24 |
    • 25 |

      26 |
    • 27 |
    • 28 |

      CC BY-SA 4.0

      29 |
    • 30 |
    31 |
  • 32 |
  • 33 |

    Git

    34 |
      35 |
    • 36 |

      37 |
    • 38 |
    • 39 |

      CC BY 3.0

      40 |
    • 41 |
    42 |
  • 43 |
44 |
-------------------------------------------------------------------------------- /source/frontmatter.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Steven Clontz 6 | Department of Mathematics and Statistics 7 | Univeristy of South Alabama 8 | 9 | 10 | Contributing Authors 11 | 12 | Tien Chih 13 | Natural Science and Mathematics 14 | Emory College at Oxford University 15 | 16 | 17 | Oscar Levin 18 | Mathematical Sciences 19 | University of Northern Colorado 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | Abstract 29 |

30 | Increasingly, the cyberinfrastructure of mathematics 31 | and mathematics education is built using GitHub to 32 | organize projects, courses, and their communities. 33 | The goal of this book is to help readers learn the basic features 34 | of GitHub available using only a web browser, and how 35 | to use these features to participate in GitHub-hosted 36 | mathematical projects with colleagues and/or students. 37 |

38 |
39 | 40 | 41 | 42 | 43 | 44 |
-------------------------------------------------------------------------------- /source/main.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | \newcommand{\R}{\mathbb R} 8 | 9 | 10 | \usepackage{tikz} 11 | 12 | 14 | 15 | 16 | 17 | GitHub for Mathematicians 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Backmatter 32 | 33 | 34 | 35 | Definitions and Notes Quick Ref 36 | 37 | 38 | 39 |

This book was authored in .

40 |
41 |
42 | 43 |
44 |
45 | -------------------------------------------------------------------------------- /source/pr-acknowledgements.ptx: -------------------------------------------------------------------------------- 1 | 2 | 3 | Acknowledgements 4 |

5 | Thanks to the following people who've contributed to this 6 | handbook. 7 |

    8 |
  • 9 |

    10 | The American Institute of Mathematics, 11 | for funding my travel to JMM 2024 and JMM 2025 to run 12 | professional enhancement programs 13 | based upon this handbook. 14 |

    15 |
  • 16 |
  • 17 |

    18 | Jeremy Avigad, for adding Codespaces support to his book 19 | Mathematics in Lean in time for JMM 2024. 20 |

    21 |
  • 22 |
  • 23 |

    24 | Francesca Gandini and Brandon Sisler, for co-organizing the 25 | JMM 2024 professional 26 | enrichment program that this book was written for originally. 27 |

    28 |
  • 29 |
  • 30 |

    31 | Tien Chih and Oscar Levin for contributing chapters on 32 | AI and Manim, repsectively. 33 |

    34 |
  • 35 |
36 |

37 |
--------------------------------------------------------------------------------