-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LaTeX Init v0.0.1 replay of precursor repo. (#858)
* REPLAY: Added the bare tex document with decoration * REPLAY: Update .gitignore * REPLAY: Parameterised Collatz equation * REPLAY: Collatz conjecture and unique cycle * REPLAY: Explain 4mod6 * REPLAY: The uniqueness of the cycle starting from 1 * REPLAY: Added subsections * REPLAY: Refined the discussion of the inverse collatz function * REPLAY: Added the 'minified versions' of the conjecture * REPLAY: Updated subsectioning * REPLAY: Residue classes and their equivalent partitioning * REPLAY: Explain 10 mod 12 * REPLAY: 4 mod 24 and 16 mod 24 and swapping to ordinals * REPLAY: DEFINED THE STEPPING FUNCTION 'M(w)' * REPLAY: Cleanup uniqueness of the cycle starting from 1 * REPLAY: WIP adding initial part of the preemptive values * REPLAY: Refine the initial requirement for determine the values the preempt descent * REPLAY: Add more description to preemptive descent and add notes for what to check next * REPLAY: Replace the previous setup with a simpler one * Update ignore * Add force to make clean, add words to devlog, add version on top of doctex * Readme and devlog * Workflow * sudo apt in the latex install * Try running make pdf in the pandoc latex container * use substack ubunut identifier * Add caution in devlog * Create the LaTeX palette * Uncomment the latex image in examples * Use hyperlinks, test different job container * Try hooking in to a locally defined action to run the make in an img that's installed the required apt packages * +x the entrypoint * Add make install to the container * Try uploading the built pdf * Add a build workflow
- Loading branch information
Showing
13 changed files
with
701 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
name: LaTeX 🟢🎶🐦 Test 🦂 Build 🧱 Release 🚰 and Publish 📦 | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'LaTeX/**' | ||
- '!LaTeX/**.md' | ||
- '!LaTeX/.vscode/**' | ||
- '.github/workflows/LaTeX-*' | ||
workflow_dispatch: | ||
permissions: {} | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: LaTeX | ||
jobs: | ||
context: | ||
name: GitHub 🐱👤 Context 📑 | ||
uses: ./.github/workflows/github-context.yaml | ||
# At the moment, the test just builds the pdf. So no need to run it twice. | ||
# test: | ||
# name: LaTeX 🟢🎶🐦 Test 🦂 | ||
# permissions: | ||
# actions: read | ||
# contents: read | ||
# security-events: write | ||
# uses: ./.github/workflows/LaTeX-test.yaml | ||
workflow-conditions: | ||
name: 🛑🛑🛑 Stop builds that didn't change the release version 🛑🛑🛑 | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version-file-changed: ${{ steps.version-file-check.outputs.version-file-changed }} | ||
version-tag-exists: ${{ steps.version-tag-exists.outputs.version-tag-exists }} | ||
steps: | ||
- name: 🏁 Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
fetch-depth: 2 | ||
- name: Check if version files changed | ||
id: version-file-check | ||
run: | | ||
export VERSION_FILE="LaTeX/document.tex" | ||
[ "$(git diff HEAD^1.. --name-only | grep -e "^$VERSION_FILE$")" == "$VERSION_FILE" ] && echo "version-file-changed=${{toJSON(true)}}" >> $GITHUB_OUTPUT || echo "version-file-changed=${{toJSON(false)}}" >> $GITHUB_OUTPUT | ||
- name: Notify on version-file-check | ||
run: echo "::Notice::version-file-changed is ${{ fromJSON(steps.version-file-check.outputs.version-file-changed) }}" | ||
- name: Check if version specified in version file has not released. | ||
id: version-tag-exists | ||
run: | | ||
git fetch --tags | ||
export VER=$(head -1 document.tex | cut -d ' ' -f 3) | ||
[ -z "$(git tag -l "LaTeX-v$VER")" ] && echo "version-tag-exists=${{toJSON(false)}}" >> $GITHUB_OUTPUT || echo "version-tag-exists=${{toJSON(true)}}" >> $GITHUB_OUTPUT | ||
- name: Notify on version-tag-exists | ||
run: echo "::Notice::version-tag-exists is ${{ fromJSON(steps.version-tag-exists.outputs.version-tag-exists) }}" | ||
# Now any step that should only run on the version change can use | ||
# "needs: [workflow-conditions]" Which will yield the condition checks below. | ||
# We want to "release" automatically if "version-file-changed" is true on push | ||
# Or manually if workflow_dispatch. BOTH need "version-tag-exists" is false. | ||
build: | ||
name: LaTeX 🟢🎶🐦 Build 🧱 | ||
needs: [workflow-conditions] # test | ||
if: >- | ||
${{ ((fromJSON(needs.workflow-conditions.outputs.version-file-changed) == true && github.event_name == 'push') || | ||
github.event_name == 'workflow_dispatch') && fromJSON(needs.workflow-conditions.outputs.version-tag-exists) == false }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🏁 Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: 📄 Docs | ||
uses: ./LaTeX/container | ||
with: | ||
make: pdf | ||
subdirectory: LaTeX | ||
- name: 🆙 Upload pdf | ||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | ||
with: | ||
name: pdf | ||
path: LaTeX/document.pdf | ||
if-no-files-found: error | ||
release: | ||
name: LaTeX 🟢🎶🐦 Release 🚰 | ||
needs: [build] | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🏁 Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: 🆒 Download dists | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: pdf | ||
path: LaTeX/artifact | ||
- name: 🚰 Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: >- | ||
export VER=$(head -1 document.tex | cut -d ' ' -f 3) && | ||
gh release create | ||
LaTeX-v$VER | ||
"artifact/document.pdf#PDF" | ||
--generate-notes | ||
-t "LaTeX: Version $VER" | ||
# publish: | ||
# name: LaTeX 🟢🎶🐦 Publish 📦 | ||
# needs: [release] | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: 🏁 Checkout | ||
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
# - name: 🆒 Download dists | ||
# uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
# with: | ||
# name: pdf | ||
# path: LaTeX/artifact | ||
# - ~ publish to arxiv | ||
# docs: | ||
# name: LaTeX 🟢🎶🐦 Docs 📄 | ||
# needs: [release, publish] | ||
# permissions: | ||
# contents: write | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: 🏁 Checkout | ||
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
# - ~ whatever setup is needed here | ||
# - name: 📄 Docs Generation | ||
# run: make docs | ||
# - name: 📄 Docs Publishing | ||
# run: |- | ||
# git config --local user.email "[email protected]" | ||
# git config --local user.name "Github Actions" | ||
# export SHORTSHA=$(git rev-parse --short HEAD) | ||
# git fetch origin gh-pages-LaTeX:gh-pages-LaTeX | ||
# git symbolic-ref HEAD refs/heads/gh-pages-LaTeX | ||
# cd .. && mv LaTeX/docs/build ../MERGE_TARGET | ||
# git rm -rf . && git clean -fxd && git reset | ||
# shopt -s dotglob && mkdir LaTeX && mv ../MERGE_TARGET/* LaTeX/ | ||
# git add . | ||
# git commit -m "Build based on $SHORTSHA" --allow-empty | ||
# git push --set-upstream origin gh-pages-LaTeX | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# docs-merge: | ||
# name: GitHub 🐱👤 Pages 📄 Merger 🧬 | ||
# needs: [docs] | ||
# permissions: | ||
# contents: write | ||
# pages: write | ||
# id-token: write | ||
# uses: ./.github/workflows/github-pages.yaml | ||
# with: | ||
# merge_from: 'gh-pages-LaTeX' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: LaTeX 🟢🎶🐦 Tests 🦂 | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'main' | ||
paths: | ||
- 'LaTeX/**' | ||
- '!LaTeX/**.md' | ||
- '!LaTeX/.vscode/**' | ||
- '.github/workflows/LaTeX-*' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'LaTeX/**' | ||
- '!LaTeX/**.md' | ||
- '!LaTeX/.vscode/**' | ||
- '.github/workflows/LaTeX-*' | ||
schedule: # 9AM on the 15th | ||
- cron: 0 22 14 1,2,3,10,11,12 * # AEDT Months | ||
- cron: 0 23 14 4,5,6,7,8,9 * # AEST Months | ||
workflow_call: | ||
permissions: {} | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: LaTeX | ||
jobs: | ||
pdf: | ||
name: LaTeX 🟢🎶🐦 PDF 📄 Quick Test 🦂 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🏁 Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: 📄 Docs | ||
uses: ./LaTeX/container | ||
with: | ||
make: pdf | ||
subdirectory: LaTeX | ||
- name: 🆙 Upload pdf | ||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | ||
with: | ||
name: pdf | ||
path: LaTeX/document.pdf | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
.PHONY: clean test | ||
.PHONY: clean pdf | ||
SHELL:=/bin/bash | ||
|
||
clean: | ||
rm -f *.aux | ||
rm -f *.log | ||
rm -f *.toc | ||
rm -f *.pdf | ||
|
||
.DEFAULT_GOAL := | ||
pdf: clean | ||
pdflatex document.tex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
# Collatz: LaTeX | ||
Functions related to the Collatz/Syracuse/3N+1 problem, notes written in LaTeX | ||
# [Collatz](https://github.com/Skenvy/Collatz): [LaTeX](https://github.com/Skenvy/Collatz/tree/main/LaTeX) 🟢🎶🐦 | ||
<p align="center"><img alt="Banner Image, Collatz Coral" src="https://raw.githubusercontent.com/wiki/Skenvy/Collatz/.meta/banners/modifications/_LaTeX.png" width=830 height=666/></p> | ||
<sub><p align="center"><i> | ||
<a href="https://github.com/Skenvy/Collatz/blob/main/.meta/banners/README.md">Colourised Collatz Coral</a>; derived from this | ||
<a href="https://twitter.com/Gelada/status/846751901756653568">original by Edmund Harriss</a> | ||
</i></p></sub> | ||
|
||
--- | ||
[The Collatz/Syracuse/3N+1 problem](https://en.wikipedia.org/wiki/Collatz_conjecture); notes written in [LaTeX](https://www.latex-project.org/). | ||
## Getting Started | ||
The most recent built PDFs should be accessible [in these "LaTeX" releases](https://github.com/Skenvy/Collatz/releases?q=LaTeX&expanded=true). | ||
<!-- | ||
I don't know if I'll ever make this high enough quality to consider putting it on | ||
https://arxiv.org/ but that's really the only place this section would be useful for.. | ||
[To install the latest from <package-site-name>](<package-website-specific>); | ||
```sh | ||
<installion-command> | ||
``` | ||
--> | ||
## Usage | ||
> [!WARNING] | ||
> These are not very well organised notes, reading them probably won't be a lot of fun. | ||
> The formatting isn't even good yet, and many sections are just stubs. | ||
> The writing of the notes is a TODO. | ||
> The current state is just the way that things were years ago when I started on this project. | ||
<!-- | ||
This would only be relevant if I was uploading the results to arxiv and added a landing page on this's gh-pages. | ||
## [LaTeX generated pdf](https://skenvy.github.io/Collatz/LaTeX) | ||
--> | ||
## Developing | ||
### The first time setup | ||
```sh | ||
git clone https://github.com/Skenvy/Collatz.git && cd Collatz/LaTeX && make pdf | ||
``` | ||
### Iterative development | ||
* `make pdf` to remake the pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ubuntu:24.04 | ||
SHELL ["/bin/bash", "-c"] | ||
RUN apt update && \ | ||
apt install -y texlive-latex-base && \ | ||
apt install -y texlive-latex-extra && \ | ||
apt install -y make | ||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Skenvy/Collatz internal action -- LaTeX build container' | ||
description: 'Skenvy/Collatz INTERNAL action -- Run a make recipe in a LaTeX build container' | ||
author: 'Nathan Levett' | ||
branding: | ||
icon: 'sunrise' | ||
color: 'purple' | ||
inputs: | ||
make: | ||
description: 'Makefile recipe name' | ||
required: true | ||
subdirectory: | ||
description: "The path to the folder/subdirectory containing the Makefile" | ||
required: false | ||
default: '.' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.make }} | ||
- ${{ inputs.subdirectory }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
cd "$INPUT_SUBDIRECTORY" | ||
make "$INPUT_MAKE" |
Oops, something went wrong.