Skip to content

Commit 4a2b814

Browse files
committed
Bump to v2.0.2
1 parent a285d99 commit 4a2b814

File tree

5 files changed

+26
-22
lines changed

5 files changed

+26
-22
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# elsearticle template
22

3-
[![Generic badge](https://img.shields.io/badge/Version-2.0.1-cornflowerblue.svg)]()
3+
[![Generic badge](https://img.shields.io/badge/Version-2.0.2-cornflowerblue.svg)]()
44
[![MIT License](https://img.shields.io/badge/License-MIT-forestgreen)](https://github.com/maucejo/elsearticle/blob/main/LICENSE)
55
[![User Manual](https://img.shields.io/badge/doc-.pdf-mediumpurple)](https://github.com/maucejo/elsearticle/blob/main/docs/manual.pdf)
66

@@ -13,7 +13,7 @@ This section provides the minimal amount of information to get started with the
1313
To use the `elsearticle` template, you need to include the following line at the beginning of your `typ` file:
1414

1515
```typ
16-
#import "@preview/elsearticle:2.0.1": *
16+
#import "@preview/elsearticle:2.0.2": *
1717
```
1818

1919
### Initializing the template

docs/manual.typ

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#show: mantys(
1313
name: "elsearticle.typ",
14-
version: "2.0.1",
14+
version: "2.0.2",
1515
authors: ("Mathieu Aucejo",),
1616

1717
license: "MIT",
@@ -46,7 +46,7 @@ To mimic the look and feel of the original elsarticle.cls, the following fonts m
4646

4747
To use the #package[elsearticle] template, you need to include the following line at the beginning of your `typ` file:
4848
#codesnippet[```typ
49-
#import "@preview/elsearticle:2.0.1": *
49+
#import "@preview/elsearticle:2.0.2": *
5050
```
5151
]
5252

@@ -109,9 +109,9 @@ After importing #package[elsearticle], you have to initialize the template by a
109109
```
110110
]
111111

112-
#info-alert[If the paper has only one author, `institutions`must be:
113-
- `("",)` in the `authors` #dtype(array) of #dtype(dictionary)
114-
- `("": [Institution name])` in the `institutions` #dtype(dictionary)
112+
#info-alert[If the paper has only one author, `institutions` must be:
113+
- `(" ",)` in the `authors` #dtype(array) of #dtype(dictionary)
114+
- `(" ": [Institution name])` in the `institutions` #dtype(dictionary)
115115
to conform with the Elsevier template requirements.
116116
]
117117
]

src/els-template-info.typ

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,27 @@
1111
#let make-author(author) = box({
1212
author.name
1313

14-
let auth-affiliation = if author.affiliations.at(0) == "" {
14+
let auth-affiliation = if author.at("affiliations", default: none) == none {
1515
none
1616
} else {
1717
author.affiliations.map((key) => {key})
1818
}
1919

20-
let auth-rest = if (author.at("corresponding", default: false) == true){
21-
(sym.ast,)
20+
let auth-rest
21+
let iscorr
22+
if author.at("corresponding", default: false) == true {
23+
auth-rest = (sym.ast,)
24+
iscorr = true
25+
} else {
26+
auth-rest = none
27+
iscorr = false
2228
}
2329

2430
sym.space.thin
2531
if auth-affiliation == none {
26-
super({
27-
auth-rest.join([ ])
28-
})
32+
if iscorr {super(sym.ast)}
2933
} else {
30-
super({
31-
(auth-affiliation + auth-rest).join([,])
32-
})
34+
super((auth-affiliation + auth-rest).join([,]))
3335
}
3436
})
3537

@@ -40,6 +42,9 @@
4042

4143
#let make-author-meta(authors) = {
4244
let names = ()
45+
46+
if authors.len() == 0 {return ()}
47+
4348
for author in authors {
4449
if type(author.name) == content {
4550
names.push(author.name.text)
@@ -63,9 +68,9 @@
6368
set text(size: 10pt)
6469
set par(leading: 0.5em,)
6570
if els-columns == 1 {
66-
[#h(1em);#super[#sym.ast]#h(0.1em);Corresponding author. E-mail address: #if (author.at("email", default: none)) != none {author.email} else {text("No email provided")}]
71+
[#h(1em);#super[#sym.ast]#h(0.1em);Corresponding author. E-mail address: #if (author.at("email", default: none)) != none {author.email} else {"No email provided"}]
6772
} else {
68-
[#h(1em);#super[#sym.ast]#h(0.1em);Corresponding author. #linebreak() #h(1.4em);E-mail address: #if (author.at("email", default: none)) != none {author.email} else {text("No email provided")}]
73+
[#h(1em);#super[#sym.ast]#h(0.1em);Corresponding author. #linebreak() #h(1.4em);E-mail address: #if (author.at("email", default: none)) != none {author.email} else {"No email provided"}]
6974
}
7075
}
7176
)
@@ -74,7 +79,7 @@
7479

7580
#let make-affiliation(key, value) = {
7681
super[#key]
77-
if key != "" {
82+
if key != " " {
7883
sym.space.thin
7984
}
8085
text(style:"italic", value)

template/main.typ

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// #import "@preview/elsearticle:2.0.1": *
2-
#import "../src/elsearticle.typ": *
1+
#import "@preview/elsearticle:2.0.2": *
32

43
#let abstract = lorem(250)
54

typst.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "elsearticle"
3-
version = "2.0.1"
3+
version = "2.0.2"
44
authors = ["Mathieu Aucejo"]
55
license = "MIT"
66
description = "Conversion of the LaTeX elsearticle.cls"

0 commit comments

Comments
 (0)