Skip to content

Commit

Permalink
Merge pull request #5 from daskol/typst/packages-release
Browse files Browse the repository at this point in the history
Submit `icml` and `neurips` templates to Typst template index
  • Loading branch information
daskol authored Mar 27, 2024
2 parents f2c4b26 + 41d34de commit 26106bb
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 47 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ conferences and journals during calendar year.
- [International Conference on Machine Learning (ICML)](icml).
- [Neural Information Processing System (NeurIPS)](neurips).

## Usage

You can use this template in the [Typst][2] WebApp by clicking _Start from
template_ on the dashboard and searching for a template (e.g. `lucky-icml`).

Alternatively, you can use the CLI to kick this project off using the command

```shell
typst init @preview/lucky-icml
```

## Utilities

Typst of version 0.10.0 does not produce colored annotations. In order to
Expand All @@ -39,3 +50,4 @@ repository. The script is plain and simple. One can use it as follows.
It is written with PyMuPDF library and inserts colored annotation.

[1]: https://portal.core.edu.au/conf-ranks/?search=A*&by=rank&source=CORE2023&sort=aacronym
[2]: https://typst.app/
41 changes: 38 additions & 3 deletions icml/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
# International Conference on Machine Learning (ICML) 2024
# International Conference on Machine Learning (ICML)

## Example Papers
## Usage

Here are an example paper in [LaTeX][1] and in [Typst][2].
You can use this template in the Typst web app by clicking _Start from
template_ on the dashboard and searching for `lucky-icml`.

Alternatively, you can use the CLI to kick this project off using the command

```shell
typst init @preview/lucky-icml
```

Typst will create a new directory with all the files needed to get you started.

## Configuration

This template exports the `icml2024` function with the following named
arguments.

- `title`: The paper's title as content.
- `authors`: An array of author dictionaries. Each of the author dictionaries
must have a name key and can have the keys department, organization,
location, and email.
- `abstract`: The content of a brief summary of the paper or none. Appears at
the top under the title.
- `bibliography`: The result of a call to the bibliography function or none.
The function also accepts a single, positional argument for the body of the
paper.
- `accepted`: If this is set to `false` then anonymized ready for submission
document is produced; `accepted: true` produces camera-redy version. If
the argument is set to `none` then preprint version is produced (can be
uploaded to arXiv).

The template will initialize your package with a sample call to the `icml2024`
function in a show rule. If you want to change an existing project to use this
template, you can add a show rule at the top of your file.

## Issues

This template is developed at [daskol/typst-templates][1] repo. Please report
all issues there.

### Running Title

1. Runing title should be 10pt above the main text. With top margin 1in it
Expand Down
63 changes: 32 additions & 31 deletions icml/icml2024.typ
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Workaround for the lack of an `std` scope.
#let std-bibliography = bibliography

// Metrical size of page body.
#let body = (
width: 6.75in,
Expand Down Expand Up @@ -300,8 +303,9 @@
keywords: (),
date: auto,
abstract: none,
bibliography-file: none,
bibliography: none,
header: none,
appendix: none,
accepted: false,
body,
) = {
Expand Down Expand Up @@ -530,50 +534,47 @@

v(0.2in)

columns(2, gutter: 0.25in)[
#set text(size: font.normal)
#show par: set block(spacing: 11pt)
columns(2, gutter: 0.25in, {
set text(size: font.normal)
show par: set block(spacing: 11pt)
// Render abstract.
// ICML instruction tels that font size of `Abstract` must equal to 11 but
// it does not like so.
#text(size: font.large)[
#align(center)[*Abstract*]
]
#pad(left: 2em, right: 2em, abstract)
#v(0.12in)
align(center, text(size: font.large, [*Abstract*]))
pad(left: 2em, right: 2em, abstract)
v(0.12in)

// Place contribution and notice at the bottom of the first column.
#place(bottom, float: true, clearance: 0.5em, {
place(bottom, float: true, clearance: 0.5em, {
set block(spacing: 0pt)
make-contribs()
})

// Display body.
#set text(size: font.normal)
#body
set text(size: font.normal)
body

// Display the bibliography, if any is given.
#if bibliography-file != none {
show bibliography: set text(size: font.normal)
bibliography(
bibliography-file,
style: "icml2024.csl",
title: "References",
)
if bibliography != none {
show std-bibliography: set text(size: font.normal)
set std-bibliography(title: "References", style: "icml2024.csl")
bibliography
}
]
})

pagebreak()
counter(heading).update(0)
counter("appendices").update(1)
set heading(
numbering: (..nums) => {
let vals = nums.pos()
let value = "ABCDEFGHIJ".at(vals.at(0) - 1)
return value + "." + nums.pos().slice(1).map(str).join(".")
}
)
include "appendix.typ"
if appendix != none {
pagebreak()
counter(heading).update(0)
counter("appendices").update(1)
set heading(
numbering: (..nums) => {
let vals = nums.pos()
let value = "ABCDEFGHIJ".at(vals.at(0) - 1)
return value + "." + nums.pos().slice(1).map(str).join(".")
}
)
appendix
}
}

// NOTE We provide table support based on tablex package. It does not
Expand Down
3 changes: 2 additions & 1 deletion icml/main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
Abstracts must be a single paragraph, ideally between 4–6 sentences long.
Gross violations will trigger corrections at the camera-ready phase.
],
bibliography-file: "main.bib",
bibliography: bibliography("main.bib"),
header: [Submission and Formatting Instructions for ICML 2024],
appendix: include "appendix.typ",
accepted: false,
)

Expand Down
43 changes: 39 additions & 4 deletions neurips/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
# Neural Information Processing Systems (NeurIPS) 2023
# Neural Information Processing Systems (NeurIPS)

## Example Papers
## Usage

Here are an example paper in [LaTeX][1] and in [Typst][2].
You can use this template in the Typst web app by clicking _Start from
template_ on the dashboard and searching for `bloated-neurips`.

Alternatively, you can use the CLI to kick this project off using the command

```shell
typst init @preview/bloated-neurips
```

Typst will create a new directory with all the files needed to get you started.

## Configuration

This template exports the `neurips2023` function with the following named
arguments.

- `title`: The paper's title as content.
- `authors`: An array of author dictionaries. Each of the author dictionaries
must have a name key and can have the keys department, organization,
location, and email.
- `abstract`: The content of a brief summary of the paper or none. Appears at
the top under the title.
- `bibliography`: The result of a call to the bibliography function or none.
The function also accepts a single, positional argument for the body of the
paper.
- `accepted`: If this is set to `false` then anonymized ready for submission
document is produced; `accepted: true` produces camera-redy version. If
the argument is set to `none` then preprint version is produced (can be
uploaded to arXiv).

The template will initialize your package with a sample call to the `neurips2023`
function in a show rule. If you want to change an existing project to use this
template, you can add a show rule at the top of your file.

## Issues

This template is developed at [daskol/typst-templates][1] repo. Please report
all issues there.

- The biggest and the most important issues is related to line ruler. We are
not aware of universal method for numbering lines in the main body of a
paper.
Expand Down Expand Up @@ -38,7 +73,7 @@ Here are an example paper in [LaTeX][1] and in [Typst][2].
example-paper.typst.pdf example-paper-colored.typst.pdf
```

See [README.md][3] for details.
See [README.md][1] for details.

- NeurIPS 2023 instructions discuss bibliography in vague terms. Namely, there
is not specific requirements. Thus we stick to `ieee` bibliography style
Expand Down
2 changes: 1 addition & 1 deletion neurips/main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
point size 12. Two line spaces precede the abstract. The abstract must be
limited to one paragraph.
],
bibliography-file: "main.bib",
bibliography: bibliography("main.bib"),
bibliography-opts: (title: none, full: true), // Only for example paper.
accepted: false,
)
Expand Down
15 changes: 8 additions & 7 deletions neurips/neurips2023.typ
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Workaround for the lack of an `std` scope.
#let std-bibliography = bibliography

// Metrical size of page body.
#let viewport = (
width: 5.5in,
Expand Down Expand Up @@ -247,7 +250,7 @@
keywords: (),
date: auto,
abstract: none,
bibliography-file: none,
bibliography: none,
bibliography-opts: (:),
accepted: false,
body,
Expand Down Expand Up @@ -448,7 +451,7 @@
body

// Display the bibliography, if any is given.
if bibliography-file != none {
if bibliography != none {
if "title" not in bibliography-opts {
bibliography-opts.title = "References"
}
Expand All @@ -457,11 +460,9 @@
}
// NOTE It is allowed to reduce font to 9pt (small) but there is not
// small font of size 9pt in original sty.
show bibliography: set text(size: font.small)
bibliography(
bibliography-file,
..bibliography-opts,
)
show std-bibliography: set text(size: font.small)
set std-bibliography(..bibliography-opts)
bibliography
}
}
}
Expand Down

0 comments on commit 26106bb

Please sign in to comment.