Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions packages/preview/arkheion/0.1.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# arkheion

A Typst template based on popular LateX template used in arXiv and bio-arXiv. Inspired by [arxiv-style](https://github.com/kourgeorge/arxiv-style)

## Usage

**Import**

```
#import "@preview/arkheion:0.1.1": arkheion, arkheion-appendices
```

**Main body**

```
#show: arkheion.with(
title: "ArXiv Typst Template",
authors: (
(name: "Author 1", email: "user@domain.com", affiliation: "Company", orcid: "0000-0000-0000-0000"),
(name: "Author 2", email: "user@domain.com", affiliation: "Company"),
),
// Insert your abstract after the colon, wrapped in brackets.
// Example: `abstract: [This is my abstract...]`
abstract: lorem(55),
keywords: ("First keyword", "Second keyword", "etc."),
date: "May 16, 2023",
)
```

**Appendix**

```
#show: arkheion-appendices
=

== Appendix section

#lorem(100)

```

## API

### `arkheion.with`

- `title: String` - Title of the document.
- `authors: List<Author>` - List of authors.
```
Author: {
name: String,
email: String,
affiliation: String,
orcid: String
}
```
- `custom-authors: Content` - Custom authors content that overrides the default authors content.
Note: The `authors` is still required to be passed in order to generate the metadata, however, only the `name` field is required.
- `abstract: Content` - Abstract of the document.
- `keywords: List<String>` - List of keywords.
- `date: String` - Date of the document.

## License
The MIT License (MIT)

Copyright (c) 2023 Manuel Goulão

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file added packages/preview/arkheion/0.1.1/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions packages/preview/arkheion/0.1.1/orcid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
146 changes: 146 additions & 0 deletions packages/preview/arkheion/0.1.1/template.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#let arkheion(
title: "",
abstract: none,
keywords: (),
authors: (),
custom-authors: none,
date: none,
body,
) = {
// Set the document's basic properties.
set document(author: authors.map(a => a.name), title: title)
set page(
margin: (left: 25mm, right: 25mm, top: 25mm, bottom: 30mm),
numbering: "1",
number-align: center,
)
set text(font: "New Computer Modern", lang: "en")
show math.equation: set text(weight: 400)
show math.equation: set block(spacing: 0.65em)
set math.equation(numbering: "(1)")
set heading(numbering: "1.1")

// Set run-in subheadings, starting at level 4.
show heading: it => {
// H1 and H2
if it.level == 1 {
pad(
bottom: 10pt,
it
)
}
else if it.level == 2 {
pad(
bottom: 8pt,
it
)
}
else if it.level > 3 {
text(11pt, weight: "bold", it.body + " ")
} else {
it
}
}

line(length: 100%, stroke: 2pt)
// Title row.
pad(
bottom: 4pt,
top: 4pt,
align(center)[
#block(text(weight: 500, 1.75em, title))
#v(1em, weak: true)
]
)
line(length: 100%, stroke: 2pt)

// Author information.
if custom-authors != none {
custom-authors
} else {
pad(
top: 0.5em,
x: 2em,
grid(
columns: (1fr,) * calc.min(3, authors.len()),
gutter: 1em,
..authors.map(author => align(center)[
#if author.keys().contains("orcid") {
link("http://orcid.org/" + author.orcid)[
#pad(bottom: -8pt,
grid(
columns: (8pt, auto, 8pt),
rows: 10pt,
[],
[*#author.name*],
[
#pad(left: 4pt, top: -4pt, image("orcid.svg", width: 8pt))
]
)
)
]
} else {
grid(
columns: (auto),
rows: 2pt,
[*#author.name*],
)
}
#author.email \
#author.affiliation
]),
),
)
}

align(center)[#date]

// Abstract.
if abstract != none {
pad(
x: 3em,
top: 1em,
bottom: 0.4em,
align(center)[
#heading(
outlined: false,
numbering: none,
text(0.85em, smallcaps[Abstract]),
)
#set par(justify: true)
#set text(hyphenate: false)

#abstract
],
)
}

// Keywords
if keywords.len() > 0 {
[*_Keywords_* #h(0.3cm)] + keywords.map(str).join(" · ")
}
// Main body.
set par(justify: true)
set text(hyphenate: false)

body
}

#let arkheion-appendices(body) = {
counter(heading).update(0)
counter("appendices").update(1)

set heading(
numbering: (..nums) => {
let vals = nums.pos()
let value = "ABCDEFGHIJ".at(vals.at(0) - 1)
if vals.len() == 1 {
return "APPENDIX " + value
}
else {
return value + "." + nums.pos().slice(1).map(str).join(".")
}
}
);
[#pagebreak() #body]
}
14 changes: 14 additions & 0 deletions packages/preview/arkheion/0.1.1/template/bibliography.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@article{hinton2015distilling,
title = {Distilling the Knowledge in a Neural Network},
author = {Geoffrey E. Hinton and Oriol Vinyals and Jeffrey Dean},
journal = {ArXiv},
year = {2015},
volume = {abs/1503.02531}
}

@inproceedings{Vaswani2017AttentionIA,
title = {Attention is All you Need},
author = {Ashish Vaswani and Noam M. Shazeer and Niki Parmar and Jakob Uszkoreit and Llion Jones and Aidan N. Gomez and Lukasz Kaiser and Illia Polosukhin},
booktitle = {NIPS},
year = {2017}
}
Binary file added packages/preview/arkheion/0.1.1/template/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions packages/preview/arkheion/0.1.1/template/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#import "@preview/arkheion:0.1.1": arkheion, arkheion-appendices

#show: arkheion.with(
title: "Typst Template for arXiv",
authors: (
(name: "Author 1", email: "user@domain.com", affiliation: "Company", orcid: "0000-0000-0000-0000"),
(name: "Author 2", email: "user@domain.com", affiliation: "Company"),
),
// Insert your abstract after the colon, wrapped in brackets.
// Example: `abstract: [This is my abstract...]`
abstract: lorem(55),
keywords: ("First keyword", "Second keyword", "etc."),
date: "May 16, 2023",
)
#set cite(style: "chicago-author-date")
#show link: underline

= Introduction
#lorem(60)

= Heading: first level
#lorem(20)

== Heading: second level
#lorem(20)

=== Heading: third level

==== Paragraph
#lorem(20)

#lorem(20)

= Math

*Inline:* Let $a$, $b$, and $c$ be the side
lengths of right-angled triangle. Then, we know that: $a^2 + b^2 = c^2$

*Block without numbering:*

#math.equation(block: true, numbering: none, [
$
sum_(k=1)^n k = (n(n+1)) / 2
$
]
)

*Block with numbering:*

As shown in @equation.

$
sum_(k=1)^n k = (n(n+1)) / 2
$ <equation>

*More information:*
- #link("https://typst.app/docs/reference/math/equation/")


= Citation

You can use citations by using the `#cite` function with the key for the reference and adding a bibliography. Typst supports BibLateX and Hayagriva.

```typst
#bibliography("bibliography.bib")
```

Single citation @Vaswani2017AttentionIA. Multiple citations @Vaswani2017AttentionIA @hinton2015distilling. In text #cite(<Vaswani2017AttentionIA>, form: "prose")

*More information:*
- #link("https://typst.app/docs/reference/meta/bibliography/")
- #link("https://typst.app/docs/reference/meta/cite/")

= Figures and Tables


#figure(
table(
align: center,
columns: (auto, auto),
row-gutter: (2pt, auto),
stroke: 0.5pt,
inset: 5pt,
[header 1], [header 2],
[cell 1], [cell 2],
[cell 3], [cell 4],
),
caption: [#lorem(5)]
) <table>

#figure(
image("image.png", width: 30%),
caption: [#lorem(7)]
) <figure>

*More information*

- #link("https://typst.app/docs/reference/meta/figure/")
- #link("https://typst.app/docs/reference/layout/table/")

= Referencing

@figure #lorem(10), @table.

*More information:*

- #link("https://typst.app/docs/reference/meta/ref/")

= Lists

*Unordered list*

- #lorem(10)
- #lorem(8)

*Numbered list*

+ #lorem(10)
+ #lorem(8)
+ #lorem(12)

*More information:*
- #link("https://typst.app/docs/reference/layout/enum/")
- #link("https://typst.app/docs/reference/meta/cite/")


// Add bibliography and create Bibiliography section
#bibliography("bibliography.bib")

// Create appendix section
#show: arkheion-appendices
=

== Appendix section

#lorem(100)

Loading