diff --git a/packages/preview/arkheion/0.1.1/README.md b/packages/preview/arkheion/0.1.1/README.md new file mode 100644 index 0000000000..5bd01266b0 --- /dev/null +++ b/packages/preview/arkheion/0.1.1/README.md @@ -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` - 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` - 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. diff --git a/packages/preview/arkheion/0.1.1/example.png b/packages/preview/arkheion/0.1.1/example.png new file mode 100644 index 0000000000..b71db0895b Binary files /dev/null and b/packages/preview/arkheion/0.1.1/example.png differ diff --git a/packages/preview/arkheion/0.1.1/orcid.svg b/packages/preview/arkheion/0.1.1/orcid.svg new file mode 100644 index 0000000000..8aec5959e5 --- /dev/null +++ b/packages/preview/arkheion/0.1.1/orcid.svg @@ -0,0 +1,21 @@ + + + + Orcid logo + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/preview/arkheion/0.1.1/template.typ b/packages/preview/arkheion/0.1.1/template.typ new file mode 100644 index 0000000000..620d859cd2 --- /dev/null +++ b/packages/preview/arkheion/0.1.1/template.typ @@ -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] +} diff --git a/packages/preview/arkheion/0.1.1/template/bibliography.bib b/packages/preview/arkheion/0.1.1/template/bibliography.bib new file mode 100644 index 0000000000..284bfc5ce7 --- /dev/null +++ b/packages/preview/arkheion/0.1.1/template/bibliography.bib @@ -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} +} \ No newline at end of file diff --git a/packages/preview/arkheion/0.1.1/template/image.png b/packages/preview/arkheion/0.1.1/template/image.png new file mode 100644 index 0000000000..cfc07b8155 Binary files /dev/null and b/packages/preview/arkheion/0.1.1/template/image.png differ diff --git a/packages/preview/arkheion/0.1.1/template/main.typ b/packages/preview/arkheion/0.1.1/template/main.typ new file mode 100644 index 0000000000..b050e37525 --- /dev/null +++ b/packages/preview/arkheion/0.1.1/template/main.typ @@ -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 +$ + +*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(, 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)] +) + +#figure( + image("image.png", width: 30%), + caption: [#lorem(7)] +)
+ +*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) + diff --git a/packages/preview/arkheion/0.1.1/typst.toml b/packages/preview/arkheion/0.1.1/typst.toml new file mode 100644 index 0000000000..aeec35bf74 --- /dev/null +++ b/packages/preview/arkheion/0.1.1/typst.toml @@ -0,0 +1,17 @@ +[package] +name = "arkheion" +version = "0.1.1" +entrypoint = "template.typ" +authors = ["Manuel Goulão"] +license = "MIT" +description = "A simple template reproducing popular arXiv templates." +repository = "https://github.com/mgoulao/arkheion" +keywords = ["arXiv", "NeurIPS", "computer science", "machine learning", "deep learning"] +categories = ["paper"] +disciplines = ["engineering", "computer-science"] +exclude = [] + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "example.png"