Skip to content

Commit

Permalink
complete ams template
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed May 1, 2023
1 parent 7dc2015 commit 6732083
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.pdf
.DS_Store

/.luarc.json
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ This repository provides Quarto custom formats for the core templates provided b

| Format | Usage |
|-------------------------|-----------------------------------------------|
| [Letter](https://github.com/quarto-ext/typst-templates/tree/main/letter) | `quarto use template quarto-ext/typst-templates/letter` |
| [IEEE](https://github.com/quarto-ext/typst-templates/tree/main/ieee) | `quarto use template quarto-ext/typst-templates/ieee` |
| [AMS](https://github.com/quarto-ext/typst-templates/tree/main/ams) | `quarto use template quarto-ext/typst-templates/ams` |
| [Letter](https://github.com/quarto-ext/typst-templates/tree/main/letter) | `quarto use template quarto-ext/typst-templates/letter` |
| [Fiction](https://github.com/quarto-ext/typst-templates/tree/main/fiction) | `quarto use template quarto-ext/typst-templates/fiction` |

These formats are published under the [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/) public domain license.
4 changes: 4 additions & 0 deletions ams/.quartoignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ams.png



43 changes: 36 additions & 7 deletions ams/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,46 @@
# Ams Format
# Typst AMS Format

## Installing
Based on the AMS template published by the Typst team at <https://typst/typst-templates/ams>.

**NOTE**: This format requires the pre-release version of Quarto v1.4, which you can download here: <https://quarto.org/docs/download/prerelease>.

_TODO_: Replace the `<github-organization>` with your GitHub organization.
## Installing

```bash
quarto use template <github-organization>/ams
quarto use template quarto-ext/typst-templates/ams
```

This will install the format extension and create an example qmd file
that you can use as a starting place for your document.
This will install the extension and create an example qmd file that you can use as a starting place for your document.

## Using

_TODO_: Describe how to use your format.
The example qmd demonstrates the document options supported by the IEE format (`title`, `authors`, `abstract`, `bibliography`, etc.). For example, your document options might look something like this:

```yaml
---
title: "Mathematical Theorems"
authors:
- name: Ralph Howard
email: "[email protected]"
url: "www.math.sc.edu/~howard"
affiliations:
- name: University of South Carolina
department: Department of Mathematics
city: Columbia
state: SC
postal-code: 29208
abstract: |
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur ex justo, pretium nec ante mattis, ultricies
ultricies magna. Duis neque nulla, feugiat a consectetur id,
fermentum a lorem. Vivamus sit amet est interdum, eleifend
libero in, rutrum lorem.
format:
ams-typst: default
bibliography: refs.bib
---
```

This document Would be rendered as:

![](ams.png)
4 changes: 4 additions & 0 deletions ams/_extensions/ams/_extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ contributes:
template-partials:
- typst-template.typ
- typst-show.typ
filters:
- ams.lua
# disable quarto refs div injection
cite-method: natbib

22 changes: 22 additions & 0 deletions ams/_extensions/ams/ams.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

function Div(el)
if el.classes:includes('ams-theorem') then
local args = ''
if el.attributes['numbered'] == "false" then
args = '(numbered: false)'
end
local blocks = pandoc.List({
pandoc.RawBlock('typst', '#theorem' .. args .. '[')
})
blocks:extend(el.content)
blocks:insert(pandoc.RawBlock('typst', ']\n'))
return blocks
elseif el.classes:includes('ams-proof') then
local blocks = pandoc.List({
pandoc.RawBlock('typst', '#proof[')
})
blocks:extend(el.content)
blocks:insert(pandoc.RawBlock('typst', ']\n'))
return blocks
end
end
Binary file added ams/ams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 15 additions & 44 deletions ams/template.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,31 @@ format:
bibliography: refs.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
## Introduction

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur et ornare urna, ornare malesuada ante. Aenean fringilla fermentum pulvinar. Integer maximus mauris id gravida eleifend. Donec et facilisis neque. @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.
Vestibulum massa nunc, pellentesque vitae velit vitae, porttitor efficitur nisl. Integer massa lacus, tristique a laoreet vitae, commodo sed odio. Phasellus eget metus tempus sem molestie iaculis.

## Mathematics

This formula is also referred to as the _binomial formula_ or the _binomial identity_. It can be written as:

$$
(x+y)^n = \sum_{k=0}^n {n \choose k}x^{n-k}y^k = \sum_{k=0}^n {n \choose k}x^{k}y^{n-k}
$$

::: {#thm-real-square}
## The square of any real number is non-negative

::: {.ams-theorem numbered="true"}
The square of any real number is non-negative.
:::

::: {.proof}
The proof
::: {.ams-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$.
:::

## Summary

## Introduction

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur et ornare urna, ornare malesuada ante. Aenean fringilla fermentum pulvinar. Integer maximus mauris id gravida eleifend. Donec et facilisis neque. Curabitur tempus non ante in facilisis. Pellentesque bibendum, est non luctus dapibus, nunc quam egestas est, non mollis purus turpis eget ante. Suspendisse vehicula ligula in ipsum interdum, ac dapibus magna aliquet. Sed ullamcorper dui ut condimentum commodo. Praesent risus nulla, rhoncus ac tortor id, feugiat ultricies enim. Aenean vitae commodo mauris, id ornare dolor. Nam sit amet dapibus quam, eget aliquet purus. Quisque et metus molestie, fringilla orci eget, lacinia lacus. Vestibulum semper iaculis volutpat. Donec porta tortor a ultricies suscipit. Suspendisse blandit cursus ante vitae hendrerit. Donec sit amet neque a nulla sagittis venenatis.

## Things that need to be done

Praesent vestibulum libero et diam pretium congue. In vitae est ac elit vehicula molestie semper a mauris. Nulla sodales, orci a semper sodales, magna magna aliquet nisl, iaculis pharetra felis magna at velit. Vestibulum ut eleifend metus. Duis et nunc nec risus fringilla ultricies. Donec sed pellentesque dolor. Nulla egestas scelerisque ex. Quisque aliquet tellus in pellentesque egestas. Sed efficitur neque ligula, nec tristique ante elementum a. Fusce laoreet justo diam, vitae consectetur odio elementum quis. Mauris id velit sed massa aliquam fermentum eget quis augue. Praesent vitae est vel leo venenatis dignissim. In quis lacus mauris. Pellentesque ultrices tortor nisi, pulvinar pretium sapien hendrerit quis.

## Background

Aenean sagittis, nisl et egestas facilisis, mauris erat pulvinar turpis, tincidunt maximus tellus erat in ligula. Phasellus vitae lacinia nisi. Aliquam aliquam feugiat lectus sed congue. Ut ut molestie lacus. Nam id felis aliquam, pulvinar erat eu, luctus ligula. Vestibulum quis metus accumsan, fringilla neque quis, lobortis leo. Maecenas id nisl condimentum, ultricies ante ac, laoreet magna. In eu tincidunt ipsum, id gravida diam. Integer congue lectus at lorem placerat, sed mattis odio sodales. Curabitur in sem euismod augue imperdiet vestibulum eu at ex. Aenean finibus vehicula congue. Duis vel ex varius, fringilla metus id, porta velit. Quisque finibus nec lorem id ultrices.

Donec auctor lectus nec tempor luctus. Morbi dapibus posuere quam, vel ultrices eros pellentesque in. Quisque id risus condimentum, aliquet orci ac, vehicula metus. Aenean posuere pulvinar nulla. Mauris sed finibus nisl. Aliquam vehicula lorem ac mauris aliquam auctor. Nam aliquet sapien blandit commodo elementum. In aliquet elit in elit lacinia, a aliquet elit euismod. Proin fermentum lectus tortor, nec iaculis augue blandit a. Aliquam libero turpis, laoreet quis tellus eget, accumsan consectetur libero. Sed elit libero, imperdiet id nulla a, maximus mollis odio. Vestibulum lacinia lectus quis eleifend rutrum. Donec at sagittis ex. Maecenas porttitor tempus purus eget euismod. Suspendisse eu urna eget ligula molestie facilisis. Nunc tincidunt urna eget varius eleifend.



Aenean sagittis, nisl et egestas facilisis, mauris erat pulvinar turpis, tincidunt maximus tellus erat in ligula. Phasellus vitae lacinia nisi. Aliquam aliquam feugiat lectus sed congue. Ut ut molestie lacus. Nam id felis aliquam, pulvinar erat eu, luctus ligula. Vestibulum quis metus accumsan.
2 changes: 1 addition & 1 deletion ieee/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This will install the extension and create an example qmd file that you can use

## Using

The example qmd demonstrates the document options supported by the IEE format (`title`, `author`, `abstract`, `index-terms`, etc.). For example, your document options might look something like this:
The example qmd demonstrates the document options supported by the IEE format (`title`, `authors`, `abstract`, `index-terms`, etc.). For example, your document options might look something like this:

```yaml
---
Expand Down

0 comments on commit 6732083

Please sign in to comment.