Skip to content

Commit

Permalink
add function to attach ORCID logo; more and better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
han190 committed Dec 25, 2024
1 parent 52905bc commit 4ac2d24
Show file tree
Hide file tree
Showing 3 changed files with 344 additions and 192 deletions.
66 changes: 50 additions & 16 deletions packages/preview/affiliation/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,61 @@
# typst-affiliation

An auto affiliation function for Typst. This library provides a single function, `get-authors`, which aims to do one thing well: extract affiliation information from a given dictionary and output two contents:
An auto affiliation function for Typst. This library provides a single function, `get-affiliations`, which aims to do one thing and (hopefully) do one thing well: extract authors' information from a given dictionary and output two contents:
1. Authors' names with superscripted affiliation indices and an email symbol if contact information is provided.
2. A list of sorted affiliations.

<!-- ## Example
![Example Output](assets/example-output.png) -->
![Example Output](assets/tests-light.png#gh-light-mode-only)
![Example Output](assets/tests-dark.png#gh-dark-mode-only) -->

## `get-affiliations`
Extracts and formats authors' names and affiliations. The function is highly customizable:

## `get-authors`
The function `get-authors` is highly customizable:
### Parameters
- `authors`: An array of strings or dictionaries containing authors' information.
- `authors-join` (default: ", "): Join script for authors.
- `authors-numbering` (default: "1"): Numbering style for the superscripted number after each author.
- `authors-func` (default: `default-authors-func`): Authors style function.
- `affil-label-numbering` (default: "1."): Numbering style for the index before each affiliation.
- `affil-label-style` (default: none): Affiliation label style.
- `affil-join` (default: ", "): Join script for affiliations.
- `affil-func` (default: `default-affil-func`): Affiliation style function.
- `email-symbol` (default: "🖂"): Email symbol.

### Returns
An array of two blocks: authors' block and affiliations' block.
- authors: array of strings or dictionaries
* An array containing authors' information. Each element can be a string (author's name) or a dictionary with detailed information.
- authors-join: string (default: ", ")
* The string used to join multiple authors' names.
- authors-join-2: string (default: " and ")
* The string used to join two authors' names.
- authors-func: function (default: default-authors-func)
* A function to style the authors' block.
- authors-numbering: string (default: "1")
* The numbering style for affiliation indices in authors.
- orcid-logo-size: length (default: 9.5pt)
* The size of the ORCID logo.
- email-symbol: string (default: "🖂")
* The symbol used to denote email addresses.
- authors-order: array (default: ("name", "orcid", "email", "affil-index"))
* The order of elements within each author box.
- name-style: function (default: x => x)
* A function to style the author's name.
- orcid-style: function (default: x => link(x, orcid-logo))
* A function to style the ORCID link.
- email-style: function (default: x => link(x, email-symbol))
* A function to style the email link.
- affil-indices-style: function (default: x => super(x))
* A function to style the affiliation indices.
- authors-box-join: string (default: " ")
* The string used to join elements within each author box.
- affil-label-numbering: string (default: "1.")
* The numbering style for affiliations.
- affil-label-style: function (default: x => super(x))
* A function to style the affiliation labels.
- affil-join: string (default: ", ")
* The string used to join multiple affiliations.
- affil-func: function (default: default-affil-func)
* A function to style the affiliations' block.
- affil-style: function (default: x => x)
* A function to style each affiliation.
- affil-box-join: string (default: " ")
* The string used to join elements within each affiliation box.
- affil-order: tuple (default: ("number", "affil"))
* The order of elements within each affiliation box.

### Return
- array of two blocks
* An array containing two blocks: the authors' block and the affiliations' block.

### Default functions
```typst
Expand Down
Loading

0 comments on commit 4ac2d24

Please sign in to comment.