Initial commit

This commit is contained in:
andyeisenberg
2025-12-01 09:27:40 -05:00
committed by GitHub
commit a6bd475da4
8 changed files with 338 additions and 0 deletions
+85
View File
@@ -0,0 +1,85 @@
// This file was automatically generated with PreTeXt 2.32.0.
// If you modify this file, PreTeXt will no longer automatically update it.
//
//////////////////////////////////////////////////////////////
//
// This file provides configuration options so that a PreTeXt
// project can be edited and built using GitHub's Codespaces.
// It is recommended to keep this in your repository even if you
// do not use this feature, as it will allow other to explore
// your project easily.
// This file will be automatically generated by PreTeXt with the
// latest updates unless you remove the first comment line above.
//
///////////////////////////////////////////////////////////////
{
"image": "pretextbook/pretext-full:1.5", // uses latest image from https://hub.docker.com/r/PreTeXtBook/pretext-full/tags
// If you don't need sagemath, you can use a smaller base image. Comment out the line above and uncomment the line below to use a smaller image.
// "image": "pretextbook/pretext:1.5",
"features": {"ghcr.io/devcontainers/features/github-cli": {}},
// The pretext-full image above includes pretext, prefigure, and enough parts of latex and sagemath for most cases. Here we install additional dependencies.
"postCreateCommand": {
"install pandoc": "bash ./.devcontainer/installPandoc.sh",
"mark repo as safe": "git config --global --add safe.directory $(pwd)"
},
// Port forwarding
// ---------------
// This is needed by the CodeChat Server.
"forwardPorts": [
// The port used for a Thrift connection between the VSCode CodeChat
// extension and the CodeChat Server.
27376,
// The port used for an HTTP connection from the CodeChat Client to
// the CodeChat Server.
27377,
// The port used by a websocket connection between the CodeChat
// Server and the CodeChat Client.
27378
],
// See the [docs](https://containers.dev/implementors/json_reference/#port-attributes).
"portsAttributes": {
"27376": {
"label": "VSCode extension <-> CodeChat Server",
"requireLocalPort": true
},
"27377": {
"label": "CodeChat Client",
"requireLocalPort": true
},
"27378": {
"label": "CodeChat Client<->Server websocket",
"requireLocalPort": true
// 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.
}
},
// Configure tool-specific properties.
"customizations": {
"codespaces": {
"openFiles": ["README.md"]
},
"vscode": {
"settings": {
"editor.quickSuggestions": {
"other": "off"
},
"files.autoSave": "afterDelay",
"editor.snippetSuggestions": "bottom",
"xml.validation.enabled": true,
"redhat.telemetry.enabled": false,
"CodeChat.CodeChatServer.Command": "CodeChat_Server"
},
"extensions": [
"oscarlevin.pretext-tools",
"CodeChat.codechat",
"streetsidesoftware.code-spell-checker",
"alpinebuster.vscode-latex-table-editor",
"mathematic.vscode-pdf"
]
}
}
}
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# This file was automatically generated with PreTeXt 2.19.3.
# If you modify this file, PreTeXt will no longer automatically update it.
# We use TinyTeX (https://yihui.org/tinytex/)
wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh
tlmgr install adjustbox amscdx bold-extra braket bussproofs cancel carlisle cases chessfss circuitikz colortbl enumitem extpfeil fontawesome5 fontaxes gensymb imakeidx jknapltx kastrup lambda-lists listings listingsutf8 makeindex marvosym mathalpha mathtools menukeys mhchem microtype musicography newpx newtx nicematrix pdfcol pdfpages pdflscape pgfplots phaistos physics polyglossia pstricks realscripts relsize siunitx skak skaknew smartdiagram snapshot stmaryrd tcolorbox tikz-cd tikzfill titlesec txfonts ulem upquote was xfrac xltxtra xpatch xstring
tlmgr path add
# Ensure fonts provided by TinyTeX are available, as suggested in the pretext guide
fontconfig="<?xml version=\"1.0\"?>
<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">
<fontconfig>
<dir>~/.TinyTeX/texmf-dist/fonts</dir>
<dir>~/.TinyTeX/texmf-local/fonts</dir>
</fontconfig>"
fontconfig_path="/etc/fonts/conf.d/09-texlive-fonts.conf"
if [ ! -f "$fontconfig_path" ]; then
echo "Creating fontconfig file at $fontconfig_path"
echo "$fontconfig" | sudo tee "$fontconfig_path" > /dev/null
else
echo "Fontconfig file already exists at $fontconfig_path"
fi
# Update font cache
fc-cache -f -v
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# This file was automatically generated with PreTeXt 2.32.0.
# If you modify this file, PreTeXt will no longer automatically update it.
wget https://github.com/jgm/pandoc/releases/download/3.6.4/pandoc-3.6.4-1-amd64.deb -O pandoc.deb
# wait for 60 second and then double check that no other script is using apt-get:
sleep 60
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
echo "Waiting for apt-get to be free..."
sleep 15
done
# Install pandoc
sudo apt-get install -y --no-install-recommends ./pandoc.deb
rm pandoc.deb
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# This file was automatically generated with PreTeXt 2.19.3.
# If you modify this file, PreTeXt will no longer automatically update it.
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
python3-louis \
libcairo2-dev \
librsvg2-bin
pip install --upgrade pip --break-system-packages
pip install pretext[homepage,prefigure] pycairo --only-binary {greenlet} --break-system-packages
pip install codechat-server --break-system-packages
playwright install-deps
playwright install
# echo '/usr/lib/python3/dist-packages' > /usr/local/lib/python3.8/dist-packages/louis.pth
prefig init
# Install mermaid for diagrams
npm install -g @mermaid-js/mermaid-cli
echo "PreTeXt installation complete."
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# This file was automatically generated with PreTeXt 2.32.0.
# If you modify this file, PreTeXt will no longer automatically update it.
# Conda should already be installed in the codespace. We need to add the conda-forge channel
conda config --add channels conda-forge
conda config --set channel_priority strict
# We don't want conda to open the base environment always:
conda config --set auto_activate_base false
# Now create a conda environment for sage (called sage):
conda create --yes -n sage sage python=3.12
conda init
echo 'conda activate sage' >> ~/.bashrc
source ~/.bashrc