Skip to content

Commit

Permalink
feat: init ams template
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas committed May 9, 2024
1 parent 8a2620a commit bce251a
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build

on:
workflow_dispatch:
push:
branches: ["main"]
tags: ["v*.*.*"]
pull_request:
branches: ["main"]

permissions:
contents: write

jobs:
build:
runs-on: macos-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v3

- name: 🧰 Download Typst
uses: robinraju/[email protected]
with:
repository: typst/typst
tag: v0.11.0
fileName: typst-x86_64-apple-darwin.tar.xz

- name: 🧰 Extract Typst
shell: bash
run: |
sudo mkdir /usr/local/typst
sudo tar -xzf typst-x86_64-apple-darwin.tar.xz -C /usr/local/typst/
rm -f typst-x86_64-apple-darwin.tar.xz
echo "/usr/local/typst/typst-x86_64-apple-darwin" >> $GITHUB_PATH
- name: 📘 Compile
shell: bash
run: ./build.sh

- name: 📦 Upload artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: src/*.pdf

- name: 🚀 Release
uses: softprops/action-gh-release@v1
if: github.ref_type == 'tag'
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
files: "src/*.pdf"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pdf
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# loop through all the files in the directory:
for file in src/*.typ
do
# run the compiler
typst compile --format=pdf "$file"
done
9 changes: 9 additions & 0 deletions src/fortuna.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@article{netwok2020,
title={At-scale impact of the {Net Wok}: A culinarically holistic investigation of distributed dumplings},
author={Astley, Rick and Morris, Linda},
journal={Armenian Journal of Proceedings},
volume={61},
pages={192--219},
year=2020,
publisher={Automatic Publishing Inc.}
}
93 changes: 93 additions & 0 deletions src/fortuna.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#import "@preview/unequivocal-ams:0.1.0": ams-article, theorem, proof

#show: ams-article.with(
title: [Mathematical Theorems],
authors: (
(
name: "Ralph Howard",
department: [Department of Mathematics],
organization: [University of South Carolina],
location: [Columbia, SC 29208],
email: "[email protected]",
url: "www.math.sc.edu/~howard"
),
),
abstract: lorem(100),
bibliography: bibliography("fortuna.bib"),
)

Call me Ishmael. Some years ago --- never mind how long precisely ---
having little or no money in my purse, and nothing particular to
interest me on shore, I thought I would sail about a little and see
the watery part of the world. It is a way I have of driving off the
spleen, and regulating the circulation. Whenever I find myself
growing grim about the mouth; whenever it is a damp, drizzly November
in my soul; whenever I find myself involuntarily pausing before coffin
warehouses, and bringing up the rear of every funeral I meet; and
especially whenever my hypos get such an upper hand of me, that it
requires a strong moral principle to prevent me from deliberately
stepping into the street, and methodically knocking people's hats off
--- then, I account it high time to get to sea as soon as I can. This
is my substitute for pistol and ball. With a philosophical flourish
Cato throws himself upon his sword; I quietly take to the ship. There
is nothing surprising in this. If they but knew it, almost all men in
their degree, some time or other, cherish very nearly the same
feelings towards the ocean with me. @netwok2020

There now is your insular city of the Manhattoes, belted round by
wharves as Indian isles by coral reefs - commerce surrounds it with
her surf. Right and left, the streets take you waterward. Its extreme
down-town is the battery, where that noble mole is washed by waves,
and cooled by breezes, which a few hours previous were out of sight of
land. Look at the crowds of water-gazers there.

Anyone caught using formulas such as $sqrt(x+y)=sqrt(x)+sqrt(y)$
or $1/(x+y) = 1/x + 1/y$ will fail.

The binomial theorem is
$ (x+y)^n=sum_(k=0)^n binom(n, k) x^k y^(n-k). $

A favorite sum of most mathematicians is
$ sum_(n=1)^oo 1/n^2 = pi^2 / 6. $

Likewise a popular integral is
$ integral_(-oo)^oo e^(-x^2) dif x = sqrt(pi) $

#theorem[
The square of any real number is non-negative.
]

#proof[
Any real number $x$ satisfies $x > 0$, $x = 0$, or $x < 0$. If $x = 0$,
then $x^2 = 0 >= 0$. If $x > 0$ then as a positive time a positive is
positive we have $x^2 = x x > 0$. If $x < 0$ then $−x > 0$ and so by
what we have just done $x^2 = (−x)^2 > 0$. So in all cases $x^2 ≥ 0$.
]

= Introduction
This is a new section.
You can use tables like @solids.

#figure(
table(
columns: (1fr, auto, auto),
inset: 5pt,
align: horizon,
[], [*Area*], [*Parameters*],
[*Cylinder*],
$ pi h (D^2 - d^2) / 4 $,
[$h$: height \
$D$: outer radius \
$d$: inner radius],
[*Tetrahedron*],
$ sqrt(2) / 12 a^3 $,
[$a$: edge length]
),
caption: "Solids",
) <solids>

== Things that need to be done
Prove theorems.

= Background
#lorem(40)

0 comments on commit bce251a

Please sign in to comment.