diff --git a/packages/preview/elsearticle/0.4.2/LICENSE b/packages/preview/elsearticle/0.4.2/LICENSE new file mode 100644 index 000000000..c5e04765b --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Mathieu Aucejo + +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/elsearticle/0.4.2/README.md b/packages/preview/elsearticle/0.4.2/README.md new file mode 100644 index 000000000..6447d0d52 --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/README.md @@ -0,0 +1,99 @@ +# Elsearticle template + +[![Generic badge](https://img.shields.io/badge/Version-0.4.2-cornflowerblue.svg)]() +[![MIT License](https://img.shields.io/badge/License-MIT-forestgreen)](https://github.com/maucejo/elsearticle/blob/main/LICENSE) +[![User Manual](https://img.shields.io/badge/doc-.pdf-mediumpurple)](https://github.com/maucejo/elsearticle/blob/main/docs/manual.pdf) + +`elsearticle` is a Typst template that aims to mimic the Elsevier article LaTeX class, a.k.a. `elsearticle.cls`, provided by Elsevier to format manuscript properly for submission to their journals. + +## Basic usage + +This section provides the minimal amount of information to get started with the template. For more detailed information, see the [manual](https://github.com/maucejo/elsearticle/blob/main/docs/manual.pdf). + +To use the `elsearticle` template, you need to include the following line at the beginning of your `typ` file: + +```typ +#import "@preview/elsearticle:0.4.2": * +``` + +### Initializing the template + +After importing `elsearticle`, you have to initialize the template by a show rule with the `#elsearticle()` command. This function takes an optional argument to specify the title of the document. + +* `title`: Title of the paper +* `author`: List of the authors of the paper +* `abstract`: Abstract of the paper +* `journal`: Name of the journal +* `keywords`: List of keywords of the paper +* `format`: Format of the paper. Possible values are `preprint`, `review`, `1p`, `3p`, `5p` +* `numcol`: Number of columns of the paper. Possible values are 1 and 2 +* `line-numbering`: Enable line numbering. Possible values are `true` and `false` + +## Additional features + +The `elsearticle` template provides additional features to help you format your document properly. + +### Appendix + +To activate the appendix environment, all you have to do is to place the following command in your document: +```typ +#show: appendix + +// Appendix content here +``` + +### Subfigures + +Subfigures are not built-in features of Typst, but the `elsearticle` template provides a way to handle them. It is based on the `subpar` package that allows you to create subfigures and properly reference them. + +```typ + #subfigure( + figure(image("image1.png"), caption: []), , + figure(image("image2.png"), caption: []), , + columns: (1fr, 1fr), + caption: [(a) Left image and (b) Right image], + label: + ) +``` + +### Equations + +The `elsearticle` template provides the `#nonumeq()` function to create unnmbered equations. The latter function can be used as follows: +```typ +#nonumeq[$ + y = f(x) + $ +] +``` + +## Roadmap + +*Article format* + +- [x] Preprint +- [x] Review +- [x] 1p +- [x] 3p +- [x] 5p + +*Environment* + +- [x] Implementation of the `appendix` environment + +*Figures and tables* + +- [x] Implementation of the `subfigure` environment + +*Equations* + +- [x] Proper referencing of equations w.r.t. the context +- [x] Use of the `equate` package to number each equation of a system as "(1a)" + +*Other features* + +- [x] Line numbering - Line numbering - Use the built-in `par.line` function available from Typst v0.12 + +## License +MIT licensed + +Copyright (C) 2024 Mathieu AUCEJO (maucejo) \ No newline at end of file diff --git a/packages/preview/elsearticle/0.4.2/docs/manual.pdf b/packages/preview/elsearticle/0.4.2/docs/manual.pdf new file mode 100644 index 000000000..1b42aca78 Binary files /dev/null and b/packages/preview/elsearticle/0.4.2/docs/manual.pdf differ diff --git a/packages/preview/elsearticle/0.4.2/docs/manual.typ b/packages/preview/elsearticle/0.4.2/docs/manual.typ new file mode 100644 index 000000000..46be7455b --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/docs/manual.typ @@ -0,0 +1,217 @@ +#import "@preview/mantys:0.1.4": * +#import "@preview/cheq:0.1.0": * + +#show: checklist.with(fill: eastern.lighten(95%), stroke: eastern, radius: .2em) + +#let TeX = style(styles => { + set text(font: "New Computer Modern") + let e = measure("E", styles) + let T = "T" + let E = text(1em, baseline: e.height * 0.31, "E") + let X = "X" + box(T + h(-0.15em) + E + h(-0.125em) + X) +}) + +#let LaTeX = style(styles => { + set text(font: "New Computer Modern") + let a-size = 0.66em + let l = measure("L", styles) + let a = measure(text(a-size, "A"), styles) + let L = "L" + let A = box(scale(x: 110%, text(a-size, baseline: a.height - l.height, "A"))) + box(L + h(-a.width * 0.67) + A + h(-a.width * 0.25) + TeX) +}) + +//------------------------------------------------------------------------------------- +#let abstract = [ + #package[Elsearticle] is a Typst template that aims to mimic the Elsevier article #LaTeX class, a.k.a. elsearticle.cls, provided by Elsevier to format manuscript properly for submission to their journals. +] + +#show: mantys.with( + name: "Elsearticle class for Typst", + version: "0.4.1", + date: datetime.today(), + license: "MIT", + authors: ("Mathieu Aucejo"), + abstract: abstract +) + += About + +#package[Elsearticle] is a Typst template that aims to mimic the Elsevier article #LaTeX class, a.k.a. elsearticle.cls, provided by Elsevier to format manuscript properly for submission to their journals. + +#package[Elsearticle] is designed to be as close as possible to the original class, whose specification can be found in the #link("http://assets.ctfassets.net/o78em1y1w4i4/3ro3yQff1q67JHmLi1sAqV/1348e3852f277867230fc4b84a801734/elsdoc-1.pdf")[#text("documentation", fill: eastern)]. The template is still in development and may not be fully compatible with all Elsevier journals. + +This manual provides an overview of the features of the #package[Elsearticle] template and how to use it. + + +#wbox[The template is provided as is by the Typst community and is not affiliated with Elsevier.] + += Usage + +== Using Elsearticle + +To use the #package[Elsearticle] template, you need to include the following line at the beginning of your `typ` file: +#codesnippet[```typ +#import "@preview/elsearticle:0.4.2": * +``` +] + +== Initializing the template + +After importing #package[Elsearticle], you have to initialize the template by a show rule with the #cmd[elsearticle] command. This function takes an optional argument to specify the title of the document. +#codesnippet[```typ +#show: elsearticle.with( + ... +) +``` +] + +#cmd[elsearticle] takes the following arguments: +#command("elsearticle", ..args( + title: none, + authors: (), + abstract: none, + journal: none, + keywords: none, + format: "preprint", + numcol: 1, + line-numbering: false, + [body]) +)[#argument("title", default: none, types: "string")[Title of the paper] + +#argument("authors", default: (), types: "array")[List of the authors of the paper + +Each element of the #dtype("array") is a #dtype("dict") definining an author. The author #dtype("dictionary") has the following keys: +- `name` #dtype("string"): Name of the author +- `affiliation` #dtype("string") (optional): Affiliation of the author +- `corr` #dtypes("string", none) (optional): email address of the corresponding author +- `id` #dtype("string") (optional): ID of the author + +#codesnippet[```typc +authors: ( + ( + name: "J. Doe", + affiliation: "Laboratory 1, University 1, City 1", + corr: "jdoe@univ.edu", + id: "a", + ), + ( + name: "J. Smith", + affiliation: "Laboratory 2, University 2, City 2", + id: "b" + ), + (name: "J. Dupont"), // J. Dupont is in the same laboratory as J. Doe + ) +```] +] + +#argument("abstract", default: none, types: "content")[Abstract of the paper] + +#argument("journal", default: none, types: "string")[Name of the journal] + +#argument("keywords", default: none, types: "array")[List of the keywords of the paper + +Each element of the #dtype("array") is a #dtype("string") representing a keyword + +#codesnippet[```typc +keywords: ("Keyword 1", "Keyword 2") +```] +] + +#argument("format", default: "review", types: "string")[Format of the paper. Possible values are "preprint", "review", "1p", "3p" and "5p" +] + +#argument("numcol", default: 1, types: "number")[Number of columns of the paper. Possible values are 1 and 2 + +#ibox[According to the documentation of `elsearticle.cls` (see #link("https://assets.ctfassets.net/o78em1y1w4i4/3ro3yQff1q67JHmLi1sAqV/1348e3852f277867230fc4b84a801734/elsdoc-1.pdf", "here")), the number of columns is related to the format of the paper: +- 1p: Single column only +- 3p: Single or double column possible +- 5p: Double column only + +To avoid unexpected behaviors, the value of the `numcol` argument is set to 1 by default and restricted to 1 or 2.] +] + +#argument("line-numbering", default: false, types: "bool")[Enable line numbering in the document] +] + +== Additional features + +The #package[Elsearticle] template provides additional features to help you format your document properly. + +=== Appendix + +The template allows you to create appendices using the #cmd["appendix"] environment. The appendices are then numbered with capital letters (A, B, C, etc.). Figures, tables and equations are numbered accordingly, e.g. Eq. (A.1). + +To activate the appendix environment, all you have to do is to place the following command in your document: +#codesnippet[ + ```typ + #show: appendix + + // Appendix content here + ``` +] + +=== Subfigures + +Subfigures are not built-in features of Typst, but the #package[Elsearticle] template provides a way to handle them. It is based on the #package[subpar] package that allows you to create subfigures and properly reference them. + +To create a subfigure, you can use the following syntax: + +#codesnippet[ + ```typc + #subfigure( + figure(image("image1.png"), caption: []), , + figure(image("image2.png"), caption: []), , + columns: (1fr, 1fr), + caption: [(a) Left image and (b) Right image], + label: + ) + ``` +] + +#ibox[The #cmd("subfigure") function is a wrapper around the #cmd[subpar.grid] function. The numbering is adapted to the context of the document (normal section or appendix).] + +=== Equations + +The equations are numbered with the format "(1)", "(2)" in normal sections and with the format "(A.1)", "(A.2)" in appendices. In addition to these numbering patterns, the #package[Elsearticle] template provides the #cmd("nonumeq") to create unnumbered equations. The latter function can be used as follows: + +#codesnippet[ + ```typ + #nonumeq[$ + y = f(x) + $ + ] + ``` +] + += Roadmap + +The #package[Elsearticle] template is still in development. Here are some of the features that are planned for future releases : + +*Article format* + +- [x] Preprint +- [x] Review +- [x] 1p +- [x] 3p +- [x] 5p + +*Environment* + +- [x] Implementation of the `appendix` environment + +*Figures and tables* + +- [x] Implementation of the `subfigure` environment +- [x] Proper referencing of figure, subfigures and tables w.r.t. the context +- [x] Recreation of the `link` to cross-reference figures, subfigures and tables + +*Equations* + +- [x] Proper referencing of equations w.r.t. the context +- [x] Use of the `equate` package to number each equation of a system as "(1a)" + +*Other features* + +- [x] Line numbering - Use the built-in `par.line` function available from Typst v0.12 \ No newline at end of file diff --git a/packages/preview/elsearticle/0.4.2/src/els-environment.typ b/packages/preview/elsearticle/0.4.2/src/els-environment.typ new file mode 100644 index 000000000..ded55902e --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/src/els-environment.typ @@ -0,0 +1,27 @@ +#import "els-globals.typ": * + +// Appendix +#let appendix(body) = { + set heading(numbering: "A.1.", supplement: [Appendix]) + // Reset heading counter + counter(heading).update(0) + + // Equation numbering + let numbering-eq = (..n) => { + let h1 = counter(heading).get().first() + numbering("(A.1a)", h1, ..n) + } + set math.equation(numbering: numbering-eq) + + // Figure and Table numbering + let numbering-fig = n => { + let h1 = counter(heading).get().first() + numbering("A.1", h1, n) + } + show figure.where(kind: image): set figure(numbering: numbering-fig) + show figure.where(kind: table): set figure(numbering: numbering-fig) + + isappendix.update(true) + + body +} \ No newline at end of file diff --git a/packages/preview/elsearticle/0.4.2/src/els-globals.typ b/packages/preview/elsearticle/0.4.2/src/els-globals.typ new file mode 100644 index 000000000..c5eda3cb7 --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/src/els-globals.typ @@ -0,0 +1,25 @@ +#let font-size = ( + script: 7pt, + footnote: 8pt, + small: 10pt, + normal: 11pt, + author: 12pt, + title: 17pt, +) + +#let linespace = ( + preprint: 1em, + review: 1.5em, +) + +#let indent-size = 2em + +#let margins = ( + review: (left: 105pt, right: 105pt, top: 130pt, bottom: 130pt), + preprint: (left: 105pt, right: 105pt, top: 130pt, bottom: 130pt), + one_p: (left: 105pt, right: 105pt, top: 140pt, bottom: 140pt), + three_p: (left: 64pt, right: 64pt, top: 110pt, bottom: 110pt), + five_p: (left: 37pt, right: 37pt, top: 80pt, bottom: 80pt) +) + +#let isappendix = state("isappendix", false) \ No newline at end of file diff --git a/packages/preview/elsearticle/0.4.2/src/els-template-info.typ b/packages/preview/elsearticle/0.4.2/src/els-template-info.typ new file mode 100644 index 000000000..cabe5e1be --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/src/els-template-info.typ @@ -0,0 +1,90 @@ +#import "els-globals.typ": * +#import "els-utils.typ": * + +#let default-author = ( + name: none, + affiliation: none, + corr: none, + id: "a" +) + +#let template-info(title, abstract, authors, keywords, els-columns) = { + // Set authors and affiliation + let names = () + let names-meta = () + let affiliations = () + let coord = none + for author in authors { + let new-author = create-dict(default-author, author) + let auth = (box(new-author.name), super(new-author.id)) + if new-author.corr != none { + if els-columns == 1 { + coord = ("Corresponding author. E-mail address: ", new-author.corr).join() + } else { + coord = ([Corresponding author. #linebreak() #h(1.4em) E-mail address: ], new-author.corr).join() + } + + if new-author.id != none { + auth.push(super((",", text(baseline: -1.5pt, "*")).join())) + } else { + auth.push(super(text(baseline: -1.5pt, "*"))) + } + } + names.push(box(auth.join())) + names-meta.push(new-author.name) + + if new-author.affiliation == none { + continue + } + else { + affiliations.push((super(new-author.id), new-author.affiliation, v(font-size.script)).join()) + } + } + + let author-string = if authors.len() == 2 { + names.join(" and ") + } else { + names.join(", ", last: " and ") + } + + // Format title and affiliation + let els-authors = align(center,{ + par(leading: 0.75em, text(size: font-size.title, title)) + v(0pt) + text(size: font-size.author, author-string) + v(font-size.small) + par(leading: 1em, text(size: font-size.small, emph(affiliations.join()), top-edge: 0.5em)) + }) + + // Format the abstract + let els-abstract = if abstract != none { + line(length: 100%) + text(weight: "bold", [Abstract]) + v(1pt) + h(-indent-size); abstract + linebreak() + if keywords !=none { + let kw = () + for keyword in keywords{ + kw.push(keyword) + } + + let kw-string = if kw.len() > 1 { + kw.join(", ") + } else { + kw.first() + } + text((emph("Keywords: "), kw-string).join()) + } + line(length: 100%) + } + + let els-info = ( + els-authors: els-authors, + els-abstract: els-abstract, + coord: coord, + els-meta: names-meta + ) + + return els-info +} \ No newline at end of file diff --git a/packages/preview/elsearticle/0.4.2/src/els-utils.typ b/packages/preview/elsearticle/0.4.2/src/els-utils.typ new file mode 100644 index 000000000..9b8d420aa --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/src/els-utils.typ @@ -0,0 +1,34 @@ +#import "els-globals.typ": * +#import "@preview/subpar:0.1.1" + +// Subfigures +#let subfigure = { + subpar.grid.with( + numbering: n => if isappendix.get() {numbering("A.1", counter(heading).get().first(), n) + } else { + numbering("1", n) + }, + numbering-sub-ref: (m, n) => if isappendix.get() {numbering("A.1a", counter(heading).get().first(), m, n) + } else { + numbering("1a", m, n) + } + ) +} + +// Equations +#let nonumeq(body) = { + set math.equation(numbering: none) + body +} + +// Create a dictionary for authors +#let create-dict(default-dict, user-dict) = { + let new-dict = default-dict + for (key, value) in user-dict { + if key in default-dict.keys() { + new-dict.insert(key, value) + } + } + + return new-dict +} \ No newline at end of file diff --git a/packages/preview/elsearticle/0.4.2/src/elsearticle.typ b/packages/preview/elsearticle/0.4.2/src/elsearticle.typ new file mode 100644 index 000000000..41026febc --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/src/elsearticle.typ @@ -0,0 +1,156 @@ +// elsearticle.typ +// Author: Mathieu Aucejo +// Github: https://github.com/maucejo +// License: MIT +// Date : 11/2024 +#import "@preview/equate:0.2.1": * +#import "els-globals.typ": * +#import "els-environment.typ": * +#import "els-utils.typ": * +#import "els-template-info.typ": * + +#let elsearticle( + // The article's title. + title: none, + + // An array of authors. For each author you can specify a name, + // department, organization, location, and email. Everything but + // but the name is optional. + authors: (), + + // Your article's abstract. Can be omitted if you don't have one. + abstract: none, + + // Journal name + journal: none, + + // Keywords + keywords: none, + + // For integrating future formats (1p, 3p, 5p, final) + format: "review", + + // Number of columns + numcol: 1, + + // Line numbering + line-numbering: false, + + // The document's content. + body, +) = { + // Text + set text(size: font-size.normal, font: "New Computer Modern") + + // Conditional formatting + let els-linespace = if format == "review" {linespace.review} else {linespace.preprint} + + let els-margin = if format == "review" {margins.review} + else if format == "preprint" {margins.preprint} + else if format == "1p" {margins.one_p} + else if format == "3p" {margins.three_p} + else if format == "5p" {margins.five_p} + else {margins.review} + + let els-columns = if format == "1p" {1} + else if format == "5p" {2} + else {if numcol > 2 {2} else {if numcol <= 0 {1} else {numcol}}} + + // Heading + set heading(numbering: "1.") + + show heading: it => block(above: els-linespace, below: els-linespace)[ + #if it.numbering != none { + if it.level == 1 { + set par(leading: 0.75em, hanging-indent: 1.25em) + set text(font-size.normal) + numbering(it.numbering, ..counter(heading).at(it.location())) + text((" ", it.body).join()) + + // Update math counter at each new appendix + if isappendix.get() { + counter(math.equation).update(0) + counter(figure.where(kind: image)).update(0) + counter(figure.where(kind: table)).update(0) + } + } else { + set text(font-size.normal, weight: "regular", style: "italic") + numbering(it.numbering, ..counter(heading).at(it.location())) + text((" ", it.body).join()) + } + } else { + text(size: font-size.normal, it.body) + } + ] + + // Equations + show: equate.with(breakable: true, sub-numbering: true) + set math.equation(numbering: (..n) => numbering("(1a)", ..n) , supplement: [Eq.]) + + // Figures, subfigures, tables + show figure.where(kind: table): set figure.caption(position: top) + set ref(supplement: it => { + if it.func() == figure and it.kind == image { + "Fig." + } else { + it.supplement + } + }) + + // Page + let footer = context{ + let i = counter(page).at(here()).first() + if i == 1 { + set text(size: font-size.small) + if journal != none { + emph(("Preprint submitted to ", journal).join()) + } + h(1fr) + emph(datetime.today().display("[month repr:long] [day], [year]")) + } else {align(center)[#i]} + } + + set page( + paper: "a4", + numbering: "1", + margin: els-margin, + columns: els-columns, + // Set journal name and date + footer: footer + ) + + // Paragraph + let linenum = none + if line-numbering { + linenum = "1" + } + set par(justify: true, first-line-indent: indent-size, leading: els-linespace) + set par.line(numbering: linenum, numbering-scope: "page") + + // Define Template info + let els-info = template-info(title, abstract, authors, keywords, els-columns) + + // Set document metadata. + set document(title: title, author: els-info.els-meta) + + place( + top, + float: true, + scope: "parent", + [ + #els-info.els-authors + #els-info.els-abstract + ] + ) + // Corresponding author + hide(footnote(els-info.coord, numbering: "*")) + counter(footnote).update(0) + + // bibliography + set bibliography(title: "References") + show bibliography: set heading(numbering: none) + show bibliography: set text(size: font-size.normal) + + v(-2em) + body +} diff --git a/packages/preview/elsearticle/0.4.2/template/images/typst-logo.svg b/packages/preview/elsearticle/0.4.2/template/images/typst-logo.svg new file mode 100644 index 000000000..055a3aa9a --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/template/images/typst-logo.svg @@ -0,0 +1,227 @@ + + + + diff --git a/packages/preview/elsearticle/0.4.2/template/main.typ b/packages/preview/elsearticle/0.4.2/template/main.typ new file mode 100644 index 000000000..1ed0287cd --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/template/main.typ @@ -0,0 +1,154 @@ +#import "@preview/elsearticle:0.4.2": * + +#let abstract = lorem(100) + +#show: elsearticle.with( + title: "Title of the paper", + authors: ( + ( + name: "A. Author", + affiliation: "University A, City A, Country A", + corr: "a.author@univa.edu", + id: "a", + ), + ( + name: "B. Author", + affiliation: "University B, City B, Country B", + id: "b" + ), + (name: lorem(2)), + (name: lorem(3)), + (name: "A. Author"), + (name: "A. Author"), + ), + journal: "Name of the Journal", + abstract: abstract, + keywords: ("keyword 1", "keyword 2"), + format: "review", + // line-numbering: true, +) + += Introduction + +#lorem(100) + += Section 1 + +#lorem(50) + +== Subsection 1 + +#lorem(10) (see @eq1) @Aut10. + +$ +y = a x +b +$ +where ... + +$ + x = integral_0^x d x #\ + (u v)' = u' v + v' u # +$ + +@eqa is a simple integral, while @eqb is the derivative of a product of two functions. These equations are grouped in @eq2. + +== Features + +=== Table + +Below is @tab:tab1. + +#let tab1 = { + table( + columns: 3, + table.header( + [*Header 1*], + [*Header 2*], + [*Header 3*], + ), + [Row 1], [12.0], [92.1], + [Row 2], [16.6], [104], +) +} + +#figure( + tab1, + kind: table, + caption : [Example] +) + +=== Figures + +Below is @fig:logo. + +#figure( + image("images/typst-logo.svg", width: 50%), + caption : [Typst logo - Credit: \@fenjalien] +) + +=== Subfigures + +Below are @figa and @figb, which are part of @fig:typst. + +#subfigure( +figure(image("images/typst-logo.svg"), caption: []), , +figure(image("images/typst-logo.svg"), caption: []), , +columns: (1fr, 1fr), +caption: [(a) Left image and (b) Right image], +label: , +) + +#show: appendix + += Appendix A + +== Figures + +In @fig:app + +#figure( + image("images/typst-logo.svg", width: 50%), + caption : [Books cover] +) + +== Subfigures + +Below are @figa-app and @figb-app, which are part of @fig:typst-app. + +#subfigure( +figure(image("images/typst-logo.svg"), caption: []), , +figure(image("images/typst-logo.svg"), caption: []), , +columns: (1fr, 1fr), +caption: [(a) Left image and (b) Right image], +label: , +) + +== Tables + +In @tab:app + +#figure( + tab1, + kind: table, + caption : [Example] +) + +== Equations + +In @eq + +$ +y = f(x) +$ + +#nonumeq[$ + y = g(x) + $ +] + +$ +y = f(x) \ +y = g(x) +$ + +#bibliography("refs.bib") diff --git a/packages/preview/elsearticle/0.4.2/template/refs.bib b/packages/preview/elsearticle/0.4.2/template/refs.bib new file mode 100644 index 000000000..79be3a35a --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/template/refs.bib @@ -0,0 +1,9 @@ +% Encoding: UTF-8 +@Article{Aut10, + author = {A. Author}, + journal = {Journal of Typst}, + title = {How to make a template in Typst}, + year = {2024}, + pages = {1-10}, + volume = {25 (1)}, +} \ No newline at end of file diff --git a/packages/preview/elsearticle/0.4.2/thumbnails/main.png b/packages/preview/elsearticle/0.4.2/thumbnails/main.png new file mode 100644 index 000000000..1340a8e51 Binary files /dev/null and b/packages/preview/elsearticle/0.4.2/thumbnails/main.png differ diff --git a/packages/preview/elsearticle/0.4.2/typst.toml b/packages/preview/elsearticle/0.4.2/typst.toml new file mode 100644 index 000000000..e25efbfba --- /dev/null +++ b/packages/preview/elsearticle/0.4.2/typst.toml @@ -0,0 +1,14 @@ +[package] +name = "elsearticle" +version = "0.4.2" +authors = ["Mathieu Aucejo"] +license = "MIT" +description = "Conversion of the LaTeX elsearticle.cls" +entrypoint = "src/elsearticle.typ" +categories = ["report"] +repository = "https://github.com/maucejo/elsearticle" + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnails/main.png" \ No newline at end of file