Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/preview/cob-unofficial/0.1.0/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pdf
10 changes: 10 additions & 0 deletions packages/preview/cob-unofficial/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 changes: 14 additions & 0 deletions packages/preview/cob-unofficial/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Unofficial CoB (The Company of Biologists) template

An unofficial template for The Company of Biologists (CoB) research articles.

## Example

See [template/report.typ](template/report.typ).

![Example research article](inc/thumbnail.png)

## Based on official CoB LaTeX template

* [CoB Manuscript preparation](https://journals.biologists.com/dev/pages/manuscript-prep)
* [CoB LaTeX template](https://journals.biologists.com/DocumentLibrary/DEV/DEV_latex_template.zip)
67 changes: 67 additions & 0 deletions packages/preview/cob-unofficial/0.1.0/inc/COB_Publisher_Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
220 changes: 220 additions & 0 deletions packages/preview/cob-unofficial/0.1.0/src/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
// Unofficial CoB (The Company of Biologists) template.

#import "@preview/hallon:0.1.2"

Check failure on line 3 in packages/preview/cob-unofficial/0.1.0/src/lib.typ

View check run for this annotation

Typst package check / @preview/cob-unofficial:0.1.0

packages/preview/cob-unofficial/0.1.0/src/lib.typ#L3

The following error was reported by the Typst compiler: failed to download package (All packages are supposed to be present in the `packages` repository, or in the local cache.)

Check failure on line 3 in packages/preview/cob-unofficial/0.1.0/src/lib.typ

View check run for this annotation

Typst package check / @preview/cob-unofficial:0.1.0

packages/preview/cob-unofficial/0.1.0/src/lib.typ#L3

The following error was reported by the Typst compiler: failed to download package (All packages are supposed to be present in the `packages` repository, or in the local cache.)

Check warning on line 3 in packages/preview/cob-unofficial/0.1.0/src/lib.typ

View check run for this annotation

Typst package check / @preview/cob-unofficial:0.1.0

packages/preview/cob-unofficial/0.1.0/src/lib.typ#L3

This import seems to use an older version of the package.

// Fonts.
#let font-serif = "Nimbus Roman"
#let font-sans-serif = "Nimbus Sans"

// titcolor specifies the "super" title colour.
#let titcolor = rgb(64, 193, 234) // CoB cyan
// linkblue specifies the colour of links.
#let linkblue = rgb(66, 93, 178)

// print-supertitle displays the "super" title (i.e. "RESEARCH") on the front
// page.
#let print-supertitle(supertitle) = {
set text(font: font-sans-serif, size: 8pt, fill: titcolor, tracking: 0.5pt)
//show text: smallcaps // TODO: figure out how to fix (need Cap version of font)?
show text: strong
show text: upper
block(supertitle)
}

// print-header-supertitle displays the "super" title (i.e. "RESEARCH") in the
// page header.
#let print-header-supertitle(supertitle) = {
set text(font: font-sans-serif, size: 5.6pt, fill: titcolor, tracking: 0.4pt)
//show text: smallcaps // TODO: figure out how to fix (need Cap version of font)?
show text: upper
supertitle
}

// print-title displays the title of the paper.
#let print-title(title) = {
set text(font: font-sans-serif, size: 18pt)
block(title)
}

// print-authors displays the list of authors.
#let print-authors(authors) = {
set text(font: font-sans-serif, size: 12pt)
show text: strong
block(authors.join(", ", last: " and "))
}

// print-availability displays an availability notice.
#let print-availability(title, body) = {
set text(font: font-sans-serif, size: 7pt)
block(
above: 1.9em,
below: 0.8em,
text(font: font-sans-serif, size: 7.5pt, weight: "bold")[#title availability],
)
body
}

// data-availability displays a data availability notice.
#let data-availability(body) = {
print-availability("Data", body)
}

// code-availability displays a code availability notice.
#let code-availability(body) = {
print-availability("Code", body)
}

// template applies the CoB research paper format to the document.
#let template(
supertitle: "Research Article",
title: "Paper Title",
authors: ("John Doe", "Jane Rue"),
article-id: "xxxxxx",
article-year: datetime.today().year(),
date: datetime.today(),
body
) = {
set page(
"us-letter",
margin: (
inside: 1.685cm,
outside: 1.77cm,
top: 2.38cm,
),
columns: 2,
header: context [
#if here().page() == 1 [
#set text(font: font-sans-serif, size: 7pt)
#rect(
stroke: (bottom: 0.5pt + black),
width: 100%,
inset: (x: 0pt, y: 1.02em),
)[
#stack(
dir: ltr,
[© #{article-year}. MANUSCRIPT SUBMITTED TO JOURNAL OF CELL SCIENCE (#{article-year}) 00, jcs#{article-id}. doi:#link("https://doi.org/10.1242/jcs."+article-id, "10.1242/jcs."+article-id)],
h(1fr),
box(
inset: (bottom: -0.175cm),
// TODO: use PDF version of logo when Typst 0.14.0 is released.
image("/inc/COB_Publisher_Logo.svg"),
),
)
]
#v(-0.3mm)
] else [
#rect(
stroke: (bottom: 0.5pt + black),
width: 100%,
inset: (x: 0pt, y: 0.7em)
)[
#stack(
dir: ltr,
print-header-supertitle(supertitle),
h(1fr),
text(font: font-serif, size: 7pt)[Journal of Cell Science (#{article-year}) 00, jcs#{article-id}. doi:#link("https://doi.org/10.1242/jcs."+article-id, "10.1242/jcs."+article-id)],
)

]
]
],
header-ascent: 30%,
)

// Set heading styles.
show heading.where(level: 1): it => {
set text(font: font-sans-serif, size: 8.5pt)
show text: upper
it
}
show heading.where(level: 2): it => {
set text(font: font-sans-serif, size: 8.5pt)
it
}
show heading.where(level: 3): it => {
//set text(font: font-serif, size: 9.4pt)
set text(weight: "regular") // disable bold
show text: emph
it
}

// Set default font and text size.
set text(font: font-serif, size: 9.4pt)

// Set line height and justification of paragraphs.
set par(
justify: true,
first-line-indent: 1.2em,
spacing: 0.5em,
leading: 0.5em, // adjust line height
)

//show ref: set text(fill: linkblue)
show link: set text(fill: linkblue)
show cite: set text(fill: linkblue)

// Set bibliography title.
set bibliography(title: "References")

// HACK to insert "Received date" before footnote entry list.
show footnote.entry: it => {
let loc = it.note.location()
if counter(footnote).at(loc).first() == 1 {
set text(size: 8pt)
block(
above: 0.5em,
strong[Received #date.display("[day] [month repr:long] [year]")]
)
}
it
}

// Style footnote links.
show footnote: set text(fill: linkblue)

// Style tables.
show figure.where(kind: table): block.with(above: 1em)
show figure.where(kind: table): set figure.caption(position: top, separator: ". ")
set table(
stroke: none,
inset: (x: 5pt, y: 2pt),
)
set table.hline(stroke: 0.3pt)

// Apply figure and subfigure styles.
show: hallon.style-figures

// Use short supplement for figures and subfigures (place after
// `hallon.style-subfig` show rule for supplement of "subfigure" kind to take
// effect).
show figure.where(kind: image): set figure(supplement: "Fig.")
show figure.where(kind: image): set figure.caption(separator: [. ])
show figure.where(kind: "subfigure"): set figure(supplement: "Fig.")

// https://rupress.org/jcb/pages/reference-guidelines
//
// - dependent style: https://www.zotero.org/styles/the-journal-of-cell-biology
// - independent style: https://www.zotero.org/styles/the-rockefeller-university-press
set bibliography(style: "the-rockefeller-university-press.csl")

// Set space between columns.
set columns(gutter: 0.5cm)

// Display title and authors.
place(
top+left,
scope: "parent",
float: true,
)[
#v(0.6mm)
#print-supertitle(supertitle)
#v(2.6mm)
#print-title(title)
#v(0.4mm)
#print-authors(authors)
#v(0.78cm)
]

// Display body.
body
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" default-locale="en-US">
<info>
<title>The Journal of Cell Biology</title>
<id>http://www.zotero.org/styles/the-journal-of-cell-biology</id>
<link href="http://www.zotero.org/styles/the-journal-of-cell-biology" rel="self"/>
<link href="http://www.zotero.org/styles/the-rockefeller-university-press" rel="independent-parent"/>
<link href="http://jcb.rupress.org/" rel="documentation"/>
<category citation-format="author-date"/>
<category field="biology"/>
<issn>0021-9525</issn>
<eissn>1540-8140</eissn>
<updated>2013-04-25T00:05:05+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
<info>
<title>The Rockefeller University Press</title>
<id>http://www.zotero.org/styles/the-rockefeller-university-press</id>
<link href="http://www.zotero.org/styles/the-rockefeller-university-press" rel="self"/>
<link href="http://jgp.rupress.org/site/misc/ifora.xhtml" rel="documentation"/>
<author>
<name>Charlie Kim</name>
<email>[email protected]</email>
<!-- Original credit to Rishi Parikh ([email protected]) for development of this style -->
</author>
<category citation-format="author-date"/>
<category field="biology"/>
<category field="medicine"/>
<summary>The Rockefeller University Press style</summary>
<updated>2013-09-27T22:18:36+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="editor">
<names variable="editor" delimiter=", ">
<name and="text" initialize-with="." delimiter=", "/>
<label form="long" prefix=", "/>
</names>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="first" and="text" sort-separator=", " initialize-with="." delimiter=", " delimiter-precedes-last="always"/>
<label form="short" prefix=" " suffix=" "/>
<substitute>
<names variable="editor"/>
<text variable="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="text" delimiter=", " initialize-with="."/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text variable="title"/>
</substitute>
</names>
</macro>
<macro name="title">
<text variable="title"/>
</macro>
<macro name="publisher">
<group delimiter=", " suffix=".">
<text variable="publisher"/>
<text variable="publisher-place"/>
</group>
</macro>
<macro name="year-date">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" collapse="year-suffix">
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="year-date"/>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography hanging-indent="true" et-al-min="99" et-al-use-first="98">
<sort>
<key macro="author"/>
<key variable="issued"/>
</sort>
<layout suffix=".">
<text macro="author" suffix="."/>
<date variable="issued" prefix=" " suffix=".">
<date-part name="year"/>
</date>
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song thesis" match="any">
<group delimiter=". " prefix=" ">
<text macro="title"/>
<!-- based on the instructions for the Journal of Daire Science, the volume should also be included if present, see http://www.journalofdairyscience.org/webfiles/images/journals/jods/JDS_Instruct_for_Contributors_2012.pdf -->
<text variable="volume"/>
<text macro="edition"/>
<text macro="editor"/>
<text macro="publisher"/>
<text variable="number-of-pages" suffix=" pp"/>
</group>
</if>
<else-if type="chapter paper-conference" match="any">
<group delimiter=". " prefix=" ">
<text macro="title"/>
<group delimiter=" ">
<text term="in" text-case="capitalize-first" font-style="italic"/>
<text variable="container-title"/>
</group>
<text macro="editor"/>
<text macro="publisher"/>
<text variable="page"/>
</group>
</else-if>
<else>
<group delimiter=". " prefix=" ">
<text macro="title"/>
<text variable="container-title" form="short" font-style="italic"/>
<group delimiter=":">
<text variable="volume"/>
<text variable="page"/>
</group>
<text prefix="doi:" variable="DOI"/>
</group>
</else>
</choose>
</layout>
</bibliography>
</style>
Loading