├── data
├── defaults
│ ├── native.yaml
│ ├── html.yaml
│ ├── preprint.yaml
│ ├── cff.yaml
│ ├── crossref.yaml
│ ├── docx.yaml
│ ├── pdf.yaml
│ ├── tex.yaml
│ ├── jats.yaml
│ ├── shared.yaml
│ └── contextpdf.yaml
├── filters
│ ├── fix-bibentry-spacing.lua
│ ├── remove-references-heading.lua
│ ├── doi-batch-id.lua
│ ├── orcid-uri.lua
│ ├── context-numbered-equations.lua
│ ├── add-images.lua
│ ├── draft.lua
│ ├── parse-latex.lua
│ ├── flatten-references.lua
│ ├── inline-cited-references.lua
│ ├── time.lua
│ ├── prepare-affiliations.lua
│ ├── self-citation.lua
│ ├── normalize-metadata.lua
│ ├── normalize-author-names.lua
│ ├── resolve-references.lua
│ └── normalize
│ │ └── authors.lua
├── custom
│ ├── jats.lua
│ └── cff.lua
└── templates
│ ├── default.crossref
│ ├── default.context
│ ├── preprint.latex
│ └── default.latex
├── .dockerignore
├── .github
├── FUNDING.yml
└── workflows
│ ├── validate.yaml
│ ├── build.yaml
│ └── example-doc.yml
├── example
├── images
│ ├── sylt.jpg
│ ├── mandrill.jpg
│ └── nyan-cat.png
├── paper.bib
└── paper.md
├── resources
├── jose
│ ├── logo.png
│ └── defaults.yaml
├── joss
│ ├── logo.png
│ ├── aas-logo.png
│ ├── new-logo.png
│ ├── europar-logo.png
│ └── defaults.yaml
├── resciencec
│ ├── logo.png
│ └── defaults.yaml
└── default-article-info.yaml
├── fonts
└── libre-franklin
│ ├── LibreFranklin-Black.ttf
│ ├── LibreFranklin-Bold.ttf
│ ├── LibreFranklin-Light.ttf
│ ├── LibreFranklin-Thin.ttf
│ ├── LibreFranklin-Italic.ttf
│ ├── LibreFranklin-Medium.ttf
│ ├── LibreFranklin-Regular.ttf
│ ├── LibreFranklin-SemiBold.ttf
│ ├── LibreFranklin-BoldItalic.ttf
│ ├── LibreFranklin-ExtraBold.ttf
│ ├── LibreFranklin-ExtraLight.ttf
│ ├── LibreFranklin-ThinItalic.ttf
│ ├── LibreFranklin-BlackItalic.ttf
│ ├── LibreFranklin-LightItalic.ttf
│ ├── LibreFranklin-MediumItalic.ttf
│ ├── LibreFranklin-ExtraBoldItalic.ttf
│ ├── LibreFranklin-SemiBoldItalic.ttf
│ ├── LibreFranklin-ExtraLightItalic.ttf
│ ├── LibreFranklin-VariableFont_wght.ttf
│ ├── LibreFranklin-Italic-VariableFont_wght.ttf
│ └── OFL.txt
├── .gitignore
├── scripts
├── validate-jats.sh
└── entrypoint.sh
├── test
├── metadata.yaml
├── README.md
├── expected-draft
│ └── paper.crossref
└── expected-pub
│ └── paper.crossref
├── LICENSE
├── Dockerfile
├── CHANGELOG.md
├── docs
└── names.md
├── README.md
└── Makefile
/data/defaults/native.yaml:
--------------------------------------------------------------------------------
1 | to: native
2 |
3 | filters: []
4 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | .git
2 | .github
3 | publishing-artifacts
4 | example
5 | test
6 |
--------------------------------------------------------------------------------
/data/defaults/html.yaml:
--------------------------------------------------------------------------------
1 | to: html
2 | output-file: paper.html
3 | extract-media: media
4 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [numfocus]
2 | custom: http://numfocus.org/donate-to-open-journals
3 |
--------------------------------------------------------------------------------
/example/images/sylt.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/example/images/sylt.jpg
--------------------------------------------------------------------------------
/resources/jose/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/resources/jose/logo.png
--------------------------------------------------------------------------------
/resources/joss/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/resources/joss/logo.png
--------------------------------------------------------------------------------
/example/images/mandrill.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/example/images/mandrill.jpg
--------------------------------------------------------------------------------
/example/images/nyan-cat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/example/images/nyan-cat.png
--------------------------------------------------------------------------------
/resources/joss/aas-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/resources/joss/aas-logo.png
--------------------------------------------------------------------------------
/resources/joss/new-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/resources/joss/new-logo.png
--------------------------------------------------------------------------------
/resources/resciencec/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/resources/resciencec/logo.png
--------------------------------------------------------------------------------
/resources/joss/europar-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/resources/joss/europar-logo.png
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-Black.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-Bold.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-Light.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-Thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-Thin.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-Italic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-Medium.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-Regular.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-SemiBold.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-BoldItalic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-ExtraBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-ExtraBold.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-ExtraLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-ExtraLight.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-ThinItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-ThinItalic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-BlackItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-BlackItalic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-LightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-LightItalic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-MediumItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-MediumItalic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-ExtraBoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-ExtraBoldItalic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-SemiBoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-SemiBoldItalic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-ExtraLightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-ExtraLightItalic.ttf
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-VariableFont_wght.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-VariableFont_wght.ttf
--------------------------------------------------------------------------------
/data/defaults/preprint.yaml:
--------------------------------------------------------------------------------
1 | to: latex
2 | output-file: paper.preprint.tex
3 | template: preprint.latex
4 | variables:
5 | # styling options
6 | colorlinks: true
7 |
8 |
--------------------------------------------------------------------------------
/fonts/libre-franklin/LibreFranklin-Italic-VariableFont_wght.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openjournals/inara/HEAD/fonts/libre-franklin/LibreFranklin-Italic-VariableFont_wght.ttf
--------------------------------------------------------------------------------
/data/filters/fix-bibentry-spacing.lua:
--------------------------------------------------------------------------------
1 | function Div (div)
2 | if div.t == 'Div' and div.identifier == 'refs' then
3 | div.attributes['entry-spacing'] = '0.5'
4 | return div
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/data/filters/remove-references-heading.lua:
--------------------------------------------------------------------------------
1 | -- Remove heading of references section (to be used with JATS output)
2 | function Header (h)
3 | return h.identifier == 'references' and {} or nil
4 | end
5 |
--------------------------------------------------------------------------------
/data/filters/doi-batch-id.lua:
--------------------------------------------------------------------------------
1 | function Meta (meta)
2 | local timestamp = meta.timestamp or os.date('%Y%m%dT%H%M%S')
3 | meta.doi_batch_id = timestamp .. '-' ..
4 | pandoc.utils.sha1(pandoc.utils.stringify(meta.title))
5 | return meta
6 | end
7 |
--------------------------------------------------------------------------------
/data/filters/orcid-uri.lua:
--------------------------------------------------------------------------------
1 | -- Creates the ORCID numbers into a URI.
2 | function Meta (meta)
3 | for _, author in ipairs(meta.author or {}) do
4 | if type(author.orcid) == 'string' then
5 | author.orcid = 'https://orcid.org/' .. author.orcid
6 | end
7 | end
8 | return meta
9 | end
10 |
--------------------------------------------------------------------------------
/data/defaults/cff.yaml:
--------------------------------------------------------------------------------
1 | to: cff.lua
2 | output-file: CITATION.cff
3 |
4 | filters:
5 | - # Turn ORCID identifiers into proper URIs; this is the generic
6 | # representation required by the spec, but impractical to use with LaTeX. We
7 | # do it here for that reason.
8 | type: lua
9 | path: orcid-uri.lua
10 |
--------------------------------------------------------------------------------
/data/defaults/crossref.yaml:
--------------------------------------------------------------------------------
1 | columns: 10000
2 | to: html5
3 | output-file: paper.crossref
4 | html-math-method: mathjax
5 |
6 | filters:
7 | - type: lua
8 | path: doi-batch-id.lua
9 | - type: lua
10 | path: flatten-references.lua
11 | - type: lua
12 | path: prepare-affiliations.lua
13 |
14 | template: '${.}/../templates/default.crossref'
15 |
--------------------------------------------------------------------------------
/data/filters/context-numbered-equations.lua:
--------------------------------------------------------------------------------
1 | if not FORMAT:match 'context' then
2 | return {}
3 | end
4 |
5 | local numbered_formula = [=[
6 | \placeformula
7 | \startformula
8 | %s
9 | \stopformula
10 | ]=]
11 |
12 | function Span (span)
13 | local eq = span.content[1]
14 | if #span.content == 1 and eq.t == 'Math' and span.attributes.label then
15 | return pandoc.RawInline('context', numbered_formula:format(eq.text))
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/data/filters/add-images.lua:
--------------------------------------------------------------------------------
1 | local mediabag = require 'pandoc.mediabag'
2 |
3 | local function insert (filepath)
4 | local mt, contents = mediabag.fetch(filepath)
5 | mediabag.insert(filepath, mt, contents)
6 | end
7 |
8 | function Meta (meta)
9 | if meta.aas_logo_path then insert(meta.aas_logo_path) end
10 | if meta.europar_logo_path then insert(meta.europar_logo_path) end
11 | if meta.logo_path then insert(meta.logo_path) end
12 | end
13 |
--------------------------------------------------------------------------------
/data/defaults/docx.yaml:
--------------------------------------------------------------------------------
1 | to: docx
2 | output-file: paper.docx
3 |
4 | filters:
5 | - # Handle `\ref`, `\label`, and `\autoref` commands
6 | type: lua
7 | path: resolve-references.lua
8 |
9 | - # Most papers have a 'references' section at the end, which makes
10 | # sense for most output formats. However, as references are moved to
11 | # the back-matter in JATS, we remove that heading.
12 | type: lua
13 | path: remove-references-heading.lua
14 |
--------------------------------------------------------------------------------
/data/defaults/pdf.yaml:
--------------------------------------------------------------------------------
1 | to: latex
2 | pdf-engine: latexmk
3 | pdf-engine-opt: -lualatex
4 | output-file: paper.pdf
5 | filters:
6 | - type: lua
7 | path: add-images.lua
8 | - type: lua
9 | path: draft.lua
10 | - type: lua
11 | path: self-citation.lua
12 | - type: lua
13 | path: fix-bibentry-spacing.lua
14 | variables:
15 | # styling options
16 | colorlinks: true
17 | linkcolor: '[rgb]{0.0, 0.5, 1.0}'
18 | urlcolor: '[rgb]{0.0, 0.5, 1.0}'
19 |
20 |
--------------------------------------------------------------------------------
/data/defaults/tex.yaml:
--------------------------------------------------------------------------------
1 | to: latex
2 | # pdf-engine: latexmk
3 | # pdf-engine-opt: -lualatex
4 | output-file: paper.tex
5 | filters:
6 | - type: lua
7 | path: add-images.lua
8 | - type: lua
9 | path: draft.lua
10 | - type: lua
11 | path: self-citation.lua
12 | - type: lua
13 | path: fix-bibentry-spacing.lua
14 | variables:
15 | # styling options
16 | colorlinks: true
17 | linkcolor: '[rgb]{0.0, 0.5, 1.0}'
18 | urlcolor: '[rgb]{0.0, 0.5, 1.0}'
19 |
20 |
--------------------------------------------------------------------------------
/.github/workflows/validate.yaml:
--------------------------------------------------------------------------------
1 | name: JATS validation
2 |
3 | on:
4 | push:
5 | paths:
6 | - 'test/expected-paper.jats/paper.jats'
7 | pull_request:
8 | paths:
9 | - 'test/expected-paper.jats/paper.jats'
10 |
11 | jobs:
12 | build:
13 | name: Verify expected JATS
14 | runs-on: ubuntu-latest
15 |
16 | steps:
17 | - uses: actions/checkout@v4
18 |
19 | - name: Install XML validator
20 | run: |
21 | sudo apt install libxml2-utils
22 |
23 | - name: Test image
24 | run: |
25 | make validate-jats
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /publishing-artifacts
2 | /example/jats
3 | /example/paper.context.pdf
4 | /example/paper.pdf
5 | /example/paper.jats
6 | /example/paper.crossref
7 | /example/paper.preprint.tex
8 | example/paper.tex
9 |
10 | # JATS schema files
11 | /test/JATS-Publishing-1-2-MathML2-XSD.zip
12 | /test/JATS-journalpublishing1-elements.xsd
13 | /test/JATS-journalpublishing1.xsd
14 | /test/standard-modules
15 |
16 | # If you copy the resources into the base directory to
17 | # make the Makefile work, don't accidentally commit these
18 | apa.csl
19 | default-article-info.yaml
20 | footer.csl
21 | /joss
22 | /jose
23 | /resciencec
24 |
--------------------------------------------------------------------------------
/resources/default-article-info.yaml:
--------------------------------------------------------------------------------
1 | # If you change this, please keep it in sync with
2 | # data/filters/draft.lua
3 |
4 | metadata:
5 | archive_doi: 'DOI unavailable'
6 | editor_url: 'https://example.com'
7 | repository: 'NO_REPOSITORY'
8 | review_issue_url: 'N/A'
9 | citation_author: '¿citation_author?'
10 | editor_name: 'Pending Editor'
11 | issue: '¿ISSUE?'
12 | page: '¿PAGE?'
13 | published_at: 'unpublished'
14 | reviewers:
15 | - 'Pending Reviewers'
16 | submitted_at: '1970-01-01'
17 | volume: '¿VOL?'
18 | doi_batch_id: 'N/A'
19 | formatted_doi: 'DOI unavailable'
20 | paper_url: 'NO PAPER URL'
21 | draft: true
22 |
--------------------------------------------------------------------------------
/data/filters/draft.lua:
--------------------------------------------------------------------------------
1 | --- Removes and alters metadata for draft output
2 |
3 | --- If you change this, please keep it in sync with
4 | --- resources/default-article-info.yaml
5 | function Meta (meta)
6 | if meta.draft and meta.draft ~= '' then
7 | local epoch = os.getenv 'SOURCE_DATE_EPOCH'
8 | and os.time { year = 1970, month = 1, day = 1, hour = 0, min = 0,
9 | sec = tonumber(os.getenv 'SOURCE_DATE_EPOCH') }
10 | or os.time()
11 | meta.article.doi = '10.xxxxxx/draft'
12 | meta.article.issue = '¿ISSUE?'
13 | meta.article.volume = '¿VOL?'
14 | meta.published = 'unpublished'
15 | meta.published_parts = os.date('*t', epoch)
16 | return meta
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/data/defaults/jats.yaml:
--------------------------------------------------------------------------------
1 | to: jats.lua
2 | output-file: jats/paper.jats
3 |
4 |
5 | filters:
6 | - # Handle `\ref`, `\label`, and `\autoref` commands
7 | type: lua
8 | path: resolve-references.lua
9 |
10 | - # Most papers have a 'references' section at the end, which makes
11 | # sense for most output formats. However, as references are moved to
12 | # the back-matter in JATS, we remove that heading.
13 | type: lua
14 | path: remove-references-heading.lua
15 |
16 | - # Turn ORCID identifiers into proper URIs; this is the generic
17 | # representation required by the spec, but impractical to use with LaTeX. We
18 | # do it here for that reason.
19 | type: lua
20 | path: orcid-uri.lua
21 |
--------------------------------------------------------------------------------
/scripts/validate-jats.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | validator_url="https://jats-validator.hubmed.org/dtd/"
3 |
4 | usage ()
5 | {
6 | printf "Usage: %s FILENAME\n" "$0"
7 | printf "Validate a JATS XML file using the online validator tool at\n"
8 | printf "%s.\n" "$validator_url"
9 | exit 1
10 | }
11 |
12 | filename=$1
13 | [ -f "$filename" ] || usage
14 |
15 | printf "Validating file %s\n" "$filename"
16 | json="$(curl --form "xml=@${filename}" --silent "$validator_url")"
17 | err_count="$(printf '%s' "$json" | jq '.errors | length')"
18 |
19 | if [ "$err_count" -eq 0 ]; then
20 | printf "File was validated successfully.\n"
21 | exit 0
22 | else
23 | printf "Validator report:\n%s" "$json" >&2
24 | exit 1
25 | fi
26 |
--------------------------------------------------------------------------------
/data/defaults/shared.yaml:
--------------------------------------------------------------------------------
1 | from: markdown
2 | standalone: true
3 |
4 | metadata:
5 | footer-csl: 'footer.csl'
6 |
7 | # All papers are currently written in English. We place it here so it
8 | # cannot be overwritten in the paper YAML.
9 | lang: 'en-US'
10 |
11 | resource-path:
12 | - '/usr/local/share/openjournals'
13 | - '.'
14 |
15 | filters:
16 | - type: lua
17 | # Parse raw LaTeX
18 | path: parse-latex.lua
19 | - type: lua
20 | path: inline-cited-references.lua
21 | - type: citeproc
22 | - type: lua
23 | path: normalize-metadata.lua
24 | - type: lua
25 | path: time.lua
26 | - type: lua
27 | path: normalize-author-names.lua
28 |
29 | # ERROR, WARNING, or INFO
30 | verbosity: INFO
31 |
32 | dpi: 300
33 |
34 | default-image-extension: ".png"
35 | reference-links: true
36 |
--------------------------------------------------------------------------------
/test/metadata.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | title: 'Article Writing with Markdown and the Open Journals publishing pipeline'
3 | tags:
4 | - reference
5 | - example
6 | - markdown
7 | - publishing
8 | languages:
9 | - Markdown
10 | authors:
11 | - Albert Krewinkel
12 | - Juanjo Bazán
13 | - Arfon M. Smith
14 | doi: '10.21105/joss.00000'
15 | software_repository_url: 'https://github.com/openjournals/inara'
16 | review_issue_id: '00000'
17 | review_editor: 'Jane Q. Doe'
18 | reviewers:
19 | - '@SingleSourcePub'
20 | - '@IlonaSilverwood'
21 | volume: '0'
22 | issue: '5'
23 | year: '2020'
24 | page: '00000'
25 | journal_alias: 'JOSS'
26 | journal_name: 'Journal of Open Source Software'
27 | software_review_url: 'https://github.com/openjournals/inara/issues'
28 | archive_doi: '10.5281/zenodo.00000000'
29 |
30 | submitted_at: '2020-01-01'
31 | published_at: '2020-05-23'
32 | ---
33 |
--------------------------------------------------------------------------------
/resources/jose/defaults.yaml:
--------------------------------------------------------------------------------
1 | csl: apa.csl
2 |
3 | metadata:
4 | joss_resource_url: 'N/A'
5 | journal:
6 | abbrev-title: 'JOSE'
7 | alias: 'jose'
8 | url: 'https://jose.theoj.org'
9 | doi: '10.21105/jose'
10 | title: 'Journal of Open Source Education'
11 | publisher-name: 'Open Journals'
12 | issn: '2577-3569'
13 | eissn: '2577-3569'
14 |
15 | link-citations: true
16 |
17 | copyright:
18 | statement: >-
19 | Authors of papers retain copyright and release the work under a
20 | Creative Commons Attribution 4.0 International License (CC BY 4.0)
21 | holder: The article authors
22 | year: 2022
23 | type: open-access
24 | link: https://creativecommons.org/licenses/by/4.0/
25 | text: >-
26 | Authors of papers retain copyright and release the work under a
27 | Creative Commons Attribution 4.0 International License (CC BY 4.0)
28 |
29 | logo_path: 'jose/logo.png'
30 |
--------------------------------------------------------------------------------
/resources/resciencec/defaults.yaml:
--------------------------------------------------------------------------------
1 | csl: apa.csl
2 |
3 | metadata:
4 | joss_resource_url: 'N/A'
5 | journal:
6 | abbrev-title: 'ReScience-C'
7 | alias: 'resciencec'
8 | url: 'https://rescience.theoj.org'
9 | doi: '10.21105/resciencec'
10 | title: 'The ReScience C journal'
11 | publisher-name: 'Open Journals'
12 | issn: '2430-3658'
13 | eissn: '2430-3658'
14 |
15 | link-citations: true
16 |
17 | copyright:
18 | statement: >-
19 | Authors of papers retain copyright and release the work under a
20 | Creative Commons Attribution 4.0 International License (CC BY 4.0)
21 | holder: The article authors
22 | year: 2015
23 | type: open-access
24 | link: https://creativecommons.org/licenses/by/4.0/
25 | text: >-
26 | Authors of papers retain copyright and release the work under a
27 | Creative Commons Attribution 4.0 International License (CC BY 4.0)
28 |
29 | logo_path: 'resciencec/logo.png'
30 |
--------------------------------------------------------------------------------
/test/README.md:
--------------------------------------------------------------------------------
1 | # Testing
2 |
3 | Testing in Inara works by checking both the _draft_ mode and
4 | _production_ mode (i.e., compiled with `-p`) for the following artifacts
5 | using the `diff` command:
6 |
7 | 1. JATS XML (`jats`)
8 | 2. Crossref XML (`crossref`)
9 | 3. Preprint LaTeX (`preprint`)
10 | 4. PDF (`pdf`), though note this is a binary comparison
11 |
12 | The _draft_ golden standard files are in the [expected-draft](expected-draft) folder while
13 | the _production_ golden standard files are in the [expected-pub](expected-pub) folder.
14 |
15 | ## Maintaining the Golden Standard Files
16 |
17 | If you make updates to the underlying [paper.md](../example/paper.md) file in the `/examples`
18 | folder, you'll need to update at minimum the preprint and PDF. If you update the metadata
19 | in the `paper.md` or make changes to the templates, you might also have to update the JATS
20 | and Crossref XML files.
21 |
22 | **How to update the golden standard files** - TBA
23 |
--------------------------------------------------------------------------------
/resources/joss/defaults.yaml:
--------------------------------------------------------------------------------
1 | csl: apa.csl
2 |
3 | metadata:
4 | joss_resource_url: 'N/A'
5 | journal:
6 | abbrev-title: 'JOSS'
7 | alias: 'joss'
8 | url: 'https://joss.theoj.org'
9 | doi: '10.21105/joss'
10 | title: 'Journal of Open Source Software'
11 | publisher-name: 'Open Journals'
12 | issn: '2475-9066'
13 | eissn: '2475-9066'
14 |
15 | link-citations: true
16 |
17 | copyright:
18 | statement: >-
19 | Authors of papers retain copyright and release the work under a
20 | Creative Commons Attribution 4.0 International License (CC BY 4.0)
21 | holder: The article authors
22 | year: 2022
23 | type: open-access
24 | link: https://creativecommons.org/licenses/by/4.0/
25 | text: >-
26 | Authors of papers retain copyright and release the work under a
27 | Creative Commons Attribution 4.0 International License (CC BY 4.0)
28 |
29 | aas_logo_path: 'joss/aas-logo.png'
30 | europar_logo_path: 'joss/europar-logo.png'
31 | logo_path: 'joss/logo.png'
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Albert Krewinkel
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/data/filters/parse-latex.lua:
--------------------------------------------------------------------------------
1 | function Pandoc (doc)
2 | local allow_raw_latex =
3 | doc.meta['raw-latex'] == true or
4 | doc.meta['raw-latex'] == nil
5 |
6 | if FORMAT:match 'latex' and allow_raw_latex then
7 | return nil -- do nothing
8 | end
9 |
10 | -- The `latex` metadata field is special, raw LaTeX is always allowed in
11 | -- there.
12 | local latex = doc.meta.latex
13 |
14 | doc = doc:walk {
15 | RawBlock = function (raw)
16 | if raw.format:match 'tex' then
17 | return pandoc.read(
18 | -- special case: pandoc does not know how to parse a resizebox command
19 | raw.text:gsub('\\resizebox%{.-%}%{%!%}(%b{})', '%1'),
20 | 'latex'
21 | ).blocks
22 | end
23 | if raw.format == 'tex' then
24 | return {}
25 | end
26 | end,
27 |
28 | RawInline = function (raw)
29 | if raw.format:match 'tex' then
30 | return pandoc.utils.blocks_to_inlines(
31 | pandoc.read(raw.text, 'latex').blocks
32 | )
33 | end
34 | end
35 | }
36 |
37 | -- Restore the `latex` metadata field.
38 | doc.meta.latex = latex
39 | return doc
40 | end
41 |
--------------------------------------------------------------------------------
/data/filters/flatten-references.lua:
--------------------------------------------------------------------------------
1 | local pandoc = require 'pandoc'
2 | local utils = require 'pandoc.utils'
3 | local citeproc, stringify = utils.citeproc, utils.stringify
4 | function make_placeholder_doc(meta, reference)
5 | local tmpmeta = {
6 | ['references'] = {reference},
7 | ['nocite'] = {pandoc.Cite({}, {pandoc.Citation('*', "NormalCitation")})},
8 | ['csl'] = meta.csl,
9 | ['citation-abbreviations'] = meta['citation-abbreviations'],
10 | ['lang'] = meta['lang'],
11 | ['notes-after-punctuation'] = meta['notes-after-punctuation'],
12 | }
13 | return pandoc.Pandoc({}, tmpmeta)
14 | end
15 |
16 | local function make_unstructured_citation(meta, reference)
17 | local tmpdoc = citeproc(make_placeholder_doc(meta, reference))
18 | return stringify(tmpdoc.blocks)
19 | end
20 |
21 | function Meta (meta)
22 | for _, ref in ipairs(meta.references) do
23 | ref.unstructured_citation = make_unstructured_citation(meta, ref)
24 | for k, v in pairs(ref) do
25 | if utils.type(v) == 'Inlines' then
26 | ref[k] = stringify(v)
27 | end
28 | end
29 | if ref.type == 'book' then
30 | ref.isbook = true
31 | end
32 | end
33 | return meta
34 | end
35 |
--------------------------------------------------------------------------------
/data/custom/jats.lua:
--------------------------------------------------------------------------------
1 | local mediabag = require 'pandoc.mediabag'
2 | local path = require 'pandoc.path'
3 | local sha1 = (require 'pandoc.utils').sha1
4 |
5 | --- Map from old image filepaths to new names.
6 | local updated_filepath = {}
7 |
8 | local function unnest (filepath, contents)
9 | if updated_filepath[filepath] then
10 | return updated_filepath
11 | end
12 |
13 | local newpath = path.filename(filepath)
14 | if updated_filepath[newpath] then
15 | -- the filename is already in use. Prefix with sha1 hash.
16 | newpath = sha1(contents) .. '-' .. filepath
17 | end
18 | updated_filepath[filepath] = newpath
19 | return newpath
20 | end
21 |
22 | function Writer (doc, opts)
23 | -- Ensure that all images have been fetched.
24 | doc = mediabag.fill(doc)
25 | local newpath
26 | for fp, mt, contents in mediabag.items() do
27 | -- Delete all mediabag items and re-insert them under their fixed
28 | -- name.
29 | newpath = unnest(fp, contents)
30 | mediabag.delete(fp)
31 | mediabag.insert(newpath, mt, contents)
32 | end
33 | doc = doc:walk {
34 | Image = function (img)
35 | img.src = updated_filepath[img.src] or img.src
36 | return img
37 | end
38 | }
39 | pandoc.mediabag.write('jats')
40 | return pandoc.write(doc, 'jats_publishing+element_citations', opts)
41 | end
42 |
43 | Template = pandoc.template.default 'jats_publishing'
44 |
--------------------------------------------------------------------------------
/data/filters/inline-cited-references.lua:
--------------------------------------------------------------------------------
1 | local function trim(s)
2 | return s:gsub('^%s*', ''):gsub('%s*$', '')
3 | end
4 |
5 | function Pandoc (doc)
6 | doc.meta.references = pandoc.utils.references(doc)
7 | for i, ref in ipairs(doc.meta.references) do
8 | if ref.doi then
9 | ref.doi = trim(pandoc.utils.stringify(ref.doi))
10 | end
11 | -- the "ISSN" field sometimes contains two ISSNs, one for print and another
12 | -- for the online version. Adding both leads to bad results (and invalid
13 | -- JATS), so we keep only the first and discard the second.
14 | if ref.issn then
15 | ref.issn = ref.issn:match '(%d%d%d%d%-%d%d%d[%dxX])'
16 | end
17 | -- Same for ISBN
18 | if ref.isbn then
19 | ref.isbn = ref.isbn:match '([%d%-]+[%dxX])%s*$'
20 | end
21 |
22 | -- The literal name `other` as the last author is treated as `et
23 | -- al.`. However, APA style does not work well when this is used, as
24 | -- it always includes the last author (preceded by an ellipses) in
25 | -- the bibliography entry. We work around this by setting `others`
26 | -- as the family name, but it's a hack.
27 | local author = ref.author
28 | if author and #author > 0 and author[#author].literal == 'others' then
29 | author[#author].family = 'others'
30 | author[#author].literal = nil
31 | end
32 | end
33 | doc.meta.bibliography = nil -- prevent bibliography from being parsed twice
34 | return doc
35 | end
36 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Released 2024-06-24
2 | FROM pandoc/latex:3.2.1-alpine
3 |
4 | RUN apk add --no-cache ttf-hack
5 |
6 | # Install additional LaTeX packages
7 | RUN tlmgr option repository http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2024/tlnet-final && \
8 | tlmgr update --self && tlmgr install \
9 | algorithmicx \
10 | algorithms \
11 | collection-context \
12 | draftwatermark \
13 | environ \
14 | fontsetup \
15 | hyperxmp \
16 | latexmk \
17 | lineno \
18 | marginnote \
19 | newcomputermodern \
20 | orcidlink \
21 | preprint \
22 | seqsplit \
23 | tcolorbox \
24 | titlesec \
25 | trimspaces \
26 | xkeyval \
27 | xstring
28 |
29 |
30 | ENV OSFONTDIR=/usr/share/fonts
31 |
32 | COPY ./fonts/libre-franklin $OSFONTDIR/libre-franklin
33 |
34 | RUN TERM=dumb luaotfload-tool --update \
35 | && chmod -R o+w /opt/texlive/texdir/texmf-var \
36 | && apk add --no-cache ttf-opensans \
37 | && fc-cache -sfv $OSFONTDIR/libre-franklin \
38 | && mtxrun --generate \
39 | && mtxrun --script font --reload
40 |
41 | # Copy templates, images, and other resources
42 | ARG openjournals_path=/usr/local/share/openjournals
43 | COPY ./resources $openjournals_path
44 | COPY ./data $openjournals_path/data
45 | COPY ./scripts/entrypoint.sh /usr/local/bin/inara
46 |
47 | ENV JOURNAL=joss
48 | ENV OPENJOURNALS_PATH=$openjournals_path
49 |
50 | # Input is read from `paper.md` by default, but can be overridden. Output is
51 | # written to `paper.pdf`
52 | ENTRYPOINT ["/usr/local/bin/inara"]
53 | CMD ["paper.md"]
54 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | `Inara` uses [SemVer][] (semantic versioning).
4 |
5 | ## Inara v1.1.4
6 |
7 | Released 2024-11-06.
8 |
9 | - HTML-escape institution names in CrossRef XML.
10 | - Set copyright year to the year in which the article was
11 | publishing.
12 |
13 | ## Inara v1.1.3
14 |
15 | Released 2024-10-24.
16 |
17 | All contributions by Juanjo Bazán.
18 |
19 | - Fix CrossRef XML output. The affiliations element is moved
20 | before the ORCID element.
21 |
22 | ## Inara v1.1.2
23 |
24 | Released 2024-10-23.
25 |
26 | All contributions by Charles Tapley Hoyt.
27 |
28 | - Fix bug in the height of ROR logos.
29 | (https://github.com/openjournals/inara/pull/90)
30 | - Fix bug in application of `prepare-affiliations.lua` filter.
31 | - Fix a bug in the injection of `SOURCE_DATE_EPOCH` in tests.
32 | (https://github.com/openjournals/inara/pull/86)
33 | - Fix test files. (https://github.com/openjournals/inara/pull/86,
34 | https://github.com/openjournals/inara/pull/85)
35 | - Switch testing to work on tex instead of pdf.
36 | (https://github.com/openjournals/inara/pull/82)
37 | - Refactor testing folders.
38 | (https://github.com/openjournals/inara/pull/84)
39 |
40 | ## Inara v1.1.1
41 |
42 | Released 2024-09-05.
43 |
44 | - Ignore failures around affiliations.
45 |
46 | ## Inara v1.1.0
47 |
48 | Released 2024-09-04.
49 |
50 | - Support for ROR identifiers (Charles Tapley Hoyt)
51 | - Code cleanup
52 |
53 | ## Inara v1.0.0
54 |
55 | Released 2024-06-10.
56 |
57 | Initial release. May the program live long and prosper.
58 |
59 | - *Pandoc*: 3.2.0
60 | - *TeXLive*: 2024
61 |
62 | [SemVer]: https://semver.org
63 |
--------------------------------------------------------------------------------
/data/filters/time.lua:
--------------------------------------------------------------------------------
1 | local sample_date = '1970-01-01'
2 |
3 | local function format_date (date_table)
4 | local date_format = '%d %B %Y'
5 | return os.date(date_format, os.time(date_table))
6 | end
7 |
8 | local function copy_string_values (tbl)
9 | local result = {}
10 | for k, v in pairs(tbl or {}) do
11 | result[k] = pandoc.utils.stringify(v)
12 | end
13 | return result
14 | end
15 |
16 | local function date_array(date_metavalue)
17 | local date_string = pandoc.utils.stringify(date_metavalue)
18 | local year, month, day, hour, min, sec =
19 | date_string:match '^(%d%d%d%d)-(%d%d)-(%d%d)'
20 | return {
21 | year = year,
22 | month = month,
23 | day = day,
24 | }
25 | end
26 |
27 | function Meta (meta)
28 | local epoch = os.getenv 'SOURCE_DATE_EPOCH'
29 | and os.time { year = 1970, month = 1, day = 1, hour = 0, min = 0,
30 | sec = tonumber(os.getenv 'SOURCE_DATE_EPOCH') }
31 | or os.time()
32 | local curtime = os.date('*t', epoch)
33 | meta.timestamp = meta.timestamp or os.date('!%Y%m%d%H%M%S', epoch)
34 |
35 | meta.submitted_parts = date_array(meta.submitted_at or sample_date)
36 | meta.published_parts = date_array(meta.published_at or sample_date)
37 |
38 | meta.day = meta.published_parts.day or tostring(curtime.day)
39 | meta.month = meta.published_parts.month or tostring(curtime.month)
40 | meta.year = meta.published_parts.year or tostring(curtime.year)
41 |
42 | meta.submitted = format_date(meta.submitted_parts)
43 | meta.published = format_date(meta.published_parts)
44 |
45 | meta.copyright = meta.copyright or {}
46 | meta.copyright.year = meta.published_parts.year
47 | return meta
48 | end
49 |
--------------------------------------------------------------------------------
/data/filters/prepare-affiliations.lua:
--------------------------------------------------------------------------------
1 | -- This filter rewrites the affiliation list inside the
2 | -- author dictionary to contain all the information, not
3 | -- just the index in the global affiliation list
4 |
5 | local function prepare_affiliations (meta)
6 | -- note that there's a difference between meta.authors (the original)
7 | -- and meta.author (the processed one)
8 | for _, author in ipairs(meta.authors or {}) do
9 | local xml = ""
10 | for i, affiliation_index in ipairs(author.affiliation) do
11 | affiliation_index = tonumber(pandoc.utils.stringify(affiliation_index))
12 | local affiliation = meta.affiliations[affiliation_index]
13 | local function html_escape(str)
14 | local doc = pandoc.Pandoc{pandoc.Str(str)}
15 | return pandoc.write(doc, 'html')
16 | end
17 | xml = xml.. "\n "
18 | for _, v in ipairs(affiliation.name) do
19 | if v.text then
20 | xml = xml .. html_escape(v.text)
21 | else
22 | xml = xml .. " "
23 | end
24 | end
25 | xml = xml .. ""
26 | if affiliation.ror then
27 | xml = xml .. "https://ror.org/" .. affiliation.ror[1].text .. ""
28 | end
29 | xml = xml.. ""
30 | end
31 | xml = xml .. "\n"
32 | -- afxml - (af)filiation xml
33 | author.afxml = pandoc.RawInline('html', xml)
34 | end
35 | return meta
36 | end
37 |
38 | function Meta (meta)
39 | local ok, result = pcall(prepare_affiliations, meta)
40 | if ok then
41 | return result
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/data/defaults/contextpdf.yaml:
--------------------------------------------------------------------------------
1 | to: context
2 | pdf-engine: context
3 | pdf-engine-opt: --luatex
4 | output-file: paper.context.pdf
5 | top-level-division: section
6 | filters:
7 | - type: lua
8 | path: draft.lua
9 | - type: lua
10 | path: self-citation.lua
11 | - # Handle `\ref`, `\label`, and `\autoref` commands
12 | type: lua
13 | path: resolve-references.lua
14 | - type: lua
15 | path: context-numbered-equations.lua
16 |
17 | metadata:
18 | reference-section-title: References
19 |
20 | variables:
21 | # colors
22 | colorlinks: true
23 | linkcolor: lightblue
24 | linkcontrastcolor: lightblue
25 | license: |
26 | Authors of papers retain copyright and release the work under a Creative
27 | Commons Attribution 4.0 International License ({\sc CC~BY~4.0})
28 |
29 | # Fonts
30 | mainfont: OpenSans
31 | sansfont: LibreFranklin
32 | monofont: Hack
33 |
34 |
35 | fontsize: 10pt
36 | interlinespace: 13pt
37 |
38 | # layout
39 | # Size of A4 paper: 210 mm x 297 mm
40 | papersize: A4
41 | layout:
42 | # top
43 | - header=40mm
44 | - headerdistance=0mm
45 | - top=0mm
46 | - topspace=10mm
47 |
48 | # left
49 | - backspace=65mm
50 | - leftedge=9.5mm
51 | - leftedgedistance=0mm
52 | - leftmargin=48mm
53 | - leftmargindistance=8mm
54 |
55 | # right
56 | - rightedge=0mm
57 | - rightmargin=8mm
58 | - rightmargindistance=0mm
59 |
60 | # bottom
61 | - bottom=10mm
62 | - bottomdistance=0mm
63 | - footerdistance=12mm
64 | - footer=12mm
65 |
66 | # text
67 | - height=277mm
68 | - width=137mm
69 |
70 | pagenumbering:
71 | - alternative=singlesided
72 | - location={footer,margin}
73 | - state=start
74 |
75 | papersize: a4
76 | pdfa: 3a
77 | whitespace: none
78 | # Use the international standard
79 | pdfaiccprofile: sRGB.icc
80 | pdfaintent: sRGB IEC61966-2.1
81 |
--------------------------------------------------------------------------------
/.github/workflows/build.yaml:
--------------------------------------------------------------------------------
1 | name: Image Builder
2 |
3 | on:
4 | push:
5 | paths-ignore:
6 | - '.gitignore'
7 | - 'CHANGELOG.md'
8 | - 'LICENSE'
9 | - 'README.md'
10 | pull_request:
11 | branches:
12 | - main
13 |
14 | jobs:
15 | # Build images and push them
16 | build:
17 | name: Build tagged Docker image
18 | runs-on: ubuntu-latest
19 |
20 | steps:
21 | - name: Checkout repository
22 | uses: actions/checkout@v4
23 |
24 |
25 | - name: Login to Docker Hub
26 | uses: docker/login-action@v3
27 | if: >-
28 | github.repository == 'openjournals/inara' &&
29 | github.event_name != 'pull_request'
30 | with:
31 | username: ${{ secrets.DOCKER_HUB_USERNAME }}
32 | password: ${{ secrets.DOCKER_HUB_TOKEN }}
33 |
34 | - name: Login to GitHub Container Registry
35 | uses: docker/login-action@v3
36 | if: >-
37 | github.repository == 'openjournals/inara' &&
38 | github.event_name != 'pull_request'
39 | with:
40 | registry: ghcr.io
41 | username: ${{ github.actor }}
42 | password: ${{ secrets.GITHUB_TOKEN }}
43 |
44 | - name: Docker meta
45 | id: meta
46 | uses: docker/metadata-action@v5
47 | with:
48 | images: |
49 | openjournals/inara
50 | ghcr.io/openjournals/inara
51 | tags: |
52 | type=semver,pattern={{version}}
53 | type=edge
54 | type=ref,event=branch
55 | type=ref,event=pr
56 |
57 | - name: Build and maybe push image
58 | id: push
59 | uses: docker/build-push-action@v5
60 | with:
61 | context: '.'
62 | push: ${{ github.ref == 'refs/heads/main' ||
63 | github.ref_type == 'tag' ||
64 | github.event_name != 'pull_request' }}
65 | tags: ${{ steps.meta.outputs.tags }}
66 | labels: ${{ steps.meta.outputs.labels }}
67 |
68 | - name: Test image
69 | run: make test IMAGE=${{ fromJSON(steps.meta.outputs.json).tags[0] }}
70 |
--------------------------------------------------------------------------------
/.github/workflows/example-doc.yml:
--------------------------------------------------------------------------------
1 | name: Compile example paper
2 |
3 | on:
4 | # Build any branch where either the source data or templates changed
5 | push:
6 | paths:
7 | - 'example/*'
8 | - 'data/templates/*'
9 | - "Dockerfile"
10 | pull_request:
11 | paths:
12 | - 'example/*'
13 | - 'data/templates/*'
14 | - "Dockerfile"
15 | # Build, but don't push on pull requests
16 |
17 | jobs:
18 | build:
19 | name: Example PDF
20 | runs-on: ubuntu-latest
21 |
22 | steps:
23 | - name: Checkout
24 | uses: actions/checkout@v4
25 |
26 | # Build the docker image locally to enable testing
27 | # updates to the templates. This workflow does not
28 | # push new images to dockerhub at all, hence why we
29 | # don't prefix this like openjournals/inara:
30 | - name: Build docker
31 | run: |
32 | docker build -t inara:edgiest .
33 |
34 | - name: Build draft PDF
35 | run: >-
36 | docker run \
37 | --volume "$(pwd):/data" \
38 | --user "$(id -u):$(id -g)" \
39 | inara:edgiest \
40 | -o "jats,contextpdf,crossref,preprint,tex,pdf" example/paper.md
41 |
42 | - name: Upload draft PDF
43 | uses: actions/upload-artifact@v4
44 | with:
45 | name: draft
46 | path: |
47 | example/jats/paper.jats
48 | example/paper.context.pdf
49 | example/paper.crossref
50 | example/paper.pdf
51 | example/paper.tex
52 | example/paper.preprint.tex
53 |
54 | - name: Build production PDF
55 | run: >-
56 | docker run \
57 | --volume "$(pwd):/data" \
58 | --user "$(id -u):$(id -g)" \
59 | inara:edgiest \
60 | -o "jats,contextpdf,crossref,preprint,tex,pdf" -p example/paper.md
61 |
62 | - name: Upload production PDF
63 | uses: actions/upload-artifact@v4
64 | with:
65 | name: production
66 | path: |
67 | example/jats/paper.jats
68 | example/paper.context.pdf
69 | example/paper.crossref
70 | example/paper.pdf
71 | example/paper.tex
72 | example/paper.preprint.tex
73 |
--------------------------------------------------------------------------------
/docs/names.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Author Names
3 | ---
4 |
5 | Providing an author name is straight-forward: just set the `name`
6 | attribute. However, sometimes fine-grained control over the name
7 | is required.
8 |
9 | ## Name parts
10 |
11 | There are many ways to describe the parts of names; we support the
12 | following:
13 |
14 | - given names,
15 | - surname,
16 | - dropping particle,
17 | - non-dropping particle,
18 | - and suffix.
19 |
20 | We use a heuristic to parse names into these components. This
21 | parsing may produce the wrong result, in which case it is
22 | necessary to provide the relevant parts explicitly.
23 |
24 | The respective field names are
25 |
26 | - `given-names` (aliases: `given`, `first`, `firstname`)
27 | - `surname` (aliases: `family`)
28 | - `suffix`
29 |
30 | The full display name will be constructed from these parts, unless
31 | the `name` attribute is given as well.
32 |
33 | ### Particles
34 |
35 | It's usually enough to place particles like "van", "von", "della",
36 | etc. at the end of the given name or at the beginning of the
37 | surname, depending on the details of how the name is used.
38 |
39 | - `dropping-particle` (e.g. `"as cited in Beethoven et al."`)
40 | - `non-dropping-particle` (e.g. `"as cited in de Broglie et al."`)
41 |
42 | ### Literal names
43 |
44 | The automatic construction of the full name from parts is geared
45 | towards common English names. It may therefore be necessary
46 | sometimes to provide the display name explicitly. This is possible
47 | by setting the `literal` field, e.g., `literal: 宮水 三葉`.
48 |
49 | ### Example
50 |
51 | ```yaml
52 | authors:
53 | - name: John Doe
54 | affiliation: '1'
55 |
56 | - given-names: Gabriel José de la Concordia
57 | surname: García Márquez
58 | affiliation: '2'
59 |
60 | - given-names: Ludwig
61 | dropping-particle: van
62 | surname: Beethoven
63 | affiliation: '3'
64 |
65 | # not recommended, but common aliases can be used for name parts.
66 | - given: Louis
67 | non-dropping-particle: de
68 | family: Broglie
69 | affiliation: '4'
70 | ```
71 |
72 | The name parts can also be collected under the author's `name`:
73 |
74 | ``` yaml
75 | authors:
76 | - name:
77 | given-names: Kari
78 | surname: Nordmann
79 |
80 | - name:
81 | literal: 立花 瀧
82 | given-names: 瀧
83 | surname: 立花
84 | ```
85 |
--------------------------------------------------------------------------------
/data/custom/cff.lua:
--------------------------------------------------------------------------------
1 | Template = [[
2 | cff-version: "1.2.0"
3 | $titleblock$
4 | ]]
5 |
6 | local stringify = pandoc.utils.stringify
7 |
8 | local toauthor = function (author)
9 | return {
10 | ['email'] = author.email,
11 | ['family-names'] = author['surname'],
12 | ['given-names'] = author['given-names'],
13 | ['name'] = not author['surname'] and author.name or nil,
14 | ['name-particle'] = author['dropping-particle'] or
15 | author['non-dropping-particle'],
16 | ['name-suffix'] = author.suffix,
17 | ['orcid'] = author.orcid,
18 | }
19 | end
20 | local function filter_authors (authors)
21 | return authors:map(toauthor)
22 | end
23 |
24 | local function is_contact (author)
25 | return author['cor-id']
26 | end
27 | local function contact (authors)
28 | local contact = authors:filter(is_contact):map(toauthor)
29 | return #contact >= 1 and contact or nil
30 | end
31 |
32 | local function preferred_citation(meta)
33 | local article = meta.article or {}
34 | local journal = meta.journal or {}
35 | return {
36 | ['authors'] = filter_authors(meta.author),
37 | ['date-published'] = os.date('%Y-%m-%d', os.time(meta.published_parts)),
38 | ['doi'] = article.doi,
39 | ['isbn'] = journal.isbn,
40 | ['issn'] = journal.eissn or journal.issn,
41 | ['issue'] = article.issue,
42 | ['journal'] = journal.title,
43 | ['keywords'] = meta.tag,
44 | ['publisher'] = {name = journal['publisher-name']},
45 | ['start'] = article.fpage,
46 | ['title'] = stringify(meta.title),
47 | ['type'] = 'article',
48 | ['url'] = ('%s/papers/%s'):format(journal.url, stringify(article.doi)),
49 | ['volume'] = article.volume,
50 | }
51 | end
52 |
53 | local function citation_from_meta (meta)
54 | return {
55 | ['authors'] = filter_authors(meta.author),
56 | ['contact'] = contact(meta.author),
57 | ['doi'] = meta.archive_doi,
58 | ['message'] = meta.message or
59 | ("If you use this software, please cite our " ..
60 | "article in the Journal of Open Source Software."),
61 | ['preferred-citation'] = preferred_citation(meta),
62 | ['title'] = meta.title,
63 | }
64 | end
65 |
66 | function Writer (doc, opts)
67 | opts.template = Template
68 | local newdoc = pandoc.Pandoc({}, citation_from_meta(doc.meta))
69 | return pandoc.write(newdoc, 'markdown', opts):gsub('\n%-%-%-\n', '\n')
70 | end
71 |
--------------------------------------------------------------------------------
/data/filters/self-citation.lua:
--------------------------------------------------------------------------------
1 | local utils = require 'pandoc.utils'
2 | local system = require 'pandoc.system'
3 | local stringify = utils.stringify
4 | local run_json_filter = utils.run_json_filter
5 | local blocks_to_inlines = utils.blocks_to_inlines
6 |
7 | local function authors_to_csl_json (authors)
8 | local result = pandoc.List()
9 | for _, author in ipairs(authors) do
10 | result:insert {
11 | ['family'] = author.surname,
12 | -- we don't want given names in the self citation
13 | -- FIXME: this should be handled by the CSL for self citations.
14 | -- ['given'] = author['given-names'],
15 | ['suffix'] = author.suffix,
16 | ['dropping-particle'] = author['dropping-particle'],
17 | ['non-dropping-particle'] = author['non-dropping-particle'],
18 | }
19 | end
20 | return result
21 | end
22 |
23 | function Meta (meta)
24 | meta.article = meta.article or {}
25 | local tmpmeta = {
26 | ['references'] = {
27 | {
28 | ['type'] = 'article-journal',
29 | ['id'] = 'self',
30 | ['author'] = authors_to_csl_json(meta.authors),
31 | ['title'] = meta.title,
32 | ['issued'] = {
33 | ['date-parts'] = {{meta.published_parts.year}}
34 | },
35 | ['publisher'] = meta.publisher,
36 | ['container-title'] = meta.journal.title,
37 | ['container-title-short'] = meta.journal['abbrev-title'],
38 | ['ISSN'] = meta.journal.issn,
39 | ['issue'] = stringify(meta.article.issue),
40 | ['page'] = stringify(meta.article.fpage),
41 | ['volume'] = stringify(meta.article.volume),
42 | ['submitted'] = meta.submitted,
43 | ['published'] = meta.published,
44 | ['editor'] = meta.editor.name,
45 | ['url'] = 'https://doi.org/' .. stringify(meta.article.doi),
46 | ['doi'] = meta.doi or meta.article.doi
47 | }
48 | },
49 | ['nocite'] = {pandoc.Cite({}, {pandoc.Citation('*', "NormalCitation")})},
50 | ['csl'] = meta['footer-csl'],
51 | ['link-citations'] = meta['link-citations'],
52 | ['citation-abbreviations'] = meta['citation-abbreviations'],
53 | ['lang'] = meta['lang'],
54 | ['notes-after-punctuation'] = meta['notes-after-punctuation'],
55 | }
56 | local tmpdoc = run_json_filter(
57 | pandoc.Pandoc({}, tmpmeta),
58 | 'pandoc',
59 | {'--from=json', '--citeproc', '--to=json',
60 | -- FIXME: use pandoc.path when available
61 | '--resource-path=' .. table.concat(PANDOC_STATE.resource_path, ':')
62 | }
63 | )
64 | meta['self-citation'] = blocks_to_inlines(tmpdoc.blocks)
65 | return meta
66 | end
67 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # inara
2 |
3 | Tools to create Open Journals publishing artifacts.
4 |
5 | The package is designed to be usable either via its Makefile, or
6 | through a Docker image.
7 |
8 | Generated output formats are HTML, PDF, JATS, and Crossref XML.
9 |
10 | ## Usage via Docker
11 |
12 | The directory of the paper, or one of its parent directories,
13 | must be mounted on path `/data`. The path to the paper, relative to
14 | the mounted folder, is expected as the only argument.
15 |
16 | - The Docker image will generate PDF and JATS files by default. To
17 | select specific output formats to be generated use the `-o` flag.
18 | Supported options are: `pdf`, `jats`, `html`, `crossref`, `cff`, and `preprint`. To get multiple outputs
19 | use a comma separated list.
20 | - By default PDF files will be compiled in _draft mode_ to include a draft
21 | watermark and linenumbers. To create a _production_ PDF add the `-p` flag.
22 | - There is a special flag `-r` meant for retraction notices that don't need to show Software/Editor/Reviewes/Submission-date information.
23 | - The target journal can be set using the `JOURNAL` ENV VAR. Currently the valid values are: `joss`, `jose` or `resciencec`
24 |
25 | **Example:**
26 |
27 | docker run --rm -it \
28 | -v $PWD:/data \
29 | -u $(id -u):$(id -g) \
30 | openjournals/inara \
31 | -o pdf,crossref \
32 | path/relative/to/current/directory/paper.md
33 |
34 | The resulting PDF and Crossref-XML files will be named `paper.pdf` and `paper.crossref` and placed next to the
35 | input file.
36 |
37 | ## Usage via make
38 |
39 | The `make` command should be run from the project's root directory.
40 | It expects the article source to be passed via the `ARTICLE`
41 | variable. So if the paper Markdown source is in file
42 | `/my/path/paper.md`, then make should be called with
43 |
44 | make ARTICLE=/my/path/paper.md
45 |
46 | All supported publishing formats are generated by default, but you
47 | can select a specific format to be generated by passing it as an
48 | argument. Available options: `html`, `pdf`, `jats`, `crossref`, `cff`, and `preprint`.
49 |
50 | E.g., to generate only a PDF file, the command would be
51 |
52 | make pdf ARTICLE=/my/path/paper.md
53 |
54 | The generated output will be written to folder
55 | `publishing-artifacts`.
56 |
57 | ### Dependencies
58 |
59 | Inara is built on pandoc, and requires a recent pandoc version.
60 | The latest pandoc version can be downloaded from
61 | .
62 |
63 | PDFs are generated via LaTeX; for best results, all packages
64 | listed in `Dockerfile` should be installed.
65 |
66 | You will also need the [Hack](https://github.com/source-foundry/Hack) font by `source-foundry`.
67 |
68 | ## Versions
69 |
70 | Inara is versioned using [SemVer](https://semver.org). Docker
71 | images are tagged with the version; tagged images are available
72 | for all published versions. The current development version is
73 | published as an image tagged *edge*.
74 |
75 | ## Deployment
76 |
77 | After minting a new version, update the configuration in https://github.com/xuanxu/publishing-artifacts-action
78 | to reflect the new version, such as in https://github.com/xuanxu/publishing-artifacts-action/pull/1.
79 |
--------------------------------------------------------------------------------
/data/filters/normalize-metadata.lua:
--------------------------------------------------------------------------------
1 | local path = pandoc.path
2 | local List = pandoc.List
3 | local stringify = pandoc.utils.stringify
4 |
5 | local scriptdir = path.directory(PANDOC_SCRIPT_FILE)
6 |
7 | local normalize_authors = dofile(
8 | path.join{scriptdir, 'normalize', 'authors.lua'}
9 | )
10 |
11 | local List = require 'pandoc.List'
12 | local stringify = pandoc.utils.stringify
13 |
14 | local defaults = {
15 | archive_doi = '10.5281',
16 | editor = {
17 | name = 'Open Journals',
18 | url = 'https://joss.theoj.org',
19 | github_user = '@openjournals',
20 | },
21 | citation_author = '¿citation_author?',
22 | issue = '¿ISSUE?',
23 | page = '¿PAGE?',
24 | paper_url = 'NO PAPER URL',
25 | reviewers = {'openjournals'},
26 | software_repository_url = 'https://github.com/openjournals',
27 | software_review_url = 'https://github.com/openjournals',
28 | volume = '¿VOL?',
29 | }
30 |
31 | local function read_metadata(filename)
32 | local fh = io.open(stringify(filename))
33 | local content = (fh:read 'a') .. '\n...\n' -- YAML separator required
34 | return pandoc.read(content, 'commonmark+yaml_metadata_block').meta
35 | end
36 |
37 |
38 | function Meta (meta)
39 | -- read values from metadata file; values from that file take precedence
40 | -- except for authors and title
41 | if meta['article-info-file'] then
42 | for k, v in pairs(read_metadata(meta['article-info-file'])) do
43 | if k ~= 'authors' and k ~= 'title' then
44 | meta[k] = v
45 | end
46 | end
47 | end
48 |
49 | -- set default values where no value is set
50 | for k, v in pairs(defaults) do
51 | meta[k] = meta[k] or v
52 | end
53 |
54 | -- Normalize authors and affiliations; also sets article author-notes
55 | -- to keep track of equal contributors and corresponding authors.
56 | meta = normalize_authors(meta)
57 | meta.affiliation = meta.affiliations
58 |
59 | -- ensure 'article' table is available
60 | meta.article = meta.article or {}
61 | -- We take the variable part of the doi as publisher id
62 | meta.article['publisher-id'] = meta.article['publisher-id'] or
63 | string.format("%0d", tonumber(stringify(meta.page or '')) or 0)
64 |
65 | -- move keys from base level to article
66 | local keys = {
67 | -- articlekey => basekey
68 | ['doi'] = 'doi',
69 | ['fpage'] = 'page',
70 | ['issue'] = 'issue',
71 | ['volume'] = 'volume',
72 | ['publisher-id'] = 'publisher-id'
73 | }
74 | for articlekey, basekey in pairs(keys) do
75 | meta.article[articlekey] = meta.article[articlekey]
76 | or meta[basekey]
77 | or 'N/A'
78 | -- unset base key
79 | meta[basekey] = nil
80 | end
81 |
82 | -- Remove leading '@' from reviewers
83 | for i, reviewer in ipairs(meta.reviewers) do
84 | meta.reviewers[i] = stringify(reviewer):gsub('^@', '')
85 | end
86 |
87 | -- Unset author notes unless it contains values: The existence of this
88 | -- value affects the JATS template, and the output becomes invalid if
89 | -- the `` element is present but empty.
90 | if not next(meta.article['author-notes']) then
91 | meta.article['author-notes'] = nil
92 | end
93 |
94 | -- especially for crossref
95 | meta['title-meta'] = stringify(meta.title)
96 |
97 | return meta
98 | end
99 |
--------------------------------------------------------------------------------
/data/filters/normalize-author-names.lua:
--------------------------------------------------------------------------------
1 | local List = require 'pandoc.List'
2 | local stringify = pandoc.utils.stringify
3 | local type = pandoc.utils.type
4 |
5 | local bibtex_template = [[
6 | @misc{x,
7 | author = {%s}
8 | }
9 | ]]
10 |
11 | --- Returns a CSLJSON-like name table. BibTeX knows how to parse names,
12 | --- so we leverage that.
13 | local function parse_name (unparsed_name)
14 | local bibtex = bibtex_template:format(stringify(unparsed_name))
15 | local name = pandoc.read(bibtex, 'bibtex').meta.references[1].author[1]
16 | if type(name) ~= 'table' then
17 | return {name = stringify(unparsed_name)}
18 | else
19 | -- most dropping particles are really non-dropping
20 | if name['dropping-particle'] and not name['non-dropping-particle'] then
21 | name['non-dropping-particle'] = name['dropping-particle']
22 | name['dropping-particle'] = nil
23 | end
24 | return name
25 | end
26 | end
27 |
28 | --- Table mapping from the type of a name to a function that converts
29 | --- the type object into a name table.
30 | local to_name_table = {
31 | Inlines = parse_name,
32 | Blocks = parse_name,
33 | string = parse_name,
34 | table = function (t)
35 | name = t.name or t.literal
36 | t.literal = nil
37 | t.name = name and stringify(name) or nil
38 | return t
39 | end
40 | }
41 |
42 | --- Normalize the name(s) of an author. The return value is a table
43 | --- object with the following fields:
44 | --
45 | -- `name`: full name / display name (string)
46 | -- `given`: given names
47 | -- `surname`: family name or last name
48 | -- `prefix`:
49 | --
50 | -- All fields but `name` are optional.
51 | local function normalize_name (name)
52 | -- ensure basic table structure
53 | local namify = to_name_table[type(name)] or
54 | error('Cannot normalize author of type ' .. type(name))
55 | name = namify(name)
56 |
57 | -- normalize given name field
58 | local given = 'given-names'
59 | name[given] = name[given] and stringify(name[given]) or nil
60 | local given_names_aliases = {'given', 'given_name', 'first', 'firstname'}
61 | for _, alias in ipairs(given_names_aliases) do
62 | name[given] = name[given] or
63 | (name[alias] and stringify(name[alias]))
64 | name[alias] = nil
65 | end
66 |
67 | -- normalize surname name field
68 | name.surname = name.surname and stringify(name.surname) or nil
69 | local surname_aliases = {'family_name', 'family', 'last', 'lastname'}
70 | for _, alias in ipairs(surname_aliases) do
71 | name.surname = name.surname or
72 | (name[alias] and stringify(name[alias]))
73 | name[alias] = nil
74 | end
75 |
76 | -- ensure full name (a.k.a, display name) is set and of type 'string'.
77 | name.name = name.name and stringify(name.name) or nil
78 | if not name.name then
79 | local literal = pandoc.List{}
80 | for _, name_part in ipairs{'given-names', 'dropping-particle',
81 | 'non-dropping-particle', 'surname',
82 | 'suffix'} do
83 | literal:extend(name[name_part] and {stringify(name[name_part])} or {})
84 | end
85 | name.name = table.concat(literal, ' ')
86 | end
87 |
88 | return name
89 | end
90 |
91 | function Meta (meta)
92 | for i, author in ipairs(meta.authors) do
93 | local name = normalize_name(author.name or author)
94 | for k, v in pairs(name) do
95 | meta.authors[i][k] = v
96 | end
97 | end
98 |
99 | meta.author = meta.authors
100 |
101 | -- set "author-meta" field using display names
102 | meta['author-meta'] = table.concat(
103 | meta.authors:map(function (auth) return auth.name end),
104 | ', '
105 | )
106 |
107 | return meta
108 | end
109 |
--------------------------------------------------------------------------------
/data/filters/resolve-references.lua:
--------------------------------------------------------------------------------
1 | -- Bail if we are converting to LaTeX.
2 | if FORMAT:match('latex') then
3 | return {}
4 | end
5 |
6 | local ntables = 0
7 | local nfigures = 0
8 | local nequations = 0
9 |
10 | local table_labels = {}
11 | local figure_labels = {}
12 | local equation_labels = {}
13 | local labels = {}
14 |
15 | local function collect_table_labels (tbl)
16 | ntables = ntables + 1
17 | return pandoc.walk_block(tbl, {
18 | Span = function (span)
19 | if span.attributes.label then
20 | table_labels[span.attributes.label] = tostring(ntables)
21 | labels[span.attributes.label] = {
22 | pandoc.Str('Table ' .. tostring(ntables))
23 | }
24 | span.content = {}
25 | return span
26 | end
27 | end
28 | })
29 | end
30 |
31 | local function collect_figure_labels (para)
32 | -- ensure that we are looking at an implicit figure
33 | if #para.content ~= 1 or para.content[1].t ~= 'Image' then
34 | return nil
35 | end
36 | local image = para.content[1]
37 | nfigures = nfigures + 1
38 | return pandoc.Para{
39 | pandoc.walk_inline(image, {
40 | Span = function (span)
41 | if span.attributes.label then
42 | figure_labels[span.attributes.label] = tostring(nfigures)
43 | labels[span.attributes.label] = {
44 | pandoc.Str('Figure ' .. tostring(nfigures))
45 | }
46 | span.content = {}
47 | return span
48 | end
49 | end
50 | })
51 | }
52 | end
53 |
54 | local function collect_equation_tags (span)
55 | local eq = span.content[1]
56 | if #span.content == 1 and eq.t == 'Math' and span.attributes.label then
57 | nequations = nequations + 1
58 | equation_labels[span.attributes.label] = tostring(nequations)
59 | labels[span.attributes.label] = {
60 | pandoc.Str('Equation ' .. tostring(nequations))
61 | }
62 | end
63 | end
64 |
65 | local function find_label (txt)
66 | local before, label, after = txt:match '(.*)\\label%{(.-)%}(.*)'
67 | return label, label and before .. after
68 | end
69 |
70 | local function parse_equation (txt)
71 | local is_equation = txt:match '^\\begin%{equation%}'
72 | or txt:match '^\\begin%{align%}'
73 | if is_equation then
74 | local para = pandoc.read(txt, 'latex').blocks[1]
75 | if not para.t == 'Para' then
76 | -- something weird happened. bail out!
77 | return nil
78 | end
79 | local label = find_label(txt)
80 | if label then
81 | local attr = pandoc.Attr(label, {'equation'}, {label=label})
82 | return {pandoc.Span(para.content, attr)}
83 | end
84 | return para.content
85 | end
86 | return nil
87 | end
88 |
89 | return {
90 | {
91 | RawInline = function (raw)
92 | if not raw.format == 'tex' then
93 | return nil
94 | end
95 | local is_ref_or_label = raw.text:match '^\\ref%{'
96 | or raw.text:match '^\\autoref'
97 | or raw.text:match '^\\label%{.*%}$'
98 | if is_ref_or_label then
99 | local first = pandoc.read(raw.text, 'latex').blocks[1]
100 | return first and first.content or nil
101 | end
102 |
103 | return parse_equation(raw.text)
104 | end,
105 | RawBlock = function (raw)
106 | if raw.format == 'tex' then
107 | local eq = parse_equation(raw.text)
108 | return eq and pandoc.Para(eq) or nil
109 | end
110 | end,
111 | Math = function (m)
112 | if m.mathtype == pandoc.DisplayMath then
113 | local label, stripped = find_label(m.text)
114 | if label then
115 | local attr = pandoc.Attr(label, {'equation'}, {label=label})
116 | m.text = stripped
117 | return pandoc.Span({m}, attr)
118 | end
119 | end
120 | end
121 | }, {
122 | Table = collect_table_labels,
123 | Para = collect_figure_labels,
124 | Span = collect_equation_tags,
125 | }, {
126 | Link = function (link)
127 | local ref = link.attributes.reference
128 | if not ref then
129 | return nil
130 | end
131 | local ref_target = link.attributes['reference-type'] == 'ref+label'
132 | and labels[ref]
133 | or (table_labels[ref] or figure_labels[ref] or equation_labels[ref])
134 | if ref_target then
135 | link.content = ref_target
136 | end
137 | return link
138 | end
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/fonts/libre-franklin/OFL.txt:
--------------------------------------------------------------------------------
1 | Copyright 2020 The LibreFranklin Project Authors (https://github.com/impallari/Libre-Franklin)
2 |
3 | This Font Software is licensed under the SIL Open Font License, Version 1.1.
4 | This license is copied below, and is also available with a FAQ at:
5 | http://scripts.sil.org/OFL
6 |
7 |
8 | -----------------------------------------------------------
9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10 | -----------------------------------------------------------
11 |
12 | PREAMBLE
13 | The goals of the Open Font License (OFL) are to stimulate worldwide
14 | development of collaborative font projects, to support the font creation
15 | efforts of academic and linguistic communities, and to provide a free and
16 | open framework in which fonts may be shared and improved in partnership
17 | with others.
18 |
19 | The OFL allows the licensed fonts to be used, studied, modified and
20 | redistributed freely as long as they are not sold by themselves. The
21 | fonts, including any derivative works, can be bundled, embedded,
22 | redistributed and/or sold with any software provided that any reserved
23 | names are not used by derivative works. The fonts and derivatives,
24 | however, cannot be released under any other type of license. The
25 | requirement for fonts to remain under this license does not apply
26 | to any document created using the fonts or their derivatives.
27 |
28 | DEFINITIONS
29 | "Font Software" refers to the set of files released by the Copyright
30 | Holder(s) under this license and clearly marked as such. This may
31 | include source files, build scripts and documentation.
32 |
33 | "Reserved Font Name" refers to any names specified as such after the
34 | copyright statement(s).
35 |
36 | "Original Version" refers to the collection of Font Software components as
37 | distributed by the Copyright Holder(s).
38 |
39 | "Modified Version" refers to any derivative made by adding to, deleting,
40 | or substituting -- in part or in whole -- any of the components of the
41 | Original Version, by changing formats or by porting the Font Software to a
42 | new environment.
43 |
44 | "Author" refers to any designer, engineer, programmer, technical
45 | writer or other person who contributed to the Font Software.
46 |
47 | PERMISSION & CONDITIONS
48 | Permission is hereby granted, free of charge, to any person obtaining
49 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
50 | redistribute, and sell modified and unmodified copies of the Font
51 | Software, subject to the following conditions:
52 |
53 | 1) Neither the Font Software nor any of its individual components,
54 | in Original or Modified Versions, may be sold by itself.
55 |
56 | 2) Original or Modified Versions of the Font Software may be bundled,
57 | redistributed and/or sold with any software, provided that each copy
58 | contains the above copyright notice and this license. These can be
59 | included either as stand-alone text files, human-readable headers or
60 | in the appropriate machine-readable metadata fields within text or
61 | binary files as long as those fields can be easily viewed by the user.
62 |
63 | 3) No Modified Version of the Font Software may use the Reserved Font
64 | Name(s) unless explicit written permission is granted by the corresponding
65 | Copyright Holder. This restriction only applies to the primary font name as
66 | presented to the users.
67 |
68 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69 | Software shall not be used to promote, endorse or advertise any
70 | Modified Version, except to acknowledge the contribution(s) of the
71 | Copyright Holder(s) and the Author(s) or with their explicit written
72 | permission.
73 |
74 | 5) The Font Software, modified or unmodified, in part or in whole,
75 | must be distributed entirely under this license, and must not be
76 | distributed under any other license. The requirement for fonts to
77 | remain under this license does not apply to any document created
78 | using the Font Software.
79 |
80 | TERMINATION
81 | This license becomes null and void if any of the above conditions are
82 | not met.
83 |
84 | DISCLAIMER
85 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93 | OTHER DEALINGS IN THE FONT SOFTWARE.
94 |
--------------------------------------------------------------------------------
/data/filters/normalize/authors.lua:
--------------------------------------------------------------------------------
1 | local List = require 'pandoc.List'
2 | local stringify = pandoc.utils.stringify
3 | local type = pandoc.utils.type
4 |
5 | --- Split a string on the given separator char.
6 | local function split_string (str, sep)
7 | local acc = List()
8 | for substr in str:gmatch('([^' .. sep .. ']*)') do
9 | acc:insert(tostring(substr:gsub('^%s*', ''):gsub('%s*$', ''))) -- trim
10 | end
11 | return acc
12 | end
13 |
14 | local function extract_note(metainlines)
15 | local note = List()
16 | return metainlines:walk {
17 | Note = function (x)
18 | note = pandoc.utils.blocks_to_inlines(x.content)
19 | return {}
20 | end
21 | }, note
22 | end
23 |
24 | local function is_corresponding_author_note (note)
25 | local str = stringify(note)
26 | return str:match '[Cc]orrespond'
27 | end
28 |
29 | local corresponding_authors = List()
30 | local function add_corresponding_author (author)
31 | author.email = author.email and FORMAT:match 'jats'
32 | and stringify(author.email)
33 | or author.email
34 | corresponding_authors:insert(author)
35 | return tostring(#corresponding_authors)
36 | end
37 |
38 | local function is_equal_contributor_note (note)
39 | local str = stringify(note)
40 | return str:match '[Ee]qual' and str:match 'contrib'
41 | end
42 |
43 | -- ORCID
44 | local orcid_pattern =
45 | '^(%d%d%d%d)%-?(%d%d%d%d)%-?(%d%d%d%d)%-?(%d%d%d)([%dXx])$'
46 | local function normalize_orcid (orcid)
47 | if not orcid then
48 | return nil
49 | end
50 | orcid_str = stringify(orcid)
51 |
52 | -- Strictly speaking, an ORCID is an URL, but we allow users to
53 | -- omit schema and host. Keep the digits.
54 | orcid_str = orcid_str:gsub('^https://orcid%.org/', '')
55 | local b1, b2, b3, b4, check = orcid_str:match(orcid_pattern)
56 | if not (b1 and b2 and b3 and b4 and check) then
57 | return nil
58 | end
59 |
60 | local digits = b1 .. b2 .. b3 .. b4
61 |
62 | local total = 0;
63 | for digit in digits:gmatch '.' do
64 | total = (total + tonumber(digit)) * 2
65 | end
66 |
67 | local remainder = total % 11
68 | local result = (12 - remainder) % 11
69 |
70 | local is_valid = result == 10
71 | and check:upper() == "X"
72 | or tonumber(check) == result
73 |
74 | return is_valid
75 | and string.format('%s-%s-%s-%s%s', b1, b2, b3, b4, check)
76 | or nil
77 | end
78 |
79 | return function (meta)
80 | local authors = meta.authors
81 | local affiliations = meta.affiliations
82 | for _, author in ipairs(authors) do
83 | if author.name and
84 | pandoc.List{'string', 'Inlines'}:includes(type(author.name))
85 | then
86 | local name, note = extract_note(author.name)
87 | author.name = name
88 | if is_equal_contributor_note(note) then
89 | author['equal-contrib'] = true
90 | elseif is_corresponding_author_note(note) or
91 | author['corresponding'] then
92 | author['cor-id'] = add_corresponding_author(author)
93 | else
94 | author['note'] = note
95 | end
96 | end
97 | if pandoc.utils.type(author.affiliation) == 'List' then
98 | author.affiliation = author.affiliation
99 | else
100 | author.affiliation = split_string(
101 | stringify(author.affiliation or ''),
102 | ','
103 | )
104 | end
105 | author.orcid = normalize_orcid(author.orcid)
106 | end
107 | for i, aff in ipairs(affiliations or {}) do
108 | aff.id = aff.index or tostring(i)
109 | -- ensure name is not a block
110 | aff.name = aff.name.t ~= 'MetaBlocks'
111 | and aff.name
112 | or pandoc.utils.blocks_to_inlines(aff.name)
113 | end
114 |
115 | -- if there is only a single equal-contributor note, then it usually means
116 | -- that the first two authors contributed equally; set a second mark in that
117 | -- case.
118 | local equal_contribs =
119 | meta.authors:filter(function (auth) return auth['equal-contrib'] end)
120 | if #equal_contribs == 1 and meta.authors[2] then
121 | meta.authors[2]['equal-contrib'] = true
122 | end
123 |
124 | meta.article = meta.article or {}
125 | meta.article['author-notes'] = meta.article['author-notes'] or {}
126 | meta.article['author-notes'].corresp = meta.article['author-notes'].corresp
127 | or (#corresponding_authors > 0 and
128 | corresponding_authors:map(function (auth, i)
129 | local corresp = {id = tostring(i)}
130 | if auth.email then
131 | corresp.email = auth.email
132 | else
133 | corresp.note = "Corresponding author"
134 | end
135 | return corresp
136 | end))
137 | or nil
138 | meta.article['has-equal-contributors'] =
139 | #equal_contribs > 0 or nil
140 |
141 | return meta
142 | end
143 |
--------------------------------------------------------------------------------
/scripts/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Get target formats. Default is to generate both JATS and PDF.
3 | usage()
4 | {
5 | printf "Usage: %s [OPTIONS] INPUT_FILE\n" "$0"
6 | printf 'Options:\n'
7 | printf '\t-l: create log files for all formats\n'
8 | printf '\t-m: article info file; YAML file contains article metadata\n'
9 | printf '\t-o: comma-separated list of output format; defaults to jats,pdf\n'
10 | printf '\t-p: flag to force the production of a publishing PDF\n'
11 | printf '\t-r: flag to produce a retraction-notice publishing PDF\n'
12 | printf '\t-v: increase verbosity; can be given multiple times\n'
13 | }
14 |
15 | args=$(getopt 'lo:m:prv' "$@")
16 | if [ $? -ne 0 ]; then
17 | usage && exit 1
18 | fi
19 | set -- $args
20 | set -e
21 |
22 | outformats=jats,pdf
23 | draft=true
24 | retraction=
25 | log=
26 | article_info_file=
27 | verbosity=0
28 |
29 | while true; do
30 | case "$1" in
31 | (-o)
32 | outformats="${2}";
33 | shift 2
34 | ;;
35 | (-m)
36 | # we switch the directory later, so get the absolute path.
37 | article_info_file="$(realpath "$2")";
38 | shift 2
39 | ;;
40 | (-l)
41 | log=true
42 | shift 1
43 | ;;
44 | (-p)
45 | draft=
46 | shift 1
47 | ;;
48 | (-r)
49 | retraction=true
50 | shift 1
51 | ;;
52 | (-v)
53 | verbosity=$(($verbosity + 1));
54 | shift 1
55 | ;;
56 | (--) shift; break;;
57 | (*) usage; exit 1;;
58 | esac
59 | done
60 |
61 | # The first argument must always be the path to the main paper
62 | # file. The working directory is switched to the folder that the
63 | # paper file is in.
64 | input_path="$(realpath "$1")"
65 | input_file="$(basename "$input_path")"
66 | input_dir="$(dirname "$input_path")"
67 | shift 1
68 |
69 | # Option passed to pandoc so the article metadata is included (if given).
70 | if [ ! -z "$article_info_file" ]; then
71 | article_info_option="--metadata=article-info-file=${article_info_file}"
72 | fi
73 |
74 |
75 | if [ "$verbosity" -ge 1 ]; then
76 | printf 'verbosity : %s\n' "$verbosity"
77 | printf 'input_path : %s\n' "${input_path}"
78 | printf 'input_file : %s\n' "${input_file}"
79 | printf 'input_dir : %s\n' "${input_dir}"
80 | printf 'outformats : %s\n' "${outformats}"
81 | printf 'article_info_file : %s\n' "${article_info_file}"
82 | printf 'article_info_option : %s\n' "${article_info_option}"
83 | fi
84 | if [ "$verbosity" -ge 2 ]; then
85 | if [ -n "${article_info_file}" ] && [ -f "${article_info_file}" ]; then
86 | printf "\nContent of metadata defaults file:\n"
87 | cat "${article_info_file}"
88 | else
89 | printf "No valid metadata defaults file specified.\n"
90 | fi
91 | fi
92 |
93 | # All paths in the document are expected to be relative to the paper
94 | # file.
95 | cd "${input_dir}"
96 |
97 | for format in $(printf "%s" "$outformats" | sed -e 's/,/ /g'); do
98 | if [ "$verbosity" -gt 0 ]; then
99 | printf "Starting conversion to %s...\n" "$format"
100 | fi
101 | if [ -z "$log" ]; then
102 | logfile=/dev/null
103 | else
104 | logfile=paper.${format}.log
105 | fi
106 | extra_args=
107 | if [ "$format" = "jats" ]; then
108 | [ "$verbosity" -gt 0 ] && printf 'Creating folder "paper.jats"\n'
109 | mkdir -p "jats"
110 | fi
111 |
112 | # Notes:
113 | # 1. the output file must be defined in the format's defaults file.
114 | # 2. these assume a different organizational structure than in the
115 | # inara git repo that is created in Docker, in which the contents of
116 | # the resources/ directory is copied into the root directory
117 | # 3. assumes pandoc is in a certain location. Switch `/usr/local/bin/pandoc`
118 | # to just `pandoc` locally, or symlink with
119 | # sudo ln -s $which(pandoc) /usr/local/bin/pandoc
120 | /usr/local/bin/pandoc \
121 | --data-dir="$OPENJOURNALS_PATH"/data \
122 | --defaults=shared \
123 | --defaults="${format}" \
124 | --defaults="$OPENJOURNALS_PATH"/"${JOURNAL}"/defaults.yaml \
125 | ${article_info_option} \
126 | --resource-path=.:${input_dir}:${OPENJOURNALS_PATH} \
127 | --variable="${JOURNAL}" \
128 | --variable=retraction:"$retraction" \
129 | --variable=draft:"$draft" \
130 | --metadata=draft:"$draft" \
131 | --log="$logfile" \
132 | "$input_file" \
133 | "$@" || exit 1
134 | if [ "$verbosity" -gt 0 ]; then
135 | printf "DONE conversion to %s\n" "$format"
136 | fi
137 | done
138 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Path to paper file
2 | ARTICLE = paper.md
3 | # The Journal under which the article is to be published.
4 | # Currently either `joss` or `jose`.
5 | JOURNAL = joss
6 |
7 | # Path to OpenJournals resources like logos, csl style file, etc.
8 | OPENJOURNALS_PATH = resources
9 | # Data path, containing configs, filters.
10 | INARA_DATA_PATH = data
11 | # The pandoc executable
12 | PANDOC = pandoc
13 | # Folder in which the outputs will be placed
14 | TARGET_FOLDER = publishing-artifacts
15 |
16 | ARTICLE_INFO_FILE = $(OPENJOURNALS_PATH)/default-article-info.yaml
17 |
18 | IMAGE = openjournals/inara:edge
19 |
20 | MAKEFILE_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
21 |
22 | .PHONY: all
23 | all: cff pdf tex html jats crossref native preprint
24 |
25 | .PHONY: cff pdf tex html jats crossref native preprint
26 | cff: $(TARGET_FOLDER)/paper.cff
27 | pdf: $(TARGET_FOLDER)/paper.pdf
28 | tex: $(TARGET_FOLDER)/paper.tex
29 | html: $(TARGET_FOLDER)/paper.html
30 | jats: $(TARGET_FOLDER)/paper.jats
31 | native: $(TARGET_FOLDER)/paper.native
32 | crossref: $(TARGET_FOLDER)/paper.crossref
33 | preprint: $(TARGET_FOLDER)/paper.preprint
34 |
35 | $(TARGET_FOLDER)/paper.%: $(ARTICLE) \
36 | $(INARA_DATA_PATH)/defaults/%.yaml \
37 | $(OPENJOURNALS_PATH)/footer.csl \
38 | $(ARTICLE_INFO_FILE) \
39 | $(TARGET_FOLDER)
40 | INARA_ARTIFACTS_PATH=$(TARGET_FOLDER)/ $(PANDOC) \
41 | --data-dir=$(INARA_DATA_PATH) \
42 | --defaults=shared \
43 | --defaults=$*.yaml \
44 | --defaults=$(OPENJOURNALS_PATH)/$(JOURNAL)/defaults.yaml \
45 | --resource-path=.:$(OPENJOURNALS_PATH):$(dir $(ARTICLE)) \
46 | --metadata=article-info-file=$(ARTICLE_INFO_FILE) \
47 | --variable=$(JOURNAL) \
48 | --output=$@ \
49 | $<
50 |
51 | $(TARGET_FOLDER):
52 | mkdir -p $(TARGET_FOLDER)
53 |
54 | .PHONY: docker-image
55 | docker-image: Dockerfile
56 | docker build --force-rm --tag $(IMAGE) .
57 |
58 | push-docker-image:
59 | docker push openjournals/inara
60 |
61 | $(OPENJOURNALS_PATH)/footer.csl: $(OPENJOURNALS_PATH)/apa.csl
62 | sed -e 's/et-al-use-first="[0-9]*"/et-al-use-first="1"/g' \
63 | -e 's/et-al-min="[0-9]*"/et-al-min="3"/g' \
64 | -e 's/et-al-use-last="true"/et-al-use-last="false"/g' \
65 | $< > $@
66 |
67 | .PHONY: clean
68 | clean:
69 | rm -rf $(TARGET_FOLDER)/paper.cff
70 | rm -rf $(TARGET_FOLDER)/paper.crossref
71 | rm -rf $(TARGET_FOLDER)/paper.html
72 | rm -rf $(TARGET_FOLDER)/paper.jats
73 | rm -rf $(TARGET_FOLDER)/paper.native
74 | rm -rf $(TARGET_FOLDER)/paper.tex
75 | rm -rf $(TARGET_FOLDER)/paper.pdf
76 | rm -rf $(TARGET_FOLDER)/paper.preprint
77 | rm -rf $(TARGET_FOLDER)/paper.preprint.tex
78 | rm -rf example/jats
79 | rm -rf example/paper.cff
80 | rm -rf example/paper.crossref
81 | rm -rf example/paper.html
82 | rm -rf example/paper.jats
83 | rm -rf example/paper.native
84 | rm -rf example/paper.tex
85 | rm -rf example/paper.pdf
86 | rm -rf example/paper.preprint
87 | rm -rf example/paper.preprint.tex
88 | rm -rf test/JATS-Publishing-1-2-MathML2-XSD.zip
89 | rm -rf test/JATS-journalpublishing1-elements.xsd
90 | rm -rf test/JATS-journalpublishing1.xsd
91 | rm -rf test/standard-modules
92 | rm -rf /tmp/JATS-Publishing-1-2-MathML2-XSD
93 |
94 |
95 | ## Tests
96 |
97 | # Note that SOURCE_DATE_EPOCH=1234567890 corresponds to 1234567890 seconds
98 | # from the unix epoch (January 1, 1970), which is in 2009
99 |
100 | # Command used to invoke Inara. Sets an environment variable that makes the
101 | # program ignore the real date.
102 | INARA_TEST_CMD = docker run --rm \
103 | --user $(shell id -u):$(shell id -g) \
104 | --env SOURCE_DATE_EPOCH=1234567890 \
105 | -v $${PWD}:/data $(IMAGE)
106 |
107 | # Uncomment this if you want to run tests locally instead of inside docker,
108 | # though note that there might be non-trivial differences that are hard to explain.
109 | # You also have to run `cp -r resources/* .` to copy all of the resource files
110 | # into the root directory, since this makefile relies on this directory structure
111 | # which the dockerfile creates
112 | # INARA_TEST_CMD = SOURCE_DATE_EPOCH=1234567890 JOURNAL=joss OPENJOURNALS_PATH=$(MAKEFILE_DIR) sh scripts/entrypoint.sh
113 |
114 | .PHONY: test test-golden-draft test-golden-pub
115 | test: test-golden-draft test-golden-pub
116 | test-golden-draft: \
117 | test-draft-crossref \
118 | test-draft-jats \
119 | test-draft-tex \
120 | test-draft-preprint
121 | test-golden-pub: \
122 | test-pub-crossref \
123 | test-pub-jats \
124 | test-pub-tex \
125 | test-pub-preprint
126 |
127 | .PHONY: test-pub-jats test-pub-preprint test-pub-%
128 | test-pub-jats:
129 | $(INARA_TEST_CMD) -m test/metadata.yaml -o jats example/paper.md -p
130 | diff test/expected-pub/paper.jats/paper.jats example/jats/paper.jats
131 | test-pub-preprint: GOLDEN_FILE = paper.preprint.tex
132 | test-pub-%: GOLDEN_FILE = paper.$*
133 | test-pub-%:
134 | $(INARA_TEST_CMD) -m test/metadata.yaml -o $* example/paper.md -p
135 | diff test/expected-pub/$(GOLDEN_FILE) example/$(GOLDEN_FILE)
136 |
137 | .PHONY: test-draft-jats test-draft-preprint test-draft-%
138 | test-draft-jats:
139 | $(INARA_TEST_CMD) -o jats example/paper.md
140 | diff test/expected-draft/paper.jats/paper.jats example/jats/paper.jats
141 | test-draft-preprint: GOLDEN_FILE = paper.preprint.tex
142 | test-draft-%: GOLDEN_FILE = paper.$*
143 | test-draft-%:
144 | $(INARA_TEST_CMD) -o $* example/paper.md
145 | diff test/expected-draft/$(GOLDEN_FILE) example/$(GOLDEN_FILE)
146 |
147 | NCBI_FTP = "ftp://ftp.ncbi.nih.gov/pub/jats/publishing/1.2/xsd/"
148 | test/JATS-Publishing-1-2-MathML2-XSD.zip:
149 | curl --output $@ \
150 | "$(NCBI_FTP)/JATS-Publishing-1-2-MathML2-XSD.zip"
151 |
152 | test/JATS-journalpublishing1.xsd: \
153 | test/JATS-Publishing-1-2-MathML2-XSD.zip
154 | unzip -q -d /tmp $<
155 | cp -a /tmp/JATS-Publishing-1-2-MathML2-XSD/* test
156 | rm -rf /tmp/JATS-Publishing-1-2-MathML2-XSD
157 |
158 | .PHONY: validate-jats
159 | validate-jats: test/expected-draft/paper.jats/paper.jats \
160 | test/JATS-journalpublishing1.xsd
161 | xmllint --schema test/JATS-journalpublishing1.xsd $< --noout
162 |
--------------------------------------------------------------------------------
/data/templates/default.crossref:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | $if(doi_batch_id)$${doi_batch_id}$else$${timestamp}$endif$
10 | $timestamp$
11 |
12 | JOSS Admin
13 | admin@theoj.org
14 |
15 | The Open Journal
16 |
17 |
18 |
19 |
20 | $journal.title$
21 | $journal.abbrev-title$
22 | $journal.issn$
23 |
24 | 10.21105/$journal.alias$
25 | $journal.url$
26 |
27 |
28 |
29 |
30 | $month$
31 | $year$
32 |
33 |
34 | $article.volume$
35 |
36 | $article.issue$
37 |
38 |
39 |
40 | $title-meta$
41 |
42 |
43 | $for(authors/first)$
44 |
45 | $if(it.given-names)$
46 | ${it.given-names}
47 | $endif$
48 | $if(it.dropping-particle)$${it.dropping-particle} $endif$$if(it.non-dropping-particle)$${it.non-dropping-particle} $endif$${it.surname}
49 | $if(it.suffix)$
50 | ${it.suffix}
51 | $endif$
52 | $if(it.afxml)$
53 | $it.afxml$
54 | $endif$
55 | $if(it.orcid)$
56 | https://orcid.org/${it.orcid}
57 | $endif$
58 |
59 | $endfor$
60 | $for(authors/rest)$
61 |
63 | $if(it.given-names)$
64 | ${it.given-names}
65 | $endif$
66 | $if(it.dropping-particle)$${it.dropping-particle} $endif$$if(it.non-dropping-particle)$${it.non-dropping-particle} $endif$${it.surname}
67 | $if(it.suffix)$
68 | ${it.suffix}
69 | $endif$
70 | $if(it.afxml)$
71 | $it.afxml$
72 | $endif$
73 | $if(it.orcid)$
74 | https://orcid.org/${it.orcid}
75 | $endif$
76 |
77 | $endfor$
78 |
79 |
80 | $month$
81 | $day$
82 | $year$
83 |
84 |
85 | $article.fpage$
86 |
87 |
88 | $article.doi$
89 |
90 |
91 | http://creativecommons.org/licenses/by/4.0/
92 | http://creativecommons.org/licenses/by/4.0/
93 | http://creativecommons.org/licenses/by/4.0/
94 |
95 |
96 |
97 | Software archive
98 | $archive_doi$
99 |
100 |
101 | GitHub review issue
102 | $software_review_url$
103 |
104 |
105 |
106 | $article.doi$
107 | $journal.url$/papers/$article.doi$
108 |
109 | -
110 | $journal.url$/papers/${article.doi}.pdf
111 |
112 |
113 |
114 |
115 | $for(references)$
116 |
117 | $if(it.title)$
118 | $if(it.isbook)$
119 | ${it.title}
120 | $else$
121 | ${it.title}
122 | $endif$
123 | $endif$
124 | $for(it.author/first)$
125 | $if(it.family)$${it.family}$else$$if(it.name)$${it.name}$else$${it.literal}$endif$$endif$
126 | $endfor$
127 | $if(it.container-title)$
128 | $if(it.isbook)$
129 | ${it.container-title}
130 | $else$
131 | ${it.container-title}
132 | $endif$
133 | $endif$
134 | $if(it.page-first)$
135 | ${it.page-first}
136 | $endif$
137 | $if(it.issue)$
138 | ${it.issue}
139 | $endif$
140 | $if(it.volume)$
141 | ${it.volume}
142 | $endif$
143 | $if(it.doi)$
144 | ${it.doi}
145 | $endif$
146 | $if(it.issn)$
147 | ${it.issn}
148 | $endif$
149 | $if(it.isbn)$
150 | ${it.isbn}
151 | $endif$
152 | $for(it.issued)$
153 | $for(it.date-parts)$
154 | $if(it/first)$
155 | ${it/first}
156 | $endif$
157 | $endfor$
158 | $endfor$
159 | ${it.unstructured_citation}
160 |
161 | $endfor$
162 |
163 |
164 |
165 |
166 |
167 |
--------------------------------------------------------------------------------
/test/expected-draft/paper.crossref:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | 20090213233130-7df7772968726f2a3c347b21a6d3257f38f7c870
10 | 20090213233130
11 |
12 | JOSS Admin
13 | admin@theoj.org
14 |
15 | The Open Journal
16 |
17 |
18 |
19 |
20 | Journal of Open Source Software
21 | JOSS
22 | 2475-9066
23 |
24 | 10.21105/joss
25 | https://joss.theoj.org
26 |
27 |
28 |
29 |
30 | 01
31 | 1970
32 |
33 |
34 | ¿VOL?
35 |
36 | ¿ISSUE?
37 |
38 |
39 |
40 | Article Writing with Markdown and the Open Journals publishing pipeline
41 |
42 |
43 |
44 | Albert
45 | Krewinkel
46 |
47 | Open Journals
48 | Pandoc Development Team
49 | Technische Universitaet Hamburghttps://ror.org/04bs1pb34
50 |
51 | https://orcid.org/0000-0002-9455-0796
52 |
53 |
55 | Juanjo
56 | Bazán
57 |
58 | Open Journals
59 |
60 | https://orcid.org/0000-0001-7699-3983
61 |
62 |
64 | Arfon M.
65 | Smith
66 |
67 | Open Journals
68 | GitHub
69 |
70 | https://orcid.org/0000-0002-3957-2474
71 |
72 |
73 |
74 | 01
75 | 01
76 | 1970
77 |
78 |
79 | ¿PAGE?
80 |
81 |
82 | N/A
83 |
84 |
85 | http://creativecommons.org/licenses/by/4.0/
86 | http://creativecommons.org/licenses/by/4.0/
87 | http://creativecommons.org/licenses/by/4.0/
88 |
89 |
90 |
91 | Software archive
92 | 10.5281
93 |
94 |
95 | GitHub review issue
96 | https://github.com/openjournals
97 |
98 |
99 |
100 | N/A
101 | https://joss.theoj.org/papers/N/A
102 |
103 | -
104 | https://joss.theoj.org/papers/N/A.pdf
105 |
106 |
107 |
108 |
109 |
110 | The unsuccessful self-treatment of a case of "writer’s block"
111 | Upper
112 | Journal of Applied Behavior Analysis
113 | 3
114 | 7
115 | 10.1901/jaba.1974.7-497a
116 | 0021-8855
117 | 1974
118 | Upper, D. (1974). The unsuccessful self-treatment of a case of "writer’s block". Journal of Applied Behavior Analysis, 7(3), 497. https://doi.org/10.1901/jaba.1974.7-497a
119 |
120 |
121 | Journal of open source software (JOSS): Design and first-year review
122 | Smith
123 | PeerJ Computer Science
124 | 4
125 | 10.7717/peerj-cs.147
126 | 2376-5992
127 | 2018
128 | Smith, A. M., Niemeyer, K. E., Katz, D. S., Barba, L. A., Githinji, G., Gymrek, M., Huff, K. D., Madan, C. R., Cabunoc Mayes, A., Moerman, K. M., Prins, P., Ram, K., Rokem, A., Teal, T. K., Valls Guimera, R., & Vanderplas, J. T. (2018). Journal of open source software (JOSS): Design and first-year review. PeerJ Computer Science, 4, e147. https://doi.org/10.7717/peerj-cs.147
129 |
130 |
131 | Formatting open science: Agilely creating multiple document formats for academic manuscripts with pandoc scholar
132 | Krewinkel
133 | PeerJ Computer Science
134 | 3
135 | 10.7717/peerj-cs.112
136 | 2376-5992
137 | 2017
138 | Krewinkel, A., & Winkler, R. (2017). Formatting open science: Agilely creating multiple document formats for academic manuscripts with pandoc scholar. PeerJ Computer Science, 3, e112. https://doi.org/10.7717/peerj-cs.112
139 |
140 |
141 | The Official YAML Web Site
142 | 2022
143 | The Official YAML Web Site. (2022, April 19). https://yaml.org/
144 |
145 |
146 | Document management – electronic document file format for long-term preservation – part 3: Use of ISO 32000-1 with support for embedded files (PDF/A-3)
147 | 2012
148 | Document management – electronic document file format for long-term preservation – part 3: Use of ISO 32000-1 with support for embedded files (PDF/A-3). (2012). [Standard]. International Organization for Standardization.
149 |
150 |
151 |
152 |
153 |
154 |
155 |
--------------------------------------------------------------------------------
/test/expected-pub/paper.crossref:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | 20090213233130-7df7772968726f2a3c347b21a6d3257f38f7c870
10 | 20090213233130
11 |
12 | JOSS Admin
13 | admin@theoj.org
14 |
15 | The Open Journal
16 |
17 |
18 |
19 |
20 | Journal of Open Source Software
21 | JOSS
22 | 2475-9066
23 |
24 | 10.21105/joss
25 | https://joss.theoj.org
26 |
27 |
28 |
29 |
30 | 05
31 | 2020
32 |
33 |
34 | 0
35 |
36 | 5
37 |
38 |
39 |
40 | Article Writing with Markdown and the Open Journals publishing pipeline
41 |
42 |
43 |
44 | Albert
45 | Krewinkel
46 |
47 | Open Journals
48 | Pandoc Development Team
49 | Technische Universitaet Hamburghttps://ror.org/04bs1pb34
50 |
51 | https://orcid.org/0000-0002-9455-0796
52 |
53 |
55 | Juanjo
56 | Bazán
57 |
58 | Open Journals
59 |
60 | https://orcid.org/0000-0001-7699-3983
61 |
62 |
64 | Arfon M.
65 | Smith
66 |
67 | Open Journals
68 | GitHub
69 |
70 | https://orcid.org/0000-0002-3957-2474
71 |
72 |
73 |
74 | 05
75 | 23
76 | 2020
77 |
78 |
79 | 00000
80 |
81 |
82 | 10.21105/joss.00000
83 |
84 |
85 | http://creativecommons.org/licenses/by/4.0/
86 | http://creativecommons.org/licenses/by/4.0/
87 | http://creativecommons.org/licenses/by/4.0/
88 |
89 |
90 |
91 | Software archive
92 | 10.5281/zenodo.00000000
93 |
94 |
95 | GitHub review issue
96 | https://github.com/openjournals/inara/issues
97 |
98 |
99 |
100 | 10.21105/joss.00000
101 | https://joss.theoj.org/papers/10.21105/joss.00000
102 |
103 | -
104 | https://joss.theoj.org/papers/10.21105/joss.00000.pdf
105 |
106 |
107 |
108 |
109 |
110 | The unsuccessful self-treatment of a case of "writer’s block"
111 | Upper
112 | Journal of Applied Behavior Analysis
113 | 3
114 | 7
115 | 10.1901/jaba.1974.7-497a
116 | 0021-8855
117 | 1974
118 | Upper, D. (1974). The unsuccessful self-treatment of a case of "writer’s block". Journal of Applied Behavior Analysis, 7(3), 497. https://doi.org/10.1901/jaba.1974.7-497a
119 |
120 |
121 | Journal of open source software (JOSS): Design and first-year review
122 | Smith
123 | PeerJ Computer Science
124 | 4
125 | 10.7717/peerj-cs.147
126 | 2376-5992
127 | 2018
128 | Smith, A. M., Niemeyer, K. E., Katz, D. S., Barba, L. A., Githinji, G., Gymrek, M., Huff, K. D., Madan, C. R., Cabunoc Mayes, A., Moerman, K. M., Prins, P., Ram, K., Rokem, A., Teal, T. K., Valls Guimera, R., & Vanderplas, J. T. (2018). Journal of open source software (JOSS): Design and first-year review. PeerJ Computer Science, 4, e147. https://doi.org/10.7717/peerj-cs.147
129 |
130 |
131 | Formatting open science: Agilely creating multiple document formats for academic manuscripts with pandoc scholar
132 | Krewinkel
133 | PeerJ Computer Science
134 | 3
135 | 10.7717/peerj-cs.112
136 | 2376-5992
137 | 2017
138 | Krewinkel, A., & Winkler, R. (2017). Formatting open science: Agilely creating multiple document formats for academic manuscripts with pandoc scholar. PeerJ Computer Science, 3, e112. https://doi.org/10.7717/peerj-cs.112
139 |
140 |
141 | The Official YAML Web Site
142 | 2022
143 | The Official YAML Web Site. (2022, April 19). https://yaml.org/
144 |
145 |
146 | Document management – electronic document file format for long-term preservation – part 3: Use of ISO 32000-1 with support for embedded files (PDF/A-3)
147 | 2012
148 | Document management – electronic document file format for long-term preservation – part 3: Use of ISO 32000-1 with support for embedded files (PDF/A-3). (2012). [Standard]. International Organization for Standardization.
149 |
150 |
151 |
152 |
153 |
154 |
155 |
--------------------------------------------------------------------------------
/example/paper.bib:
--------------------------------------------------------------------------------
1 | @article{bradford1976,
2 | title = {A Rapid and Sensitive Method for the Quantitation of Microgram
3 | Quantities of Protein Utilizing the Principle of Protein-Dye
4 | Binding},
5 | author = {Bradford, Marion M.},
6 | date = {1976},
7 | journaltitle = {Analytical Biochemistry},
8 | volume = {72},
9 | number = {1},
10 | pages = {248--254},
11 | issn = {0003-2697},
12 | doi = {10.1016/0003-2697(76)90527-3},
13 | url = {https://www.sciencedirect.com/science/article/pii/0003269776905273},
14 | abstract = {A protein determination method which involves the binding of
15 | Coomassie Brilliant Blue G-250 to protein is described. The
16 | binding of the dye to protein causes a shift in the absorption
17 | maximum of the dye from 465 to 595 nm, and it is the increase
18 | in absorption at 595 nm which is monitored. This assay is very
19 | reproducible and rapid with the dye binding process virtually
20 | complete in approximately 2 min with good color stability for
21 | 1 hr. There is little or no interference from cations such as
22 | sodium or potassium nor from carbohydrates such as sucrose. A
23 | small amount of color is developed in the presence of strongly
24 | alkaline buffering agents, but the assay may be run accurately
25 | by the use of proper buffer controls. The only components
26 | found to give excessive interfering color in the assay are
27 | relatively large amounts of detergents such as sodium dodecyl
28 | sulfate, Triton X-100, and commercial glassware detergents.
29 | Interference by small amounts of detergent may be eliminated
30 | by the use of proper controls.}
31 | }
32 |
33 | @online{chatops,
34 | title = {Chatops-{{Driven Publishing}} | {{Arfon Smith}}},
35 | author = {Smith, Arfon},
36 | url = {https://www.arfon.org/chatops-driven-publishing},
37 | urldate = {2022-04-22},
38 | keywords = {joss,whedon},
39 | }
40 | @article{upper1974,
41 | title = {The Unsuccessful Self-Treatment of a Case of "Writer's Block"},
42 | author = {Upper, D.},
43 | date = {1974},
44 | journaltitle = {Journal of Applied Behavior Analysis},
45 | shortjournal = {J Appl Behav Anal},
46 | volume = {7},
47 | number = {3},
48 | eprint = {16795475},
49 | eprinttype = {pmid},
50 | pages = {497},
51 | issn = {0021-8855},
52 | doi = {10.1901/jaba.1974.7-497a},
53 | langid = {english},
54 | pmcid = {PMC1311997},
55 | }
56 |
57 | @article{smith2018,
58 | title = {Journal of Open Source Software (JOSS): design and first-year review},
59 | author = {Smith, Arfon M. and Niemeyer, Kyle E. and Katz, Daniel S. and Barba,
60 | Lorena A. and Githinji, George and Gymrek, Melissa and Huff,
61 | Kathryn D. and Madan, Christopher R. and Cabunoc Mayes,
62 | Abigail and Moerman, Kevin M. and Prins, Pjotr and Ram,
63 | Karthik and Rokem, Ariel and Teal, Tracy K. and Valls Guimera,
64 | Roman and Vanderplas, Jacob T.},
65 | year = 2018,
66 | month = feb,
67 | keywords = {Research software, Code review, Computational research, Software
68 | citation, Open-source software, Scholarly publishing},
69 | abstract = { This article describes the motivation, design, and progress of
70 | the Journal of Open Source Software (JOSS). JOSS is a free and
71 | open-access journal that publishes articles describing
72 | research software. It has the dual goals of improving the
73 | quality of the software submitted and providing a mechanism
74 | for research software developers to receive credit. While
75 | designed to work within the current merit system of science,
76 | JOSS addresses the dearth of rewards for key contributions to
77 | science made in the form of software. JOSS publishes articles
78 | that encapsulate scholarship contained in the software itself,
79 | and its rigorous peer review targets the software components:
80 | functionality, documentation, tests, continuous integration,
81 | and the license. A JOSS article contains an abstract
82 | describing the purpose and functionality of the software,
83 | references, and a link to the software archive. The article is
84 | the entry point of a JOSS submission, which encompasses the
85 | full set of software artifacts. Submission and review proceed
86 | in the open, on GitHub. Editors, reviewers, and authors work
87 | collaboratively and openly. Unlike other journals, JOSS does
88 | not reject articles requiring major revision; while not yet
89 | accepted, articles remain visible and under review until the
90 | authors make adequate changes (or withdraw, if unable to meet
91 | requirements). Once an article is accepted, JOSS gives it a
92 | digital object identifier (DOI), deposits its metadata in
93 | Crossref, and the article can begin collecting citations on
94 | indexers like Google Scholar and other services. Authors
95 | retain copyright of their JOSS article, releasing it under a
96 | Creative Commons Attribution 4.0 International License. In its
97 | first year, starting in May 2016, JOSS published 111 articles,
98 | with more than 40 additional articles under review. JOSS is a
99 | sponsored project of the nonprofit organization NumFOCUS and
100 | is an affiliate of the Open Source Initiative (OSI). },
101 | volume = 4,
102 | pages = {e147},
103 | journal = {PeerJ Computer Science},
104 | issn = {2376-5992},
105 | url = {https://doi.org/10.7717/peerj-cs.147},
106 | doi = {10.7717/peerj-cs.147}
107 | }
108 |
109 | @article{krewinkel2017,
110 | title = {Formatting Open Science: agilely creating multiple document formats for academic manuscripts with Pandoc Scholar},
111 | author = {Krewinkel, Albert and Winkler, Robert},
112 | year = 2017,
113 | month = may,
114 | keywords = {Open science, Markdown, Latex, Publishing, Typesetting, Document formats},
115 | abstract = { The timely publication of scientific results is essential for
116 | dynamic advances in science. The ubiquitous availability of
117 | computers which are connected to a global network made the
118 | rapid and low-cost distribution of information through
119 | electronic channels possible. New concepts, such as Open
120 | Access publishing and preprint servers are currently changing
121 | the traditional print media business towards a
122 | community-driven peer production. However, the cost of
123 | scientific literature generation, which is either charged to
124 | readers, authors or sponsors, is still high. The main active
125 | participants in the authoring and evaluation of scientific
126 | manuscripts are volunteers, and the cost for online publishing
127 | infrastructure is close to negligible. A major time and cost
128 | factor is the formatting of manuscripts in the production
129 | stage. In this article we demonstrate the feasibility of
130 | writing scientific manuscripts in plain markdown (MD) text
131 | files, which can be easily converted into common publication
132 | formats, such as PDF, HTML or EPUB, using Pandoc. The simple
133 | syntax of Markdown assures the long-term readability of raw
134 | files and the development of software and workflows. We show
135 | the implementation of typical elements of scientific
136 | manuscripts—formulas, tables, code blocks and citations—and
137 | present tools for editing, collaborative writing and version
138 | control. We give an example on how to prepare a manuscript
139 | with distinct output formats, a DOCX file for submission to a
140 | journal, and a LATEX/PDF version for deposition as a PeerJ
141 | preprint. Further, we implemented new features for supporting
142 | ‘semantic web’ applications, such as the ‘journal article tag
143 | suite’—JATS, and the ‘citation typing ontology’—CiTO standard.
144 | Reducing the work spent on manuscript formatting translates
145 | directly to time and cost savings for writers, publishers,
146 | readers and sponsors. Therefore, the adoption of the MD format
147 | contributes to the agile production of open science
148 | literature. Pandoc Scholar is freely available from
149 | https://github.com/pandoc-scholar. },
150 | volume = 3,
151 | pages = {e112},
152 | journal = {PeerJ Computer Science},
153 | issn = {2376-5992},
154 | url = {https://doi.org/10.7717/peerj-cs.112},
155 | doi = {10.7717/peerj-cs.112}
156 | }
157 |
158 | @online{yaml_website,
159 | title = {The {{Official YAML Web Site}}},
160 | url = {https://yaml.org/},
161 | keywords = {YAML},
162 | date = {2022-04-19},
163 | urldate = {2022-04-19},
164 | }
165 |
166 | @techreport{pdfa3,
167 | type = {Standard},
168 | key = {ISO 19005-3:2012},
169 | date = {2012-10},
170 | title = {Document management – Electronic document file format for long-term
171 | preservation – Part 3: Use of {ISO} 32000-1 with support for
172 | embedded files ({PDF/A-3})},
173 | address = {Geneva, CH},
174 | institution = {International Organization for Standardization}
175 | }
176 |
177 | @software{quarto,
178 | author = {Allaire, J.J. and Teague, Charles and Scheidegger, Carlos and Xie, Yihui and Dervieux, Christophe},
179 | doi = {10.5281/zenodo.5960048},
180 | month = {1},
181 | title = {{Quarto}},
182 | url = {https://github.com/quarto-dev/quarto-cli},
183 | version = {0.3},
184 | year = {2022}
185 | }
186 |
187 |
--------------------------------------------------------------------------------
/example/paper.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: >-
3 | Article Writing with Markdown and the Open Journals publishing pipeline
4 | authors:
5 | - name: Albert Krewinkel
6 | email: albert@zeitkraut.de
7 | affiliation: "1, 2, 4"
8 | orcid: 0000-0002-9455-0796
9 | corresponding: true
10 | - name: Juanjo Bazán
11 | orcid: 0000-0001-7699-3983
12 | affiliation: [1]
13 | equal-contrib: true
14 | - name: Arfon M. Smith
15 | orcid: 0000-0002-3957-2474
16 | affiliation: [1, 3]
17 | equal-contrib: true
18 | affiliations:
19 | - index: 1
20 | name: Open Journals
21 | - index: 2
22 | name: Pandoc Development Team
23 | - index: 3
24 | name: GitHub
25 | - index: 4
26 | name: Technische Universitaet Hamburg
27 | ror: 04bs1pb34
28 | date: 2022-06-29
29 | bibliography: paper.bib
30 | tags:
31 | - reference
32 | - example
33 | - markdown
34 | - publishing
35 | ---
36 |
37 | # Summary
38 |
39 | This article describes the features of the Journal of Open Source
40 | Software [@smith2018] publishing pipeline. The publishing method
41 | is similar to the model described by @krewinkel2017, in that
42 | Markdown is used as the input format. The author-provided files
43 | serves as the source for all generated publishing artifacts.
44 |
45 | Apart from the main text, articles should also provide a metadata
46 | section at the beginning of this article is formatted using
47 | [YAML], a human-friendly data serialization language
48 | [@yaml_website]. This information is included in the title and
49 | sidebar of the generated PDF.
50 |
51 | Authors who face difficulties while writing are referred to the
52 | paper by @upper1974.
53 |
54 | [YAML]: https://yaml.org
55 |
56 | # Statement of Need
57 |
58 | The journal publisher, in most cases where you'd be reading this, Open
59 | Journals, maintains a detailed and helpful
60 | [article](https://joss.readthedocs.io/en/latest/submitting.html) on the
61 | requirements that articles must satisfy in order to be considered for
62 | publication in that journal. However, submission requirements do not
63 | help with the technical aspects of paper writing. The process for JOSS
64 | and similar journals is different, in that the paper should be written
65 | in the lightweight markup language *Markdown*.
66 |
67 | This article explains the technical details and describes the publishing
68 | system's capabilities. It can also be used as a test document, or serve
69 | as a template that can be used as a starting point.
70 |
71 | # Markdown primer
72 |
73 | Markdown is based on email conventions. It was developed by John Gruber
74 | and Aaron Swartz. This section provides a brief introduction to Markdown
75 | syntax. Certain details or alternatives will be omitted,
76 |
77 | If you are already familiar with Markdown, then you may want to skip
78 | this section and continue with the description of [article metadata].
79 |
80 | ## Inline markup
81 |
82 | The markup in Markdown should be semantic, not presentations. The table
83 | below gives a small example.
84 |
85 | +---------------------+-------------------------+-----------------------+
86 | | Markup | Markdown example | Rendered output |
87 | +:====================+:=======================:+:=====================:+
88 | | emphasis | `*this*` | *this* |
89 | +---------------------+-------------------------+-----------------------+
90 | | strong emphasis | `**that**` | **that** |
91 | +---------------------+-------------------------+-----------------------+
92 | | strikeout | `~~not this~~` | ~~not this~~ |
93 | +---------------------+-------------------------+-----------------------+
94 | | subscript | `H~2~O` | H~2~O |
95 | +---------------------+-------------------------+-----------------------+
96 | | superscript | `Ca^2+^` | Ca^2+^ |
97 | +---------------------+-------------------------+-----------------------+
98 | | underline | `[underline]{.ul}` | [underline]{.ul} |
99 | +---------------------+-------------------------+-----------------------+
100 | | inline code | `` `return 23` `` | `return 23` |
101 | +---------------------+-------------------------+-----------------------+
102 |
103 | : Basic inline markup and examples.
104 |
105 | ### Links
106 |
107 | Link syntax is `[link description](targetURL)`. E.g., this link to the
108 | [Journal of Open Source Software](https://joss.theoj.org/) is written as \
109 | `[Journal of Open Source Software](https://joss.theoj.org/)`.
110 |
111 | Open Journal publications are not limited by the constraints of print
112 | publications. We encourage authors to use hyperlinks for websites and
113 | other external resources. However, the standard scientific practice of
114 | citing the relevant publications should be followed regardless.
115 |
116 | ### Images
117 |
118 | Markdown syntax for an image is that of a link, preceded by an
119 | exclamation mark `!`.
120 |
121 | The main use of images in papers is within figures. An image is treated
122 | as a figure if
123 |
124 | 1. it has a non-empty description, which will be used as the figure
125 | label and
126 | 2. it is the only element in a paragraph, i.e., it must be surrounded by
127 | blank lines.
128 |
129 | Example:
130 |
131 | ```markdown
132 | 
133 | ```
134 |
135 | Images that are larger than the text area are scaled to fit the page. It
136 | can sometimes be useful to give images an explicit height and/or width,
137 | e.g. when adding an image as part of a paragraph. The Markdown `{height="9pt"}` includes the image "nyan-cat.png"
139 | {height="9pt"} while scaling it to a height of
140 | 9 pt.
141 |
142 |
143 | {#fig:mandrill}
146 |
147 | ### Citations
148 |
149 | Bibliographic data should be collected in a file `paper.bib`; it
150 | should be formatted in the BibLaTeX format, although plain BibTeX
151 | is acceptable as well. All major citation managers offer to export
152 | these formats.
153 |
154 | Cite a bibliography entry by referencing its identifier:
155 | `[@upper1974]` will create the reference "[@upper1974]". Omit the
156 | brackets when referring to the author as part of a sentence: "For
157 | a case study on writers block, see @upper1974." Please refer to
158 | the [pandoc manual](https://pandoc.org/MANUAL#extension-citations)
159 | for additional features, including page locators, prefixes,
160 | suffixes, and suppression of author names in citations.
161 |
162 | ### Mathematical Formulæ
163 |
164 | Equations and other math content has is marked by dollar signs (`$`). A
165 | single dollar sign should be used for math that will appear directly
166 | within the text, and `$$` should be used when the formula is to be
167 | presented in "display" style, i.e., centered and on a separate line. The
168 | formula itself must be given using TeX syntax.
169 |
170 | To give some examples: When discussing a variable $x$ or a short formula
171 | like $\sin \frac{\pi}{2}$, we would write `$x$` and `$\sin
172 | \frac{\pi}{2}$`, respectively. However, for more complex formulæ,
173 | display style is more appropriate. Writing `$$\int_{-\infty}^{+\infty}
174 | e^{-x^2} \, dx = \sqrt{\pi}$$` will give us
175 |
176 | $$\int_{-\infty}^{+\infty} e^{-x^2} \, dx = \sqrt{\pi}$$
177 |
178 | Numbered equations and internal cross-references are discussed
179 | [futher below][Equations].
180 |
181 | ### Footnotes
182 |
183 | Syntax for footnotes centers around the "caret" character `^`. The
184 | symbol is also used as a delimiter for superscript text and thereby
185 | mirrors the superscript numbers used to mark a footnote in the final
186 | text.[^markers]
187 |
188 | ``` markdown
189 | Articles are published under a Creative Commons license[^1].
190 | Software should use an OSI-approved license.
191 |
192 | [^1]: An open license that allows reuse.
193 | ```
194 |
195 | Note numbers do not have to be sequential, they will be reordered
196 | automatically in the publishing step. In fact, the identifier of a note
197 | can be any sequence of characters, like `[^marker]`, but may not contain
198 | whitespace characters.
199 |
200 | [^markers]: Although it should be noted that some publishers prefer
201 | symbols or letters as footnote markers.
202 |
203 | The above example results in the following output:
204 |
205 | > Articles are published under a Creative Commons license[^1].
206 | > Software should use an OSI-approved license.
207 | >
208 | > [^1]: An open license that allows reuse.
209 |
210 |
211 | ## Blocks
212 |
213 | The larger components of a document are called "blocks".
214 |
215 | ### Headings
216 |
217 | Headings are added with `#` followed by a space, where each additional
218 | `#` demotes the heading to a level lower in the hierarchy:
219 |
220 | ```markdown
221 | # Section
222 |
223 | ## Subsection
224 |
225 | ### Subsubsection
226 | ```
227 |
228 | Please start headings on the first level. The maximum supported level is
229 | 5, but paper authors should usually try to limit themselves to headings
230 | of the first two or three levels.
231 |
232 | #### Deeper nesting
233 |
234 | Forth- and fifth-level subsections – like this one and the following
235 | heading – are supported by the system; however, their use is
236 | discouraged.
237 |
238 | ##### Avoiding excessive nesting
239 |
240 | Usually [lists], as described in the next section, should be preferred
241 | over forth- and fifth-level headings.
242 |
243 |
244 | ### Lists
245 |
246 | Bullet lists and numbered lists, a.k.a. enumerations, offer an
247 | additional method to present sequential and hierarchical information.
248 |
249 | ``` markdown
250 | - apples
251 | - citrus fruits
252 | - lemons
253 | - oranges
254 | ```
255 |
256 | - apples
257 | - citrus fruits
258 | - lemons
259 | - oranges
260 |
261 | Enumerations start with the number of the first item. Using the the
262 | first two [laws of
263 | thermodynamics](https://en.wikipedia.org/wiki/Laws_of_thermodynamics) as
264 | example.
265 |
266 | ``` markdown
267 | 0. If two systems are each in thermal equilibrium with a third, they are
268 | also in thermal equilibrium with each other.
269 | 1. In a process without transfer of matter, the change in internal
270 | energy, $\Delta U$, of a thermodynamic system is equal to the energy
271 | gained as heat, $Q$, less the thermodynamic work, $W$, done by the
272 | system on its surroundings. $$\Delta U = Q - W$$
273 | ```
274 |
275 | Rendered:
276 |
277 | 0. If two systems are each in thermal equilibrium with a third, they are
278 | also in thermal equilibrium with each other.
279 | 1. In a process without transfer of matter, the change in internal
280 | energy, $\Delta U$, of a thermodynamic system is equal to the energy
281 | gained as heat, $Q$, less the thermodynamic work, $W$, done by the
282 | system on its surroundings. $$\Delta U = Q - W$$
283 |
284 |
285 | # Article metadata
286 |
287 | ## Names
288 |
289 | Providing an author name is straight-forward: just set the `name`
290 | attribute. However, sometimes fine-grained control over the name
291 | is required.
292 |
293 | ### Name parts
294 |
295 | There are many ways to describe the parts of names; we support the
296 | following:
297 |
298 | - given names,
299 | - surname,
300 | - dropping particle,
301 | - non-dropping particle,
302 | - and suffix.
303 |
304 | We use a heuristic to parse names into these components. This
305 | parsing may produce the wrong result, in which case it is
306 | necessary to provide the relevant parts explicitly.
307 |
308 | The respective field names are
309 |
310 | - `given-names` (aliases: `given`, `first`, `firstname`)
311 | - `surname` (aliases: `family`)
312 | - `suffix`
313 |
314 | The full display name will be constructed from these parts, unless
315 | the `name` attribute is given as well.
316 |
317 | ### Particles
318 |
319 | It's usually enough to place particles like "van", "von", "della",
320 | etc. at the end of the given name or at the beginning of the
321 | surname, depending on the details of how the name is used.
322 |
323 | - `dropping-particle`
324 | - `non-dropping-particle`
325 |
326 | ### Literal names
327 |
328 | The automatic construction of the full name from parts is geared
329 | towards common Western names. It may therefore be necessary
330 | sometimes to provide the display name explicitly. This is possible
331 | by setting the `literal` field,
332 | e.g., `literal: Tachibana Taki`. This feature should only be used
333 | as a last resort.
334 |
335 | ### Example
336 |
337 | ```yaml
338 | authors:
339 | - name: John Doe
340 | affiliation: '1'
341 |
342 | - given-names: Ludwig
343 | dropping-particle: van
344 | surname: Beethoven
345 | affiliation: '3'
346 |
347 | # not recommended, but common aliases can be used for name parts.
348 | - given: Louis
349 | non-dropping-particle: de
350 | family: Broglie
351 | affiliation: '4'
352 | ```
353 |
354 | The name parts can also be collected under the author's `name`:
355 |
356 | ``` yaml
357 | authors:
358 | - name:
359 | given-names: Kari
360 | surname: Nordmann
361 | ```
362 |
363 |
364 |
365 |
366 |
367 |
368 | ## Affiliations
369 |
370 | Each affiliation requires an `index` and `name`.
371 |
372 | Optionally, the Research Organization Registry (ROR) identifier for the top-level
373 | organization can be annotated with the `ror` key. Note that ROR does not include
374 | departments in its [scope](https://ror.org/registry/#scope-and-criteria-for-inclusion),
375 | so ROR annotations are typically made to the top-level organization.
376 |
377 | ```yaml
378 | authors:
379 | - name: Albert Krewinkel
380 | affiliation: [ 1, 2, 3 ]
381 |
382 | affiliations:
383 | - index: 1
384 | name: Open Journals
385 | - index: 2
386 | name: Pandoc Development Team
387 | - index: 3
388 | name: Technische Universitaet Hamburg
389 | ror: 04bs1pb34
390 | ```
391 |
392 | # Internal references
393 |
394 | Markdown has no default mechanism to handle document internal
395 | references, often called "cross-references". This conflicts with goal of
396 | [Open Journals] is to provide authors with a seamless and pleasant
397 | writing experience. This includes convenient cross-reference generation,
398 | which is why a limited set of LaTeX commands are supported. In a
399 | nutshell, elements that were marked with `\label` and can be referenced
400 | with `\ref` and `\autoref`.
401 |
402 | [Open Journals]: https://theoj.org
403 |
404 | {#sylt width="100%"}
407 |
408 | ## Tables and figures
409 |
410 | Tables and figures can be referenced if they are given a *label*
411 | in the caption. In pure Markdown, this can be done by adding an
412 | empty span `[]{label="floatlabel"}` to the caption. LaTeX syntax
413 | is supported as well: `\label{floatlabel}`.
414 |
415 | Link to a float element, i.e., a table or figure, with
416 | `\ref{identifier}` or `\autoref{identifier}`, where `identifier`
417 | must be defined in the float's caption. The former command results
418 | in just the float's number, while the latter inserts the type and
419 | number of the referenced float. E.g., in this document
420 | `\autoref{proglangs}` yields "\autoref{proglangs}", while
421 | `\ref{proglangs}` gives "\ref{proglangs}".
422 |
423 | : Comparison of programming languages used in the publishing tool.
424 | []{label="proglangs"}
425 |
426 | | Language | Typing | Garbage Collected | Evaluation | Created |
427 | |----------|:---------------:|:-----------------:|------------|---------|
428 | | Haskell | static, strong | yes | non-strict | 1990 |
429 | | Lua | dynamic, strong | yes | strict | 1993 |
430 | | C | static, weak | no | strict | 1972 |
431 |
432 | ## Equations
433 |
434 | Cross-references to equations work similar to those for floating
435 | elements. The difference is that, since captions are not supported
436 | for equations, the label must be included in the equation:
437 |
438 | $$a^n + b^n = c^n \label{fermat}$$
439 |
440 | Referencing, however, is identical, with `\autoref{eq:fermat}`
441 | resulting in "\autoref{eq:fermat}".
442 |
443 | $$a^n + b^n = c^n \label{eq:fermat}$$
444 |
445 | Authors who do not wish to include the label directly in the formula can use a Markdown span to add the label:
446 |
447 | [$$a^n + b^n = c^n$$]{label="eq:fermat"}
448 |
449 | # Behind the scenes
450 |
451 | Readers may wonder about the reasons behind some of the choices made for
452 | paper writing. Most often, the decisions were driven by radical
453 | pragmatism. For example, Markdown is not only nearly ubiquitous in the
454 | realms of software, but it can also be converted into many different
455 | output formats. The archiving standard for scientific articles is JATS,
456 | and the most popular publishing format is PDF. Open Journals has built
457 | its pipeline based on [pandoc](https://pandoc.org), a universal document
458 | converter that can produce both of these publishing formats -- and many
459 | more.
460 |
461 | A common method for PDF generation is to go via LaTeX. However, support
462 | for tagging -- a requirement for accessible PDFs -- is not readily
463 | available for LaTeX. The current method used ConTeXt, to produce tagged
464 | PDF/A-3, a format suited for archiving [@pdfa3].
465 |
466 |
467 | ``` {=comment}
468 | The below snippet can be added to the YAML metadata if the placement of
469 | the metadata block in the margin needs manual adjustments.
470 | ```
471 |
472 | ---
473 | latex:
474 | before-metadata: '`\vspace{0cm}`{=latex}'
475 | ---
476 |
--------------------------------------------------------------------------------
/data/templates/default.context:
--------------------------------------------------------------------------------
1 | \definecolor[lightblue] [c=.66, m=.39, y=0, k=0]
2 | \definecolor[grey] [c=.40, m=.31, y=.32, k=.10]
3 | \definecolor[orcidgreen] [x=A6CE39]
4 |
5 | \usemodule[tikz]
6 |
7 | $if(context-lang)$
8 | \mainlanguage[$context-lang$]
9 | $endif$
10 | $if(context-dir)$
11 | \setupalign[$context-dir$]
12 | \setupdirections[bidi=on,method=two]
13 | $endif$
14 | % Enable hyperlinks
15 | \setupinteraction
16 | [state=start,
17 | $if(title)$
18 | title={$title$},
19 | $endif$
20 | $if(subtitle)$
21 | subtitle={$subtitle$},
22 | $endif$
23 | $if(author)$
24 | author={$for(author)$$author$$sep$; $endfor$},
25 | $endif$
26 | $if(keywords)$
27 | keyword={$for(keywords)$$keywords$$sep$; $endfor$},
28 | $endif$
29 | style=$linkstyle$,
30 | color=$linkcolor$,
31 | contrastcolor=$linkcontrastcolor$]
32 |
33 | % make chapter, section bookmarks visible when opening document
34 | \placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
35 | \setupinteractionscreen[option={bookmark,title}]
36 |
37 | $if(papersize)$
38 | \setuppapersize[$for(papersize)$${papersize}$sep$,$endfor$]
39 | $endif$
40 | $if(layout)$
41 | \setuplayout[$for(layout)$$layout$$sep$,$endfor$]
42 | $endif$
43 | $if(pagenumbering)$
44 | \setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,$endfor$]
45 | $else$
46 | \setuppagenumbering[location={footer,middle}]
47 | $endif$
48 | $if(pdfa)$
49 | % attempt to generate PDF/A
50 | \setupbackend
51 | [format=PDF/A-$pdfa$,
52 | profile={$if(pdfaiccprofile)$$for(pdfaiccprofile)$$pdfaiccprofile$$sep$,$endfor$$else$sRGB.icc$endif$},
53 | intent=$if(pdfaintent)$$pdfaintent$$else$sRGB IEC61966-2.1$endif$]
54 | $endif$
55 | \setupbackend[export=yes]
56 | \setupstructure[state=start,method=auto]
57 |
58 | % use microtypography
59 | \definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
60 | \definefontfeature[default:tnum][default][tnum=yes, pnum=no]
61 | \definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
62 | \setupalign[hz,hanging]
63 | \setupitaliccorrection[global, always]
64 |
65 | \setupbodyfontenvironment
66 | [default]
67 | [text=0.9,
68 | script=0.7,
69 | scriptscript=0.5,
70 | a=1.000,
71 | b=1.200,
72 | c=1.440,
73 | d=1.728,
74 | *=\currentfontscale, % wildcard
75 | x=0.8,
76 | xx=0.6,
77 | big=1.2,
78 | small=0.8,
79 | interlinespace=2.7ex,
80 | em=italic] % use italic as em, not slanted
81 |
82 | \definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
83 | \definefontfamily[mainface][rm][$if(mainfont)$$mainfont$$else$Latin Modern Roman$endif$]
84 | \definefontfamily[mainface][mm][$if(mathfont)$$mathfont$$else$Latin Modern Math$endif$]
85 | \definefontfamily[mainface][ss][$if(sansfont)$$sansfont$$else$Latin Modern Sans$endif$][tf=file:$sansfont$-SemiBold,tfc=file:$sansfont$-SemiBold,tfb=file:$sansfont$-SemiBold,tfa=file:$sansfont$-SemiBold,bf=file:$sansfont$-Bold]
86 | \definefontfamily[mainface][tt][$if(monofont)$${monofont}$else$Latin Modern Typewriter$endif$][rscale=0.9]
87 | \setupbodyfont[mainface$if(fontsize)$,${fontsize}$endif$]
88 |
89 | \setupwhitespace[$if(whitespace)$${whitespace}$else$medium$endif$]
90 | $if(indenting)$
91 | \setupindenting[$for(indenting)$${indenting}$sep$,$endfor$]
92 | $endif$
93 | $if(interlinespace)$
94 | \setupinterlinespace[$for(interlinespace)$$interlinespace$$sep$,$endfor$]
95 | $endif$
96 |
97 | \startsetups[footertext]
98 | \startframed[
99 | frame=off,
100 | framecolor=lightblue,
101 | topframe=on,
102 | offset=0mm,
103 | toffset=2ex,
104 | align=normal,
105 | width=max
106 | ]
107 | \tfx\setupinterlinespace $self-citation/nowrap$
108 | \stopframed
109 | \stopsetups
110 |
111 | \startsetups[journalLogo]
112 | \startframed[frame=off,width=max,align=flushright]
113 | \externalfigure[/usr/local/share/openjournals/joss/new-logo.png]
114 | \stopframed
115 | \stopsetups
116 |
117 | \startsetups[orcidlogo]
118 | \starttikzpicture
119 | [
120 | x=0.046875,
121 | y=0.046875,
122 | inner sep=0pt,
123 | outer sep=0pt,
124 | ]%
125 | \fill[orcidgreen] (128,128) circle (128);% outer
126 | \fill[white] (70,177) rectangle (86,70);% i bottom
127 | \fill[white] (78,200) circle (10);% i dot
128 | \fill[white] (109,177) -- (150,177) %
129 | .. controls (190,177) and (208,149)%
130 | .. (208,123)%
131 | .. controls (208,96) and (186,70)%
132 | .. (150,70)%
133 | -- (109,70)%
134 | -- (109,177) -- cycle%
135 | (124,84)%
136 | -- (150,84)%
137 | .. controls (186,84) and (192,110)%
138 | .. (192,123)%
139 | .. controls (192,145) and (178,163)%
140 | .. (150,163) -- (124,163)%
141 | -- (124,84) -- cycle;% D
142 | \stoptikzpicture
143 | \stopsetups
144 |
145 | \startsetups[openlogos]
146 | \startframed[frame=off,width=max,align=flushright]
147 |
148 | \starttikzpicture
149 | [
150 | draw=grey,
151 | x=1pt,
152 | y=1pt,
153 | scale=0.25,
154 | line width=2.5pt
155 | ]
156 | \draw (10,68) -- (10,72) arc (180:0:21) -- (52,46);
157 | \draw (31,31) circle (26);
158 | \path[fill=grey](31,31)circle(8.8);
159 | \stoptikzpicture
160 |
161 | ~\quad
162 |
163 | %%% CC %%%
164 | \starttikzpicture
165 | [
166 | y=1pt,
167 | x=1pt,
168 | yscale=-0.38,
169 | xscale=0.38,
170 | inner sep=0pt,
171 | outer sep=0pt,
172 | draw=grey,
173 | ]
174 | %% \path[fill=grey] (37.7850,28.5010) circle (0.8138cm);
175 | \path[fill=grey]
176 | (37.441,-3.500) .. controls (46.3920,-3.5000) and
177 | (54.013,-0.375) .. (60.298, 5.872) .. controls (63.306, 8.881) and
178 | (65.593,12.320) .. (67.155,16.186) .. controls (68.716,20.053) and
179 | (69.499,24.157) .. (69.499,28.500) .. controls (69.499,32.881) and
180 | (68.726,36.986) .. (67.185,40.813) .. controls (65.642,44.641) and
181 | (63.365,48.023) .. (60.357,50.956) .. controls (57.234,54.041) and
182 | (53.691,56.404) .. (49.728,58.042) .. controls (45.767,59.680) and
183 | (41.671,60.499) .. (37.443,60.499) .. controls (33.215,60.499) and
184 | (29.167,59.691) .. (25.300,58.070) .. controls (21.434,56.452) and
185 | (17.967,54.109) .. (14.900,51.043) .. controls (11.833,47.977) and
186 | ( 9.500,44.519) .. ( 7.900,40.671) .. controls ( 6.300,36.823) and
187 | ( 5.500,32.767) .. ( 5.500,28.500) .. controls ( 5.500,24.271) and
188 | ( 6.309,20.205) .. ( 7.928,16.300) .. controls ( 9.547,12.395) and
189 | (11.900, 8.900) .. (14.985, 5.814) .. controls (21.080,-0.394) and
190 | (28.565,-3.500) .. (37.441,-3.500)
191 | -- cycle(37.5570,2.2720) .. controls (30.2430,2.2720) and
192 | (24.090, 4.825) .. (19.099, 9.929) .. controls (16.584,12.482) and
193 | (14.651,15.348) .. (13.299,18.529) .. controls (11.945,21.710) and
194 | (11.270,25.034) .. (11.270,28.501) .. controls (11.270,31.930) and
195 | (11.945,35.235) .. (13.299,38.414) .. controls (14.652,41.597) and
196 | (16.584,44.435) .. (19.099,46.930) .. controls (21.613,49.426) and
197 | (24.450,51.329) .. (27.614,52.645) .. controls (30.775,53.959) and
198 | (34.090,54.616) .. (37.557,54.616) .. controls (40.985,54.616) and
199 | (44.307,53.951) .. (47.530,52.617) .. controls (50.749,51.282) and
200 | (53.651,49.360) .. (56.243,46.846) .. controls (61.233,41.970) and
201 | (63.727,35.856) .. (63.727,28.502) .. controls (63.727,24.959) and
202 | (63.079,21.607) .. (61.784,18.445) .. controls (60.491,15.283) and
203 | (58.604,12.465) .. (56.130, 9.987) .. controls (50.984, 4.844) and
204 | (44.795, 2.272) .. (37.557, 2.272)
205 | -- cycle(37.1560,23.1870)
206 | -- (32.8690,25.4160) .. controls (32.411,24.465) and
207 | (31.850,23.797) .. (31.184,23.416) .. controls (30.517,23.036) and
208 | (29.898,22.845) .. (29.326,22.845) .. controls (26.470,22.845) and
209 | (25.040,24.730) .. (25.040,28.502) .. controls (25.040,30.216) and
210 | (25.402,31.586) .. (26.125,32.615) .. controls (26.849,33.644) and
211 | (27.916,34.159) .. (29.326,34.159) .. controls (31.193,34.159) and
212 | (32.507,33.244) .. (33.270,31.416)
213 | -- (37.2120,33.4160) .. controls (36.374,34.979) and
214 | (35.212,36.207) .. (33.726,37.102) .. controls (32.242,37.998) and
215 | (30.603,38.445) .. (28.812,38.445) .. controls (25.955,38.445) and
216 | (23.649,37.570) .. (21.897,35.816) .. controls (20.145,34.064) and
217 | (19.269,31.626) .. (19.269,28.503) .. controls (19.269,25.455) and
218 | (20.155,23.037) .. (21.926,21.246) .. controls (23.697,19.456) and
219 | (25.935,18.560) .. (28.641,18.560) .. controls (32.604,18.558) and
220 | (35.441,20.101) .. (37.156,23.187)
221 | -- cycle(55.6130,23.1870)
222 | -- (51.3840,25.4160) .. controls (50.9270,24.4650) and
223 | (50.364,23.797) .. (49.698,23.416) .. controls (49.030,23.036) and
224 | (48.391,22.845) .. (47.784,22.845) .. controls (44.927,22.845) and
225 | (43.497,24.730) .. (43.497,28.502) .. controls (43.497,30.216) and
226 | (43.860,31.586) .. (44.583,32.615) .. controls (45.306,33.644) and
227 | (46.372,34.159) .. (47.784,34.159) .. controls (49.649,34.159) and
228 | (50.964,33.244) .. (51.725,31.416)
229 | -- (55.7250,33.4160) .. controls (54.8500,34.9790) and
230 | (53.668,36.207) .. (52.184,37.102) .. controls (50.698,37.998) and
231 | (49.079,38.445) .. (47.327,38.445) .. controls (44.431,38.445) and
232 | (42.118,37.570) .. (40.386,35.816) .. controls (38.650,34.064) and
233 | (37.784,31.626) .. (37.784,28.503) .. controls (37.784,25.455) and
234 | (38.669,23.037) .. (40.442,21.246) .. controls (42.212,19.456) and
235 | (44.450,18.560) .. (47.155,18.560) .. controls (51.117,18.558) and
236 | (53.938,20.101) .. (55.613,23.187) -- cycle;
237 | \stoptikzpicture
238 |
239 | \quad
240 |
241 | %%% OSI %%%
242 | \starttikzpicture[y=0.80pt, x=0.80pt, yscale=-0.05, xscale=0.05, inner sep=0pt, outer sep=0pt]
243 | \startscope[line join=round]
244 | \path [draw=grey, fill=none, line width=1.9pt] % line width=15.37pt
245 | (398.4044,595.2782) .. controls (438.7252,580.3040) and (459.7740,551.4647) ..
246 | (459.7740,501.8306) .. controls (459.7740,452.1964) and (417.9488,408.4600) ..
247 | (365.6875,408.3750) .. controls (310.5385,408.2854) and (268.9356,452.0150) ..
248 | (269.6009,501.8306) .. controls (270.2661,551.6461) and (294.0225,584.7857) ..
249 | (332.0473,596.7695) --
250 | (264.6892,762.4797) .. controls (174.5360,739.1420) and (82.8451,632.7877) ..
251 | (82.8451,501.8306) .. controls (82.8451,346.7214) and (207.4779,220.9806) ..
252 | (363.6875,220.9806) .. controls (519.8970,220.9806) and (646.5299,346.7214) ..
253 | (646.5299,501.8306) .. controls (646.5299,634.8252) and (555.7091,739.6955) ..
254 | (463.6324,762.9458) --
255 | cycle;
256 |
257 | \path [cm={{0.62188,0.0,0.0,0.62188,(741.3993,442.86307)}}, fill=grey]
258 | (-185.0430,486.4596) .. controls (-183.5196,486.9753) and (-182.0430,488.0768) ..
259 | (-180.6133,489.7643) .. controls (-179.1602,491.4518) and (-177.7071,493.7721) ..
260 | (-176.2539,496.7253) --
261 | (-169.0469,511.0690) --
262 | (-176.6758,511.0690) --
263 | (-183.3906,497.6042) .. controls (-185.1250,494.0886) and (-186.8125,491.7565) ..
264 | (-188.4531,490.6081) .. controls (-190.0703,489.4597) and (-192.2852,488.8854) ..
265 | (-195.0977,488.8854) --
266 | (-202.8320,488.8854) --
267 | (-202.8320,511.0690) --
268 | (-209.9336,511.0690) --
269 | (-209.9336,458.5807) --
270 | (-193.9023,458.5807) .. controls (-187.9024,458.5808) and (-183.4258,459.8347) ..
271 | (-180.4727,462.3424) .. controls (-177.5196,464.8503) and (-176.0430,468.6355) ..
272 | (-176.0430,473.6979) .. controls (-176.0430,477.0026) and (-176.8165,479.7448) ..
273 | (-178.3633,481.9245) .. controls (-179.8868,484.1042) and (-182.1133,485.6159) ..
274 | (-185.0430,486.4596)
275 | (-202.8320,464.4167) --
276 | (-202.8320,483.0495) --
277 | (-193.9023,483.0495) .. controls (-190.4805,483.0495) and (-187.9024,482.2643) ..
278 | (-186.1680,480.6940) .. controls (-184.4102,479.1003) and (-183.5313,476.7683) ..
279 | (-183.5313,473.6979) .. controls (-183.5313,470.6276) and (-184.4102,468.3190) ..
280 | (-186.1680,466.7721) .. controls (-187.9024,465.2019) and (-190.4805,464.4167) ..
281 | (-193.9023,464.4167) --
282 | (-202.8320,464.4167);
283 |
284 | \path[cm={{0.53989,0.0,0.0,0.51642,(738.70955,538.65137)}},draw=grey, line width=0.0602pt]
285 | (-174.3803,399.4047)
286 | arc (-0.012:180.012:42.626301 and 44.564)
287 | arc (-180.012:0.012:42.626301 and 44.564)
288 | -- cycle;
289 | \stopscope
290 | \stoptikzpicture
291 | \stopframed
292 | \stopsetups
293 | \definetext[firstpage][header][\directsetup{openlogos}]
294 |
295 | \setupheadertexts[edge][\directsetup{journalLogo}][]
296 | \setupfootertexts[\directsetup{footertext}][]
297 |
298 | \setuplinenumbering[
299 | color=grey,
300 | style=\tfxx,
301 | location=left,
302 | align=flushright,
303 | distance=-1.5em
304 | ]
305 |
306 | \setuphead [title]
307 | [style={\tfd\setupinterlinespace[line=24pt]\ss}, color={lightblue}, header=firstpage, number=no]
308 | \setuphead [section] [style={\tfc\setupinterlinespace\ss}, color={lightblue}]
309 | \setuphead [subsection] [style={\tfb\ss},color={lightblue}]
310 | \setuphead[subsubsection][style={\tfa\ss},color={lightblue}]
311 | \setuphead[subsubsubsection][style={\tf\ss\it},color={lightblue}]
312 | \setuphead[subsubsubsubsection][style={\tfx\ss\it},color={lightblue}]
313 |
314 | $if(headertext)$
315 | \setupheadertexts$for(headertext)$[$headertext$]$endfor$
316 | $endif$
317 | $if(footertext)$
318 | \setupfootertexts$for(footertext)$[$footertext$]$endfor$
319 | $endif$
320 | $if(number-sections)$
321 | $else$
322 | \setuphead[section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]
323 | $endif$
324 |
325 | \definedescription
326 | [description]
327 | [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
328 |
329 | \definedescription
330 | [metadata]
331 | [headstyle=bold, style=normal, location=hanging, width=line, margin=no, alternative=hanging, indenting=no, hang=none]
332 |
333 | \setupitemize[autointro] % prevent orphan list intro
334 | \setupitemize[indentnext=no]
335 |
336 | \defineitemgroup[enumerate]
337 | \setupenumerate[each][fit][itemalign=left,distance=.5em,style={\feature[+][default:tnum]}]
338 |
339 | \setupxtable[frame=off]
340 | \setupxtable[head][topframe=on,bottomframe=on]
341 | \setupxtable[body][]
342 | \setupxtable[foot][bottomframe=on]
343 |
344 | $if(emphasis-commands)$
345 | $emphasis-commands$
346 | $endif$
347 | $if(highlighting-commands)$
348 | $highlighting-commands$
349 | $endif$
350 | $if(csl-refs)$
351 | \definemeasure[cslhangindent][1.5em]
352 | \definenarrower[hangingreferences][left=\measure{cslhangindent}]
353 | \definestartstop [cslreferences] [
354 | $if(csl-hanging-indent)$
355 | before={%
356 | \starthangingreferences[left]
357 | \setupindenting[-\leftskip,yes,first]
358 | \doindentation
359 | },
360 | after=\stophangingreferences,
361 | $endif$
362 | ]
363 | $endif$
364 |
365 | %% \setupfloat[figure][default={here,nonumber}]
366 | \setupfloats[spacebefore=9mm,spaceafter=9mm]
367 | %% \setupcaptions[spaceafter=9mm]
368 |
369 | $if(includesource)$
370 | $for(sourcefile)$
371 | \attachment[file=$curdir$/$sourcefile$,method=hidden]
372 | $endfor$
373 | $endif$
374 | $for(header-includes)$
375 | $header-includes$
376 | $endfor$
377 |
378 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
379 | \starttext\blank[-1em]
380 |
381 |
382 | $if(title)$
383 | \blank[disable]
384 | \title[title={$title$}]
385 | $if(author)$
386 | \smallskip
387 | {
388 | \tfa
389 | $for(authors)$
390 | ${it.name}\high{$for(it.affiliation)$\,${it}$sep$,$endfor$%
391 | $if(it.equal-contrib)$\,*$endif$%
392 | $if(it.cor-id)$\,¶$endif$}%
393 | $if(it.orcid)$\,\goto{\low{\setup[orcidlogo]}}[url(https://orcid.org/$it.orcid$)]\,$endif$%
394 | $sep$,
395 | $endfor$
396 | }
397 | $endif$
398 | \blank[big]
399 | {
400 | \startparagraph
401 | \tfx
402 | \setuplocalinterlinespace[line=10pt]
403 | $for(affiliations)$
404 | ${it.index}~${it.name}$sep$\enspace%
405 | $endfor$
406 | $if(article.has-equal-contributors)$
407 | \enspace{}*~%
408 | $if(message.equal-contrib)$${message.equal-contrib}$else$These authors contributed equally$endif$
409 | $endif$
410 | $if(article.author-notes.corresp)$
411 | \enspace¶~Corresponding author
412 | $endif$
413 | \stopparagraph
414 | }
415 | \blank[big]
416 | $endif$
417 |
418 | \margintext[metadata][line=1]{%
419 | \blank[-line]
420 | \tf
421 |
422 | \setupinteraction[color=grey]
423 | \startalignment[flushright,nothyphenated]%
424 | \useURL[articledoi][https://doi.org/$article.doi$][][$article.doi$]
425 | \useURL[review][$software_review_url$][][Review]
426 | \useURL[repo][$software_repository_url$][][Repository]
427 | \useURL[archive][https://doi.org/$archive_doi$][][Archive]
428 | \useURL[editor][$editor.url$][][$editor.name$]
429 |
430 | {DOI}\\\from[articledoi]
431 | \blank[big]
432 |
433 | {Software}\\\color[grey]{\from[review]\,\|\,\from[repo]\,\|\,\from[archive]}
434 | \blank[big]
435 |
436 | {Editor}\\ \from[editor]
437 | \blank[big]
438 |
439 | {Reviewers}\\
440 | $for(reviewers)$
441 | \useURL[$it$][https://github.com/$it$][][@$it$]
442 | \from[$it$]
443 | $sep$\\
444 | $endfor$
445 | \blank[big]
446 |
447 | {Submitted}\\ \color[grey]{$submitted$}
448 | \blank[big]
449 |
450 | {Published}\\\color[grey]{$published$}
451 | \blank[big]
452 |
453 | {License}\\\color[grey]{$license$}
454 |
455 | \stopalignment
456 | }
457 |
458 | $for(include-before)$
459 | $include-before$
460 | $endfor$
461 |
462 | $if(draft)$
463 | \startlinenumbering
464 | $endif$
465 |
466 | $body$
467 |
468 | $if(draft)$
469 | \stoplinenumbering
470 | $endif$
471 |
472 | $for(include-after)$
473 | $include-after$
474 | $endfor$
475 | \stoptext
476 |
--------------------------------------------------------------------------------
/data/templates/preprint.latex:
--------------------------------------------------------------------------------
1 | % Options for packages loaded elsewhere
2 | \PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
3 | \PassOptionsToPackage{hyphens}{url}
4 | $if(colorlinks)$
5 | \PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
6 | $endif$
7 | $if(CJKmainfont)$
8 | \PassOptionsToPackage{space}{xeCJK}
9 | $endif$
10 | %
11 | \documentclass[
12 | $if(fontsize)$
13 | $fontsize$,
14 | $endif$
15 | $if(papersize)$
16 | $papersize$paper,
17 | $endif$
18 | $for(classoption)$
19 | $classoption$$sep$,
20 | $endfor$
21 | ]{$documentclass$}
22 | \usepackage{amsmath,amssymb}
23 | $if(fontfamily)$
24 | \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
25 | $else$
26 | \usepackage{lmodern}
27 | $endif$
28 | $if(linestretch)$
29 | \usepackage{setspace}
30 | $endif$
31 | \usepackage{iftex}
32 | \ifPDFTeX
33 | \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
34 | \usepackage[utf8]{inputenc}
35 | \usepackage{textcomp} % provide euro and other symbols
36 | \else % if luatex or xetex
37 | $if(mathspec)$
38 | \ifXeTeX
39 | \usepackage{mathspec}
40 | \else
41 | \usepackage{unicode-math}
42 | \fi
43 | $else$
44 | \usepackage{unicode-math}
45 | $endif$
46 | \defaultfontfeatures{Scale=MatchLowercase}
47 | \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
48 | $if(mainfont)$
49 | \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
50 | $endif$
51 | $if(sansfont)$
52 | \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
53 | $endif$
54 | $if(monofont)$
55 | \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
56 | $endif$
57 | $for(fontfamilies)$
58 | \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
59 | $endfor$
60 | $if(mathfont)$
61 | $if(mathspec)$
62 | \ifXeTeX
63 | \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
64 | \else
65 | \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
66 | \fi
67 | $else$
68 | \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
69 | $endif$
70 | $endif$
71 | $if(CJKmainfont)$
72 | \ifXeTeX
73 | \usepackage{xeCJK}
74 | \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
75 | \fi
76 | $endif$
77 | $if(luatexjapresetoptions)$
78 | \ifLuaTeX
79 | \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
80 | \fi
81 | $endif$
82 | $if(CJKmainfont)$
83 | \ifLuaTeX
84 | \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
85 | \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
86 | \fi
87 | $endif$
88 | \fi
89 | $if(zero-width-non-joiner)$
90 | %% Support for zero-width non-joiner characters.
91 | \makeatletter
92 | \def\zerowidthnonjoiner{%
93 | % Prevent ligatures and adjust kerning, but still support hyphenating.
94 | \texorpdfstring{%
95 | \TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}%
96 | \ifvmode\else\nobreak\hskip\z@skip\fi}{}%
97 | }{}%
98 | }
99 | \makeatother
100 | \ifPDFTeX
101 | \DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner}
102 | \else
103 | \catcode`^^^^200c=\active
104 | \protected\def ^^^^200c{\zerowidthnonjoiner}
105 | \fi
106 | %% End of ZWNJ support
107 | $endif$
108 | % Use upquote if available, for straight quotes in verbatim environments
109 | \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
110 | \IfFileExists{microtype.sty}{% use microtype if available
111 | \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
112 | \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
113 | }{}
114 | $if(indent)$
115 | $else$
116 | \makeatletter
117 | \@ifundefined{KOMAClassName}{% if non-KOMA class
118 | \IfFileExists{parskip.sty}{%
119 | \usepackage{parskip}
120 | }{% else
121 | \setlength{\parindent}{0pt}
122 | \setlength{\parskip}{6pt plus 2pt minus 1pt}}
123 | }{% if KOMA class
124 | \KOMAoptions{parskip=half}}
125 | \makeatother
126 | $endif$
127 | $if(verbatim-in-note)$
128 | \usepackage{fancyvrb}
129 | $endif$
130 | \usepackage{xcolor}
131 | $if(listings)$
132 | \usepackage{listings}
133 | \newcommand{\passthrough}[1]{#1}
134 | \lstset{defaultdialect=[5.3]Lua}
135 | \lstset{defaultdialect=[x86masm]Assembler}
136 | $endif$
137 | $if(lhs)$
138 | \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
139 | $endif$
140 | $if(highlighting-macros)$
141 | $highlighting-macros$
142 | $endif$
143 | $if(tables)$
144 | \usepackage{longtable,booktabs,array}
145 | $if(multirow)$
146 | \usepackage{multirow}
147 | $endif$
148 | \usepackage{calc} % for calculating minipage widths
149 | % Correct order of tables after \paragraph or \subparagraph
150 | \usepackage{etoolbox}
151 | \makeatletter
152 | \patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
153 | \makeatother
154 | % Allow footnotes in longtable head/foot
155 | \IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
156 | \makesavenoteenv{longtable}
157 | $endif$
158 | $if(graphics)$
159 | \usepackage{graphicx}
160 | \makeatletter
161 | \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
162 | \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
163 | \makeatother
164 | % Scale images if necessary, so that they will not overflow the page
165 | % margins by default, and it is still possible to overwrite the defaults
166 | % using explicit options in \includegraphics[width, height, ...]{}
167 | \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
168 | % Set default figure placement to htbp
169 | \makeatletter
170 | \def\fps@figure{htbp}
171 | \makeatother
172 | $endif$
173 | $if(svg)$
174 | \usepackage{svg}
175 | $endif$
176 | $if(strikeout)$
177 | $-- also used for underline
178 | \ifLuaTeX
179 | \usepackage{luacolor}
180 | \usepackage[soul]{lua-ul}
181 | \else
182 | \usepackage{soul}
183 | \fi
184 | $endif$
185 | \setlength{\emergencystretch}{3em} % prevent overfull lines
186 | \providecommand{\tightlist}{%
187 | \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
188 | $if(numbersections)$
189 | \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
190 | $else$
191 | \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
192 | $endif$
193 | $if(block-headings)$
194 | % Make \paragraph and \subparagraph free-standing
195 | \ifx\paragraph\undefined\else
196 | \let\oldparagraph\paragraph
197 | \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
198 | \fi
199 | \ifx\subparagraph\undefined\else
200 | \let\oldsubparagraph\subparagraph
201 | \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
202 | \fi
203 | $endif$
204 | $if(pagestyle)$
205 | \pagestyle{$pagestyle$}
206 | $endif$
207 | $if(csl-refs)$
208 | % definitions for citeproc citations
209 | \NewDocumentCommand\citeproctext{}{}
210 | \NewDocumentCommand\citeproc{mm}{%
211 | \begingroup\def\citeproctext{#2}\cite{#1}\endgroup}
212 | \makeatletter
213 | % allow citations to break across lines
214 | \let\@cite@ofmt\@firstofone
215 | % avoid brackets around text for \cite:
216 | \def\@biblabel#1{}
217 | \def\@cite#1#2{{#1\if@tempswa , #2\fi}}
218 | \makeatother
219 | \newlength{\cslhangindent}
220 | \setlength{\cslhangindent}{1.5em}
221 | \newlength{\csllabelwidth}
222 | \setlength{\csllabelwidth}{3em}
223 | \newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing
224 | {\begin{list}{}{%
225 | \setlength{\itemindent}{0pt}
226 | \setlength{\leftmargin}{0pt}
227 | \setlength{\parsep}{0pt}
228 | % turn on hanging indent if param 1 is 1
229 | \ifodd #1
230 | \setlength{\leftmargin}{\cslhangindent}
231 | \setlength{\itemindent}{-1\cslhangindent}
232 | \fi
233 | % set entry spacing
234 | \setlength{\itemsep}{#2\baselineskip}}}
235 | {\end{list}}
236 | \usepackage{calc}
237 | \newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}}
238 | \newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}}
239 | \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}}
240 | \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
241 | $endif$
242 | $if(lang)$
243 | \ifLuaTeX
244 | \usepackage[bidi=basic]{babel}
245 | \else
246 | \usepackage[bidi=default]{babel}
247 | \fi
248 | $if(babel-lang)$
249 | \babelprovide[main,import]{$babel-lang$}
250 | $endif$
251 | $for(babel-otherlangs)$
252 | \babelprovide[import]{$babel-otherlangs$}
253 | $endfor$
254 | % get rid of language-specific shorthands (see #6817):
255 | \let\LanguageShortHands\languageshorthands
256 | \def\languageshorthands#1{}
257 | $endif$
258 | $for(header-includes)$
259 | $header-includes$
260 | $endfor$
261 | \ifLuaTeX
262 | \usepackage{selnolig} % disable illegal ligatures
263 | \fi
264 | $if(dir)$
265 | \ifPDFTeX
266 | \TeXXeTstate=1
267 | \newcommand{\RL}[1]{\beginR #1\endR}
268 | \newcommand{\LR}[1]{\beginL #1\endL}
269 | \newenvironment{RTL}{\beginR}{\endR}
270 | \newenvironment{LTR}{\beginL}{\endL}
271 | \fi
272 | $endif$
273 | $if(natbib)$
274 | \usepackage[$natbiboptions$]{natbib}
275 | \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
276 | $endif$
277 | $if(biblatex)$
278 | \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
279 | $for(bibliography)$
280 | \addbibresource{$bibliography$}
281 | $endfor$
282 | $endif$
283 | $if(nocite-ids)$
284 | \nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
285 | $endif$
286 | $if(csquotes)$
287 | \usepackage{csquotes}
288 | $endif$
289 | \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
290 | \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
291 | \urlstyle{same} % disable monospaced font for URLs
292 | $if(links-as-notes)$
293 | % Make links footnotes instead of hotlinks:
294 | \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
295 | $endif$
296 | $if(verbatim-in-note)$
297 | \VerbatimFootnotes % allow verbatim text in footnotes
298 | $endif$
299 | \hypersetup{
300 | $if(title-meta)$
301 | pdftitle={$title-meta$},
302 | $endif$
303 | $if(author-meta)$
304 | pdfauthor={$author-meta$},
305 | $endif$
306 | $if(lang)$
307 | pdflang={$lang$},
308 | $endif$
309 | $if(subject)$
310 | pdfsubject={$subject$},
311 | $endif$
312 | $if(keywords)$
313 | pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
314 | $endif$
315 | $if(colorlinks)$
316 | colorlinks=true,
317 | linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$},
318 | filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$},
319 | citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$},
320 | urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$},
321 | $else$
322 | $if(boxlinks)$
323 | $else$
324 | hidelinks,
325 | $endif$
326 | $endif$
327 | pdfcreator={LaTeX via pandoc}}
328 |
329 | $if(title)$
330 | \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
331 | $endif$
332 | $if(subtitle)$
333 | \usepackage{etoolbox}
334 | \makeatletter
335 | \providecommand{\subtitle}[1]{% add subtitle to \maketitle
336 | \apptocmd{\@title}{\par {\large #1 \par}}{}{}
337 | }
338 | \makeatother
339 | \subtitle{$subtitle$}
340 | $endif$
341 |
342 | \definecolor{c53baa1}{RGB}{83,186,161}
343 | \definecolor{c202826}{RGB}{32,40,38}
344 | \def \rorglobalscale {0.1}
345 | \newcommand{\rorlogo}{%
346 | \begin{tikzpicture}[y=1cm, x=1cm, yscale=\rorglobalscale,xscale=\rorglobalscale, every node/.append style={scale=\rorglobalscale}, inner sep=0pt, outer sep=0pt]
347 | \begin{scope}[even odd rule,line join=round,miter limit=2.0,shift={(-0.025, 0.0216)}]
348 | \path[fill=c53baa1,nonzero rule,line join=round,miter limit=2.0] (1.8164, 3.012) -- (1.4954, 2.5204) -- (1.1742, 3.012) -- (1.8164, 3.012) -- cycle;
349 | \path[fill=c53baa1,nonzero rule,line join=round,miter limit=2.0] (3.1594, 3.012) -- (2.8385, 2.5204) -- (2.5172, 3.012) -- (3.1594, 3.012) -- cycle;
350 | \path[fill=c53baa1,nonzero rule,line join=round,miter limit=2.0] (1.1742, 0.0669) -- (1.4954, 0.5588) -- (1.8164, 0.0669) -- (1.1742, 0.0669) -- cycle;
351 | \path[fill=c53baa1,nonzero rule,line join=round,miter limit=2.0] (2.5172, 0.0669) -- (2.8385, 0.5588) -- (3.1594, 0.0669) -- (2.5172, 0.0669) -- cycle;
352 | \path[fill=c202826,nonzero rule,line join=round,miter limit=2.0] (3.8505, 1.4364).. controls (3.9643, 1.4576) and (4.0508, 1.5081) .. (4.1098, 1.5878).. controls (4.169, 1.6674) and (4.1984, 1.7642) .. (4.1984, 1.8777).. controls (4.1984, 1.9719) and (4.182, 2.0503) .. (4.1495, 2.1132).. controls (4.1169, 2.1762) and (4.0727, 2.2262) .. (4.0174, 2.2635).. controls (3.9621, 2.3006) and (3.8976, 2.3273) .. (3.824, 2.3432).. controls (3.7505, 2.359) and (3.6727, 2.367) .. (3.5909, 2.367) -- (2.9676, 2.367) -- (2.9676, 1.8688).. controls (2.9625, 1.8833) and (2.9572, 1.8976) .. (2.9514, 1.9119).. controls (2.9083, 2.0164) and (2.848, 2.1056) .. (2.7705, 2.1791).. controls (2.6929, 2.2527) and (2.6014, 2.3093) .. (2.495, 2.3487).. controls (2.3889, 2.3881) and (2.2728, 2.408) .. (2.1468, 2.408).. controls (2.0209, 2.408) and (1.905, 2.3881) .. (1.7986, 2.3487).. controls (1.6925, 2.3093) and (1.6007, 2.2527) .. (1.5232, 2.1791).. controls (1.4539, 2.1132) and (1.3983, 2.0346) .. (1.3565, 1.9436).. controls (1.3504, 2.009) and (1.3351, 2.0656) .. (1.3105, 2.1132).. controls (1.2779, 2.1762) and (1.2338, 2.2262) .. (1.1785, 2.2635).. controls (1.1232, 2.3006) and (1.0586, 2.3273) .. (0.985, 2.3432).. controls (0.9115, 2.359) and (0.8337, 2.367) .. (0.7519, 2.367) -- (0.1289, 2.367) -- (0.1289, 0.7562) -- (0.4837, 0.7562) -- (0.4837, 1.4002) -- (0.6588, 1.4002) -- (0.9956, 0.7562) -- (1.4211, 0.7562) -- (1.0118, 1.4364).. controls (1.1255, 1.4576) and (1.2121, 1.5081) .. (1.2711, 1.5878).. controls (1.2737, 1.5915) and (1.2761, 1.5954) .. (1.2787, 1.5991).. controls (1.2782, 1.5867) and (1.2779, 1.5743) .. (1.2779, 1.5616).. controls (1.2779, 1.4327) and (1.2996, 1.3158) .. (1.3428, 1.2113).. controls (1.3859, 1.1068) and (1.4462, 1.0176) .. (1.5237, 0.944).. controls (1.601, 0.8705) and (1.6928, 0.8139) .. (1.7992, 0.7744).. controls (1.9053, 0.735) and (2.0214, 0.7152) .. (2.1474, 0.7152).. controls (2.2733, 0.7152) and (2.3892, 0.735) .. (2.4956, 0.7744).. controls (2.6016, 0.8139) and (2.6935, 0.8705) .. (2.771, 0.944).. controls (2.8482, 1.0176) and (2.9086, 1.1068) .. (2.952, 1.2113).. controls (2.9578, 1.2253) and (2.9631, 1.2398) .. (2.9681, 1.2544) -- (2.9681, 0.7562) -- (3.3229, 0.7562) -- (3.3229, 1.4002) -- (3.4981, 1.4002) -- (3.8349, 0.7562) -- (4.2603, 0.7562) -- (3.8505, 1.4364) -- cycle(0.9628, 1.7777).. controls (0.9438, 1.7534) and (0.92, 1.7357) .. (0.8911, 1.7243).. controls (0.8623, 1.7129) and (0.83, 1.706) .. (0.7945, 1.7039).. controls (0.7588, 1.7015) and (0.7252, 1.7005) .. (0.6932, 1.7005) -- (0.4839, 1.7005) -- (0.4839, 2.0667) -- (0.716, 2.0667).. controls (0.7477, 2.0667) and (0.7805, 2.0643) .. (0.8139, 2.0598).. controls (0.8472, 2.0553) and (0.8768, 2.0466) .. (0.9025, 2.0336).. controls (0.9282, 2.0206) and (0.9496, 2.0021) .. (0.9663, 1.9778).. controls (0.9829, 1.9534) and (0.9914, 1.9209) .. (0.9914, 1.8799).. controls (0.9914, 1.8362) and (0.9819, 1.8021) .. (0.9628, 1.7777) -- cycle(2.6125, 1.3533).. controls (2.5889, 1.2904) and (2.5553, 1.2359) .. (2.5112, 1.1896).. controls (2.4672, 1.1433) and (2.4146, 1.1073) .. (2.3529, 1.0814).. controls (2.2916, 1.0554) and (2.2228, 1.0427) .. (2.1471, 1.0427).. controls (2.0712, 1.0427) and (2.0026, 1.0557) .. (1.9412, 1.0814).. controls (1.8799, 1.107) and (1.8272, 1.1433) .. (1.783, 1.1896).. controls (1.7391, 1.2359) and (1.7052, 1.2904) .. (1.6817, 1.3533).. controls (1.6581, 1.4163) and (1.6465, 1.4856) .. (1.6465, 1.5616).. controls (1.6465, 1.6359) and (1.6581, 1.705) .. (1.6817, 1.7687).. controls (1.7052, 1.8325) and (1.7388, 1.8873) .. (1.783, 1.9336).. controls (1.8269, 1.9799) and (1.8796, 2.0159) .. (1.9412, 2.0418).. controls (2.0026, 2.0675) and (2.0712, 2.0804) .. (2.1471, 2.0804).. controls (2.223, 2.0804) and (2.2916, 2.0675) .. (2.3529, 2.0418).. controls (2.4143, 2.0161) and (2.467, 1.9799) .. (2.5112, 1.9336).. controls (2.5551, 1.8873) and (2.5889, 1.8322) .. (2.6125, 1.7687).. controls (2.636, 1.705) and (2.6477, 1.6359) .. (2.6477, 1.5616).. controls (2.6477, 1.4856) and (2.636, 1.4163) .. (2.6125, 1.3533) -- cycle(3.8015, 1.7777).. controls (3.7825, 1.7534) and (3.7587, 1.7357) .. (3.7298, 1.7243).. controls (3.701, 1.7129) and (3.6687, 1.706) .. (3.6333, 1.7039).. controls (3.5975, 1.7015) and (3.5639, 1.7005) .. (3.5319, 1.7005) -- (3.3226, 1.7005) -- (3.3226, 2.0667) -- (3.5547, 2.0667).. controls (3.5864, 2.0667) and (3.6192, 2.0643) .. (3.6526, 2.0598).. controls (3.6859, 2.0553) and (3.7155, 2.0466) .. (3.7412, 2.0336).. controls (3.7669, 2.0206) and (3.7883, 2.0021) .. (3.805, 1.9778).. controls (3.8216, 1.9534) and (3.8301, 1.9209) .. (3.8301, 1.8799).. controls (3.8301, 1.8362) and (3.8206, 1.8021) .. (3.8015, 1.7777) -- cycle;
353 | \end{scope}
354 | \end{tikzpicture}
355 | }
356 |
357 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
358 | % Authors and Affiliations
359 |
360 | \usepackage[affil-it]{authblk}
361 | \usepackage{orcidlink}
362 | %% \renewcommand\Authsep{, }
363 | \setlength{\affilsep}{1em}
364 | $for(authors)$
365 | \author[$for(authors.affiliation)$$authors.affiliation$$sep$,$endfor$%
366 | $if(authors.equal-contrib)$*$endif$%
367 | $if(authors.cor-id)$\ensuremath\mathparagraph$endif$]{$authors.name$%
368 | $if(it.orcid)$
369 | \,\orcidlink{${it.orcid}}\,%
370 | $endif$
371 | $if(it.note)$
372 | \thanks{$it.note$}%
373 | $endif$
374 | }
375 | $endfor$
376 |
377 | $for(affiliations)$
378 | \affil[$affiliations.index$]{$affiliations.name$%
379 | $if(affiliations.ror)$
380 | \,\protect\href{https://ror.org/${affiliations.ror}}{\protect\rorlogo}\,%
381 | $endif$
382 | }
383 | $endfor$
384 | $if(article.author-notes.corresp)$
385 | \affil[$$\mathparagraph$$]{Corresponding author: %
386 | $for(authors)$$if(authors.cor-id)$$authors.email$ $endif$$endfor$%
387 | }
388 | $endif$
389 | $if(article.has-equal-contributors)$
390 | \affil[*]{$if(message.equal-contrib)$$message.equal-contrib$$else$These authors contributed equally.$endif$}
391 | $endif$
392 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
393 | \date{$date$}
394 |
395 | \begin{document}
396 | $if(has-frontmatter)$
397 | \frontmatter
398 | $endif$
399 | $if(title)$
400 | \maketitle
401 | $if(abstract)$
402 | \begin{abstract}
403 | $abstract$
404 | \end{abstract}
405 | $endif$
406 | $endif$
407 |
408 | $for(include-before)$
409 | $include-before$
410 |
411 | $endfor$
412 | $if(toc)$
413 | $if(toc-title)$
414 | \renewcommand*\contentsname{$toc-title$}
415 | $endif$
416 | {
417 | $if(colorlinks)$
418 | \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
419 | $endif$
420 | \setcounter{tocdepth}{$toc-depth$}
421 | \tableofcontents
422 | }
423 | $endif$
424 | $if(lof)$
425 | \listoffigures
426 | $endif$
427 | $if(lot)$
428 | \listoftables
429 | $endif$
430 | $if(linestretch)$
431 | \setstretch{$linestretch$}
432 | $endif$
433 | $if(has-frontmatter)$
434 | \mainmatter
435 | $endif$
436 | $body$
437 |
438 | $if(has-frontmatter)$
439 | \backmatter
440 | $endif$
441 | $if(natbib)$
442 | $if(bibliography)$
443 | $if(biblio-title)$
444 | $if(has-chapters)$
445 | \renewcommand\bibname{$biblio-title$}
446 | $else$
447 | \renewcommand\refname{$biblio-title$}
448 | $endif$
449 | $endif$
450 | \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
451 |
452 | $endif$
453 | $endif$
454 | $if(biblatex)$
455 | \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
456 |
457 | $endif$
458 | $for(include-after)$
459 | $include-after$
460 |
461 | $endfor$
462 | \end{document}
463 |
--------------------------------------------------------------------------------
/data/templates/default.latex:
--------------------------------------------------------------------------------
1 | \documentclass[10pt,a4paper,onecolumn]{article}
2 | \usepackage{marginnote}
3 | \usepackage{graphicx}
4 | \usepackage[rgb,svgnames]{xcolor}
5 | \usepackage{authblk,etoolbox}
6 | \usepackage{titlesec}
7 | \usepackage{calc}
8 | \usepackage{tikz}
9 | \usepackage[pdfa]{hyperref}
10 | \usepackage{hyperxmp}
11 | \hypersetup{%
12 | unicode=true,
13 | pdfapart=3,
14 | pdfaconformance=B,
15 | $if(title-meta)$
16 | pdftitle={$title-meta$},
17 | $endif$
18 | $if(author-meta)$
19 | pdfauthor={$author-meta$},
20 | $endif$
21 | $if(keywords)$
22 | pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
23 | $endif$
24 | pdfpublication={$journal.title$},
25 | pdfpublisher={Open Journals},
26 | pdfissn={$journal.issn$},
27 | pdfpubtype={journal},
28 | pdfvolumenum={$volume$},
29 | pdfissuenum={$issue$},
30 | $if(article.doi)$
31 | pdfdoi={$article.doi$},
32 | $endif$
33 | $if(author-meta)$
34 | pdfcopyright={Copyright (c) $year$, $author-meta$},
35 | $endif$
36 | pdflicenseurl={http://creativecommons.org/licenses/by/4.0/},
37 | $if(colorlinks)$
38 | colorlinks=true,
39 | linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
40 | citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
41 | urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
42 | $else$
43 | pdfborder={0 0 0},
44 | $endif$
45 | breaklinks=true
46 | }
47 | % https://tex.stackexchange.com/a/535849
48 | % Create an OutputIntent in order to correctly specify colours
49 | \immediate\pdfobj stream attr{/N 3} file{sRGB.icc}
50 | \pdfcatalog{%
51 | /OutputIntents [
52 | <<
53 | /Type /OutputIntent
54 | /S /GTS_PDFA1
55 | /DestOutputProfile \the\pdflastobj\space 0 R
56 | /OutputConditionIdentifier (sRGB)
57 | /Info (sRGB)
58 | >>
59 | ]
60 | }
61 | \pdfvariable omitcidset=1
62 | \usepackage{caption}
63 | \usepackage{orcidlink}
64 | \usepackage{tcolorbox}
65 | \usepackage{amssymb,amsmath}
66 | \usepackage{ifxetex,ifluatex}
67 | \usepackage{seqsplit}
68 | \usepackage{xstring}
69 |
70 | \usepackage{float}
71 | \let\origfigure\figure
72 | \let\endorigfigure\endfigure
73 | \renewenvironment{figure}[1][2] {
74 | \expandafter\origfigure\expandafter[H]
75 | } {
76 | \endorigfigure
77 | }
78 |
79 | \usepackage{fixltx2e} % provides \textsubscript
80 |
81 | $if(csl-refs)$
82 | % definitions for citeproc citations
83 | \NewDocumentCommand\citeproctext{}{}
84 | \NewDocumentCommand\citeproc{mm}{%
85 | \begingroup\def\citeproctext{#2}\cite{#1}\endgroup}
86 | \makeatletter
87 | % allow citations to break across lines
88 | \let\@cite@ofmt\@firstofone
89 | % avoid brackets around text for \cite:
90 | \def\@biblabel#1{}
91 | \def\@cite#1#2{{#1\if@tempswa , #2\fi}}
92 | \makeatother
93 | \newlength{\cslhangindent}
94 | \setlength{\cslhangindent}{1.5em}
95 | \newlength{\csllabelwidth}
96 | \setlength{\csllabelwidth}{3em}
97 | \newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing
98 | {\begin{list}{}{%
99 | \setlength{\itemindent}{0pt}
100 | \setlength{\leftmargin}{0pt}
101 | \setlength{\parsep}{0pt}
102 | % turn on hanging indent if param 1 is 1
103 | \ifodd #1
104 | \setlength{\leftmargin}{\cslhangindent}
105 | \setlength{\itemindent}{-1\cslhangindent}
106 | \fi
107 | % set entry spacing
108 | \setlength{\itemsep}{#2\baselineskip}}}
109 | {\end{list}}
110 | \usepackage{calc}
111 | \newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}}
112 | \newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}}
113 | \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}}
114 | \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
115 | $endif$
116 |
117 | % --- Page layout -------------------------------------------------------------
118 | \usepackage[top=3.5cm, bottom=3cm, right=1.5cm, left=1.0cm,
119 | headheight=2.2cm, reversemp, includemp, marginparwidth=4.5cm]{geometry}
120 |
121 | % --- Default font ------------------------------------------------------------
122 | $if(joss)$
123 | \renewcommand\familydefault{\sfdefault}
124 | $endif$
125 |
126 | % --- Style -------------------------------------------------------------------
127 | \renewcommand{\captionfont}{\small\sffamily}
128 | \renewcommand{\captionlabelfont}{\bfseries}
129 |
130 | % --- Section/SubSection/SubSubSection ----------------------------------------
131 | \titleformat{\section}
132 | {\normalfont\sffamily\Large\bfseries}
133 | {}{0pt}{}
134 | \titleformat{\subsection}
135 | {\normalfont\sffamily\large\bfseries}
136 | {}{0pt}{}
137 | \titleformat{\subsubsection}
138 | {\normalfont\sffamily\bfseries}
139 | {}{0pt}{}
140 | \titleformat*{\paragraph}
141 | {\sffamily\normalsize}
142 |
143 |
144 | % --- Header / Footer ---------------------------------------------------------
145 | \usepackage{fancyhdr}
146 | \pagestyle{fancy}
147 | \fancyhf{}
148 | %\renewcommand{\headrulewidth}{0.50pt}
149 | \renewcommand{\headrulewidth}{0pt}
150 | \fancyhead[L]{\hspace{-0.75cm}\includegraphics[width=5.5cm]{$logo_path$}}
151 | \fancyhead[C]{}
152 | \fancyhead[R]{}
153 | \renewcommand{\footrulewidth}{0.25pt}
154 |
155 | \fancyfoot[L]{\parbox[t]{0.98\headwidth}{\footnotesize{\sffamily $self-citation$}.}}
156 |
157 |
158 | \fancyfoot[R]{\sffamily \thepage}
159 | \makeatletter
160 | \let\ps@plain\ps@fancy
161 | \fancyheadoffset[L]{4.5cm}
162 | \fancyfootoffset[L]{4.5cm}
163 |
164 | % --- Macros ---------
165 |
166 | \definecolor{linky}{rgb}{0.0, 0.5, 1.0}
167 |
168 | \newtcolorbox{repobox}
169 | {colback=red, colframe=red!75!black,
170 | boxrule=0.5pt, arc=2pt, left=6pt, right=6pt, top=3pt, bottom=3pt}
171 |
172 | \newcommand{\ExternalLink}{%
173 | \tikz[x=1.2ex, y=1.2ex, baseline=-0.05ex]{%
174 | \begin{scope}[x=1ex, y=1ex]
175 | \clip (-0.1,-0.1)
176 | --++ (-0, 1.2)
177 | --++ (0.6, 0)
178 | --++ (0, -0.6)
179 | --++ (0.6, 0)
180 | --++ (0, -1);
181 | \path[draw,
182 | line width = 0.5,
183 | rounded corners=0.5]
184 | (0,0) rectangle (1,1);
185 | \end{scope}
186 | \path[draw, line width = 0.5] (0.5, 0.5)
187 | -- (1, 1);
188 | \path[draw, line width = 0.5] (0.6, 1)
189 | -- (1, 1) -- (1, 0.6);
190 | }
191 | }
192 |
193 | \definecolor{c53baa1}{RGB}{83,186,161}
194 | \definecolor{c202826}{RGB}{32,40,38}
195 | \def \rorglobalscale {0.1}
196 | \newcommand{\rorlogo}{%
197 | \begin{tikzpicture}[y=1cm, x=1cm, yscale=\rorglobalscale,xscale=\rorglobalscale, every node/.append style={scale=\rorglobalscale}, inner sep=0pt, outer sep=0pt]
198 | \begin{scope}[even odd rule,line join=round,miter limit=2.0,shift={(-0.025, 0.0216)}]
199 | \path[fill=c53baa1,nonzero rule,line join=round,miter limit=2.0] (1.8164, 3.012) -- (1.4954, 2.5204) -- (1.1742, 3.012) -- (1.8164, 3.012) -- cycle;
200 | \path[fill=c53baa1,nonzero rule,line join=round,miter limit=2.0] (3.1594, 3.012) -- (2.8385, 2.5204) -- (2.5172, 3.012) -- (3.1594, 3.012) -- cycle;
201 | \path[fill=c53baa1,nonzero rule,line join=round,miter limit=2.0] (1.1742, 0.0669) -- (1.4954, 0.5588) -- (1.8164, 0.0669) -- (1.1742, 0.0669) -- cycle;
202 | \path[fill=c53baa1,nonzero rule,line join=round,miter limit=2.0] (2.5172, 0.0669) -- (2.8385, 0.5588) -- (3.1594, 0.0669) -- (2.5172, 0.0669) -- cycle;
203 | \path[fill=c202826,nonzero rule,line join=round,miter limit=2.0] (3.8505, 1.4364).. controls (3.9643, 1.4576) and (4.0508, 1.5081) .. (4.1098, 1.5878).. controls (4.169, 1.6674) and (4.1984, 1.7642) .. (4.1984, 1.8777).. controls (4.1984, 1.9719) and (4.182, 2.0503) .. (4.1495, 2.1132).. controls (4.1169, 2.1762) and (4.0727, 2.2262) .. (4.0174, 2.2635).. controls (3.9621, 2.3006) and (3.8976, 2.3273) .. (3.824, 2.3432).. controls (3.7505, 2.359) and (3.6727, 2.367) .. (3.5909, 2.367) -- (2.9676, 2.367) -- (2.9676, 1.8688).. controls (2.9625, 1.8833) and (2.9572, 1.8976) .. (2.9514, 1.9119).. controls (2.9083, 2.0164) and (2.848, 2.1056) .. (2.7705, 2.1791).. controls (2.6929, 2.2527) and (2.6014, 2.3093) .. (2.495, 2.3487).. controls (2.3889, 2.3881) and (2.2728, 2.408) .. (2.1468, 2.408).. controls (2.0209, 2.408) and (1.905, 2.3881) .. (1.7986, 2.3487).. controls (1.6925, 2.3093) and (1.6007, 2.2527) .. (1.5232, 2.1791).. controls (1.4539, 2.1132) and (1.3983, 2.0346) .. (1.3565, 1.9436).. controls (1.3504, 2.009) and (1.3351, 2.0656) .. (1.3105, 2.1132).. controls (1.2779, 2.1762) and (1.2338, 2.2262) .. (1.1785, 2.2635).. controls (1.1232, 2.3006) and (1.0586, 2.3273) .. (0.985, 2.3432).. controls (0.9115, 2.359) and (0.8337, 2.367) .. (0.7519, 2.367) -- (0.1289, 2.367) -- (0.1289, 0.7562) -- (0.4837, 0.7562) -- (0.4837, 1.4002) -- (0.6588, 1.4002) -- (0.9956, 0.7562) -- (1.4211, 0.7562) -- (1.0118, 1.4364).. controls (1.1255, 1.4576) and (1.2121, 1.5081) .. (1.2711, 1.5878).. controls (1.2737, 1.5915) and (1.2761, 1.5954) .. (1.2787, 1.5991).. controls (1.2782, 1.5867) and (1.2779, 1.5743) .. (1.2779, 1.5616).. controls (1.2779, 1.4327) and (1.2996, 1.3158) .. (1.3428, 1.2113).. controls (1.3859, 1.1068) and (1.4462, 1.0176) .. (1.5237, 0.944).. controls (1.601, 0.8705) and (1.6928, 0.8139) .. (1.7992, 0.7744).. controls (1.9053, 0.735) and (2.0214, 0.7152) .. (2.1474, 0.7152).. controls (2.2733, 0.7152) and (2.3892, 0.735) .. (2.4956, 0.7744).. controls (2.6016, 0.8139) and (2.6935, 0.8705) .. (2.771, 0.944).. controls (2.8482, 1.0176) and (2.9086, 1.1068) .. (2.952, 1.2113).. controls (2.9578, 1.2253) and (2.9631, 1.2398) .. (2.9681, 1.2544) -- (2.9681, 0.7562) -- (3.3229, 0.7562) -- (3.3229, 1.4002) -- (3.4981, 1.4002) -- (3.8349, 0.7562) -- (4.2603, 0.7562) -- (3.8505, 1.4364) -- cycle(0.9628, 1.7777).. controls (0.9438, 1.7534) and (0.92, 1.7357) .. (0.8911, 1.7243).. controls (0.8623, 1.7129) and (0.83, 1.706) .. (0.7945, 1.7039).. controls (0.7588, 1.7015) and (0.7252, 1.7005) .. (0.6932, 1.7005) -- (0.4839, 1.7005) -- (0.4839, 2.0667) -- (0.716, 2.0667).. controls (0.7477, 2.0667) and (0.7805, 2.0643) .. (0.8139, 2.0598).. controls (0.8472, 2.0553) and (0.8768, 2.0466) .. (0.9025, 2.0336).. controls (0.9282, 2.0206) and (0.9496, 2.0021) .. (0.9663, 1.9778).. controls (0.9829, 1.9534) and (0.9914, 1.9209) .. (0.9914, 1.8799).. controls (0.9914, 1.8362) and (0.9819, 1.8021) .. (0.9628, 1.7777) -- cycle(2.6125, 1.3533).. controls (2.5889, 1.2904) and (2.5553, 1.2359) .. (2.5112, 1.1896).. controls (2.4672, 1.1433) and (2.4146, 1.1073) .. (2.3529, 1.0814).. controls (2.2916, 1.0554) and (2.2228, 1.0427) .. (2.1471, 1.0427).. controls (2.0712, 1.0427) and (2.0026, 1.0557) .. (1.9412, 1.0814).. controls (1.8799, 1.107) and (1.8272, 1.1433) .. (1.783, 1.1896).. controls (1.7391, 1.2359) and (1.7052, 1.2904) .. (1.6817, 1.3533).. controls (1.6581, 1.4163) and (1.6465, 1.4856) .. (1.6465, 1.5616).. controls (1.6465, 1.6359) and (1.6581, 1.705) .. (1.6817, 1.7687).. controls (1.7052, 1.8325) and (1.7388, 1.8873) .. (1.783, 1.9336).. controls (1.8269, 1.9799) and (1.8796, 2.0159) .. (1.9412, 2.0418).. controls (2.0026, 2.0675) and (2.0712, 2.0804) .. (2.1471, 2.0804).. controls (2.223, 2.0804) and (2.2916, 2.0675) .. (2.3529, 2.0418).. controls (2.4143, 2.0161) and (2.467, 1.9799) .. (2.5112, 1.9336).. controls (2.5551, 1.8873) and (2.5889, 1.8322) .. (2.6125, 1.7687).. controls (2.636, 1.705) and (2.6477, 1.6359) .. (2.6477, 1.5616).. controls (2.6477, 1.4856) and (2.636, 1.4163) .. (2.6125, 1.3533) -- cycle(3.8015, 1.7777).. controls (3.7825, 1.7534) and (3.7587, 1.7357) .. (3.7298, 1.7243).. controls (3.701, 1.7129) and (3.6687, 1.706) .. (3.6333, 1.7039).. controls (3.5975, 1.7015) and (3.5639, 1.7005) .. (3.5319, 1.7005) -- (3.3226, 1.7005) -- (3.3226, 2.0667) -- (3.5547, 2.0667).. controls (3.5864, 2.0667) and (3.6192, 2.0643) .. (3.6526, 2.0598).. controls (3.6859, 2.0553) and (3.7155, 2.0466) .. (3.7412, 2.0336).. controls (3.7669, 2.0206) and (3.7883, 2.0021) .. (3.805, 1.9778).. controls (3.8216, 1.9534) and (3.8301, 1.9209) .. (3.8301, 1.8799).. controls (3.8301, 1.8362) and (3.8206, 1.8021) .. (3.8015, 1.7777) -- cycle;
204 | \end{scope}
205 | \end{tikzpicture}
206 | }
207 |
208 | % --- Title / Authors ---------------------------------------------------------
209 | % patch \maketitle so that it doesn't center
210 | \patchcmd{\@maketitle}{center}{flushleft}{}{}
211 | \patchcmd{\@maketitle}{center}{flushleft}{}{}
212 | % patch \maketitle so that the font size for the title is normal
213 | \patchcmd{\@maketitle}{\LARGE}{\LARGE\sffamily}{}{}
214 | % patch the patch by authblk so that the author block is flush left
215 | \def\maketitle{{%
216 | \renewenvironment{tabular}[2][]
217 | {\begin{flushleft}}
218 | {\end{flushleft}}
219 | \AB@maketitle}}
220 | \renewcommand\AB@affilsepx{ \protect\Affilfont}
221 | %\renewcommand\AB@affilnote[1]{{\bfseries #1}\hspace{2pt}}
222 | \renewcommand\AB@affilnote[1]{{\bfseries #1}\hspace{3pt}}
223 | \renewcommand{\affil}[2][]%
224 | {\newaffiltrue\let\AB@blk@and\AB@pand
225 | \if\relax#1\relax\def\AB@note{\AB@thenote}\else\def\AB@note{#1}%
226 | \setcounter{Maxaffil}{0}\fi
227 | \begingroup
228 | \let\href=\href@Orig
229 | \let\protect\@unexpandable@protect
230 | \def\thanks{\protect\thanks}\def\footnote{\protect\footnote}%
231 | \@temptokena=\expandafter{\AB@authors}%
232 | {\def\\{\protect\\\protect\Affilfont}\xdef\AB@temp{#2}}%
233 | \xdef\AB@authors{\the\@temptokena\AB@las\AB@au@str
234 | \protect\\[\affilsep]\protect\Affilfont\AB@temp}%
235 | \gdef\AB@las{}\gdef\AB@au@str{}%
236 | {\def\\{, \ignorespaces}\xdef\AB@temp{#2}}%
237 | \@temptokena=\expandafter{\AB@affillist}%
238 | \xdef\AB@affillist{\the\@temptokena \AB@affilsep
239 | \AB@affilnote{\AB@note}\protect\Affilfont\AB@temp}%
240 | \endgroup
241 | \let\AB@affilsep\AB@affilsepx
242 | }
243 | \makeatother
244 | \renewcommand\Authfont{\sffamily\bfseries}
245 | \renewcommand\Affilfont{\sffamily\small\mdseries}
246 | \setlength{\affilsep}{1em}
247 |
248 |
249 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
250 | \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
251 | \usepackage[utf8]{inputenc}
252 |
253 | \else % if luatex or xelatex
254 | \ifxetex
255 | \usepackage{mathspec}
256 | \usepackage{fontspec}
257 |
258 | \else
259 | \usepackage{fontspec}
260 | \fi
261 | \defaultfontfeatures{Scale=MatchLowercase}
262 | \defaultfontfeatures[\sffamily]{Ligatures=TeX}
263 | \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
264 |
265 | \fi
266 | % use upquote if available, for straight quotes in verbatim environments
267 | \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
268 | % use microtype if available
269 | \IfFileExists{microtype.sty}{%
270 | \usepackage{microtype}
271 | \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
272 | }{}
273 |
274 | %% Font settings
275 | \usepackage{fontsetup} % Lazy way to get proper Greek lowercase glyphs
276 |
277 | % Use Hack https://sourcefoundry.org/hack/
278 | \setmonofont{Hack}
279 |
280 | $if(colorlinks)$
281 | \PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
282 | $endif$
283 | \urlstyle{same} % don't use monospace font for urls
284 | $if(lang)$
285 | \ifLuaTeX
286 | \usepackage[bidi=basic]{babel}
287 | \else
288 | \usepackage[bidi=default]{babel}
289 | \fi
290 | \babelprovide[main,import]{$babel-lang$}
291 | $for(babel-otherlangs)$
292 | \babelprovide[import]{$babel-otherlangs$}
293 | $endfor$
294 | % get rid of language-specific shorthands (see #6817):
295 | \let\LanguageShortHands\languageshorthands
296 | \def\languageshorthands#1{}
297 | $endif$
298 | $if(natbib)$
299 | \usepackage{natbib}
300 | \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
301 | $endif$
302 | $if(biblatex)$
303 | \usepackage$if(biblio-style)$[style=$biblio-style$]$endif${biblatex}
304 | $if(biblatexoptions)$\ExecuteBibliographyOptions{$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$}$endif$
305 | $for(bibliography)$
306 | \addbibresource{$bibliography$}
307 | $endfor$
308 | $endif$
309 | $if(listings)$
310 | \usepackage{listings}
311 | $endif$
312 | $if(lhs)$
313 | \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
314 | $endif$
315 | $if(highlighting-macros)$
316 | $highlighting-macros$
317 | $endif$
318 | $if(verbatim-in-note)$
319 | \usepackage{fancyvrb}
320 | \VerbatimFootnotes % allows verbatim text in footnotes
321 | $endif$
322 | $if(tables)$
323 | \usepackage{longtable,booktabs,array}
324 | $endif$
325 | $if(graphics)$
326 | \usepackage{graphicx}
327 | \makeatletter
328 | \newsavebox\pandoc@box
329 | \newcommand*\pandocbounded[1]{% scales image to fit in text height/width
330 | \sbox\pandoc@box{#1}%
331 | \Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
332 | \Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
333 | \ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
334 | \ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
335 | \else\usebox{\pandoc@box}%
336 | \fi%
337 | }
338 | % Set default figure placement to htbp
339 | \def\fps@figure{htbp}
340 | \makeatother
341 | $endif$
342 | $-- add watermark and linenumbers unless this is the final (non-draft) version
343 | $if(draft)$
344 | \usepackage{lineno}
345 | \linenumbers
346 | \usepackage{draftwatermark}
347 | $endif$
348 |
349 | $if(graphics)$
350 | \usepackage{graphicx,grffile}
351 | \makeatletter
352 | \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
353 | \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
354 | \makeatother
355 | % Scale images if necessary, so that they will not overflow the page
356 | % margins by default, and it is still possible to overwrite the defaults
357 | % using explicit options in \includegraphics[width, height, ...]{}
358 | \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
359 | $endif$
360 | $if(links-as-notes)$
361 | % Make links footnotes instead of hotlinks:
362 | \renewcommand{\href}[2]{#2\footnote{\url{#1}}}
363 | $endif$
364 | $if(strikeout)$
365 | \usepackage[normalem]{ulem}
366 | % avoid problems with \sout in headers with hyperref:
367 | \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
368 | $endif$
369 | $if(indent)$
370 | $else$
371 | \IfFileExists{parskip.sty}{%
372 | \usepackage{parskip}
373 | }{% else
374 | \setlength{\parindent}{0pt}
375 | \setlength{\parskip}{6pt plus 2pt minus 1pt}
376 | }
377 | $endif$
378 | $if(strikeout)$
379 | $-- also used for underline
380 | \usepackage{soul}
381 | $endif$
382 | \setlength{\emergencystretch}{3em} % prevent overfull lines
383 | \providecommand{\tightlist}{%
384 | \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
385 | $if(numbersections)$
386 | \setcounter{secnumdepth}{5}
387 | $else$
388 | \setcounter{secnumdepth}{0}
389 | $endif$
390 | $if(subparagraph)$
391 | $else$
392 | % Redefines (sub)paragraphs to behave more like sections
393 | \ifx\paragraph\undefined\else
394 | \let\oldparagraph\paragraph
395 | \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
396 | \fi
397 | \ifx\subparagraph\undefined\else
398 | \let\oldsubparagraph\subparagraph
399 | \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
400 | \fi
401 | $endif$
402 | $if(dir)$
403 | \ifxetex
404 | % load bidi as late as possible as it modifies e.g. graphicx
405 | $if(latex-dir-rtl)$
406 | \usepackage[RTLdocument]{bidi}
407 | $else$
408 | \usepackage{bidi}
409 | $endif$
410 | \fi
411 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
412 | \TeXXeTstate=1
413 | \newcommand{\RL}[1]{\beginR #1\endR}
414 | \newcommand{\LR}[1]{\beginL #1\endL}
415 | \newenvironment{RTL}{\beginR}{\endR}
416 | \newenvironment{LTR}{\beginL}{\endL}
417 | \fi
418 | $endif$
419 | $for(header-includes)$
420 | $header-includes$
421 | $endfor$
422 | \ifLuaTeX
423 | \usepackage{selnolig} % disable illegal ligatures
424 | \fi
425 |
426 | $if(title)$
427 | \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
428 | $endif$
429 | $if(subtitle)$
430 | \providecommand{\subtitle}[1]{}
431 | \subtitle{$subtitle$}
432 | $endif$
433 |
434 | $for(authors)$
435 | \author[$for(authors.affiliation)$$authors.affiliation$$sep$,$endfor$%
436 | $if(authors.equal-contrib)$*$endif$%
437 | $if(authors.cor-id)$\ensuremath\mathparagraph$endif$]{$authors.name$%
438 | $if(it.orcid)$
439 | \,\orcidlink{${it.orcid}}\,%
440 | $endif$
441 | $if(it.note)$
442 | \thanks{$it.note$}%
443 | $endif$
444 | }
445 | $endfor$
446 |
447 | $for(affiliations)$
448 | \affil[$affiliations.index$]{$affiliations.name$%
449 | $if(it.ror)$
450 | \,\protect\href{https://ror.org/$it.ror$}{\protect\rorlogo}\,%
451 | $endif$
452 | }
453 | $endfor$
454 | $if(article.author-notes.corresp)$
455 | \affil[$$\mathparagraph$$]{Corresponding author}
456 | $endif$
457 | $if(article.has-equal-contributors)$
458 | \affil[*]{$if(message.equal-contrib)$$message.equal-contrib$$else$These authors contributed equally.$endif$}
459 | $endif$
460 | \date{\vspace{-2.5ex}}
461 |
462 | \begin{document}
463 | $if(title)$
464 | \maketitle
465 | $endif$
466 | $if(abstract)$
467 | \begin{abstract}
468 | $abstract$
469 | \end{abstract}
470 | $endif$
471 |
472 | \marginpar{
473 |
474 | \begin{flushleft}
475 | $if(latex.before-metadata)$
476 | ${latex.before-metadata}
477 | $endif$
478 | %\hrule
479 | \sffamily\small
480 |
481 | {\bfseries DOI:} \href{https://doi.org/$article.doi$}{\color{linky}{$article.doi$}}
482 |
483 | \vspace{2mm}
484 | $if(retraction)$
485 | $-- Retraction notices don't show Software info
486 | $else$
487 | {\bfseries Software}
488 | \begin{itemize}
489 | \setlength\itemsep{0em}
490 | \item \href{$software_review_url$}{\color{linky}{Review}} \ExternalLink
491 | \item \href{$software_repository_url$}{\color{linky}{Repository}} \ExternalLink
492 | \item \href{https://doi.org/$archive_doi$}{\color{linky}{Archive}} \ExternalLink
493 | \end{itemize}
494 |
495 | \vspace{2mm}
496 | $endif$
497 |
498 | $if(joss)$
499 | $if(retraction)$
500 | $-- Retraction notices don't show Editor/Reviewers info
501 | $else$
502 | \par\noindent\hrulefill\par
503 |
504 | \vspace{2mm}
505 |
506 | {\bfseries Editor:} \href{$editor.url$}{$editor.name$} \ExternalLink
507 | $if(editor.orcid)$\,\orcidlink{${editor.orcid}}$endif$ \\
508 | \vspace{1mm}
509 | $if(reviewers)$
510 | {\bfseries Reviewers:}
511 | \begin{itemize}
512 | \setlength\itemsep{0em}
513 | $for(reviewers)$
514 | \item \href{https://github.com/$reviewers$}{@$reviewers$}
515 | $endfor$
516 | \end{itemize}
517 | $endif$
518 | \vspace{2mm}
519 | $endif$
520 | $endif$
521 |
522 | $if(retraction)$
523 | $-- Retraction notices don't have submission date
524 | $else$
525 | {\bfseries Submitted:} $submitted$\\
526 | $endif$
527 | {\bfseries Published:} $published$
528 |
529 | \vspace{2mm}
530 | {\bfseries License}\\
531 | Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (\href{https://creativecommons.org/licenses/by/4.0/}{\color{linky}{CC BY 4.0}}).
532 |
533 | $if(aas-doi)$
534 | \vspace{4mm}
535 | {\bfseries In partnership with}\\
536 | \vspace{2mm}
537 | \includegraphics[width=4cm]{$aas_logo_path$}
538 | \vspace{2mm}
539 | \newline
540 | This article and software are linked with research article DOI \href{https://doi.org/$aas-doi$}{\color{linky}{$aas-doi$}}, published in the $aas-journal$.
541 | $endif$
542 |
543 | $if(europar-doi)$
544 | \vspace{4mm}
545 | {\bfseries In partnership with}\\
546 | \vspace{2mm}
547 | \includegraphics[width=4cm]{$europar_logo_path$}
548 | \vspace{2mm}
549 | \newline
550 | JOSS Special Issue for Euro-Par 2022 Artefacts \href{https://doi.org/$europar-doi$}{\color{linky}{$europar-doi$}}
551 | $endif$
552 |
553 | \end{flushleft}
554 | }
555 |
556 | $for(include-before)$
557 | $include-before$
558 |
559 | $endfor$
560 | $if(toc)$
561 | {
562 | $if(colorlinks)$
563 | \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
564 | $endif$
565 | \setcounter{tocdepth}{$toc-depth$}
566 | \tableofcontents
567 | }
568 | $endif$
569 | $if(lot)$
570 | \listoftables
571 | $endif$
572 | $if(lof)$
573 | \listoffigures
574 | $endif$
575 | $body$
576 |
577 | $if(natbib)$
578 | $if(bibliography)$
579 | $if(biblio-title)$
580 | $if(book-class)$
581 | \renewcommand\bibname{$biblio-title$}
582 | $else$
583 | \renewcommand\refname{$biblio-title$}
584 | $endif$
585 | $endif$
586 | \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
587 |
588 | $endif$
589 | $endif$
590 | $if(biblatex)$
591 | \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
592 |
593 | $endif$
594 | $for(include-after)$
595 | $include-after$
596 |
597 | $endfor$
598 | \end{document}
599 |
--------------------------------------------------------------------------------