Skip to content

Commit 093a6ee

Browse files
authored
pollux:0.1.0 (#3370)
1 parent bf91536 commit 093a6ee

File tree

11 files changed

+413
-0
lines changed

11 files changed

+413
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.history/
2+
.history/*
3+
.DS_Store
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Kaito Takanami
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.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Pollux: A Gemini-like Poster Template for Typst
2+
3+
A clean academic poster template for [Typst](https://typst.app), inspired by the LaTeX Gemini beamerposter theme. The template is based on [peace-of-posters](https://github.com/jonaspleyer/peace-of-posters) (MIT License) and styled after [Gemini](https://github.com/anishathalye/gemini) (MIT License).
4+
5+
## Features
6+
- Simple, minimal and clean design
7+
- Two-column a0 poster layout
8+
- Customizable theme and layout
9+
- Japanese and English mixed text support (日本語と英語の混在したテキストをサポート)
10+
11+
## Gallery
12+
| | |
13+
|---|---|
14+
| ![Gallery EN](gallery/steel-blue-en.png) | ![Gallery JA](gallery/steel-blue-ja.png) |
15+
16+
## Font Settings for Japanese and English mixed text
17+
This template uses the following fonts by default:
18+
19+
- Lato and Raleway for English text
20+
- Noto Sans CJK JP for Japanese text
21+
22+
As of Typst 0.14 (the latest release), the system does not yet support dynamic font loading.
23+
To ensure proper rendering of bold text, especially for Noto Sans CJK JP, please remove any dynamically loaded versions of the font and reinstall the static version instead.
24+
25+
You may also use alternative fonts by modifying the font entries in the style files.
26+
27+
## License
28+
MIT License
29+
30+
This Typst template is adapted from [peace-of-posters](https://github.com/jonaspleyer/peace-of-posters) by Jonas Pleyer and inspired by [Gemini](https://github.com/anishathalye/gemini) by Anish Athalye. See LICENSE for full details.
31+
32+
## References
33+
- [peace-of-posters (MIT License)](https://github.com/jonaspleyer/peace-of-posters)
34+
- [Gemini beamerposter theme (MIT License)](https://github.com/anishathalye/gemini)
917 KB
Loading
898 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#import "style/boxes.typ": *
2+
#import "style/layouts.typ": *
3+
#import "style/themes.typ": *
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
#import "./themes.typ": *
2+
#import "./layouts.typ": *
3+
4+
5+
// column-box
6+
#let column-box(
7+
body,
8+
heading: none,
9+
) = context {
10+
11+
let pt = _state-poster-theme.get()
12+
let pl = _state-poster-layout.get()
13+
let heading-color = pt.at("heading-color", default: rgb(64, 115, 158))
14+
let heading-size = pt.at("heading-size", default: 42pt)
15+
let body-size = pt.at("body-size", default: 40pt)
16+
let lang = pt.at("lang", default: "ja")
17+
let font = pt.at("font", default: ("Lato", "Noto Sans CJK JP"))
18+
19+
let heading-content = if heading==none { none } else {[
20+
#set text(
21+
fill: heading-color,
22+
size: heading-size,
23+
lang: lang,
24+
font: font,
25+
weight: "medium",
26+
)
27+
#set align(center)
28+
#box(width: 100%)[#heading]
29+
#v(-0.75em)
30+
#rect(width: 100%, height: 1.5pt, fill: black)
31+
#v(0.5em)
32+
]}
33+
34+
let body-content = if body==none { none } else {[
35+
#set text(
36+
fill: black,
37+
size: body-size,
38+
lang: "ja",
39+
font: ("Lato", "Noto Sans CJK JP"),
40+
weight: "light",
41+
)
42+
#body
43+
]}
44+
45+
stack(dir: ttb,
46+
heading-content,
47+
box(stroke: none)[#body-content],
48+
)
49+
}
50+
51+
// title-box
52+
#let title-box(
53+
title,
54+
authors: none,
55+
institutes: none,
56+
) = context {
57+
58+
let pt = _state-poster-theme.get()
59+
let pl = _state-poster-layout.get()
60+
let text-color = pt.at("text-color", default: white)
61+
let fill-color = pt.at("fill-color", default: rgb(64, 115, 158))
62+
let stroke-color = pt.at("stroke-color", default: rgb(39, 60, 117))
63+
let title-size = pt.at("title-size", default: 75pt)
64+
let authors-size = pt.at("authors-size", default: 55pt)
65+
let institutes-size = pt.at("institutes-size", default: 40pt)
66+
let lang = pt.at("lang", default: "ja")
67+
let font = pt.at("font", default: ("Raleway", "Noto Sans CJK JP"))
68+
let weight = pt.at("weight", default: "regular")
69+
70+
/// Generate body of box
71+
let text-content = [
72+
#set align(center)
73+
#v(24.0pt)
74+
#set text(size: title-size)
75+
#title\
76+
#v(0.75em, weak: true)
77+
#set text(size: authors-size)
78+
#if authors!=none {[#authors\ ]}
79+
#if institutes!=none {[
80+
#set text(size: institutes-size)
81+
#institutes
82+
]}
83+
#v(20.0pt)
84+
]
85+
86+
rect(
87+
inset: 0.5em,
88+
width: 100%,
89+
fill: fill-color,
90+
stroke: stroke-color,
91+
)[
92+
#set text(
93+
lang: lang,
94+
fill: text-color,
95+
font: font,
96+
weight: weight,
97+
)
98+
#align(center, box(text-content, width: 100%))
99+
]
100+
}
101+
102+
#let bottom-box(
103+
body,
104+
text-relative-width: 70%,
105+
x-inset: 2.0cm,
106+
bottom-inset: 2.0cm,
107+
) = context {
108+
109+
let pt = _state-poster-theme.get()
110+
let pl = _state-poster-layout.get()
111+
let text-color = pt.at("text-color", default: black)
112+
let body-size = pt.at("body-size", default: 40pt)
113+
let lang = pt.at("lang", default: "ja")
114+
let font = pt.at("font", default: ("Lato", "Noto Sans CJK JP"))
115+
let weight = pt.at("weight", default: "light")
116+
117+
if body==none {
118+
none
119+
} else {
120+
let content = [
121+
// draw a line
122+
#rect(width: 100%, height: 1.5pt, fill: gray)
123+
#v(-0.5em)
124+
#set text(
125+
fill: text-color,
126+
size: body-size,
127+
lang: lang,
128+
font: font,
129+
weight: weight,
130+
)
131+
#set align(top+left)
132+
#body
133+
]
134+
let r = box(stroke: none, width: 100%, inset: (x: x-inset, y: bottom-inset))[#content]
135+
align(bottom, r)
136+
}
137+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#let _default-layout = (
2+
:
3+
)
4+
5+
#let layout-a0 = _default-layout + (
6+
"paper": "a0",
7+
"size": (841mm, 1188mm),
8+
"body-size": 33pt,
9+
"heading-size": 50pt,
10+
"title-size": 75pt,
11+
"subtitle-size": 60pt,
12+
"authors-size": 50pt,
13+
"institutes-size": 45pt,
14+
"keywords-size": 40pt,
15+
)
16+
17+
#let _state-poster-layout = state("poster-layout", layout-a0)
18+
19+
#let get-poster-layout() = _state-poster-layout.get()
20+
21+
#let update-poster-layout(..args) = context {
22+
for (arg, val) in args.named() {
23+
_state-poster-layout.update(pt => {
24+
pt.insert(arg, val)
25+
pt
26+
})
27+
}
28+
let pl = _state-poster-layout.get()
29+
set block(spacing: pl.at("spacing", default: 1.6em))
30+
}
31+
32+
#let set-poster-layout(layout) = context {
33+
_state-poster-layout.update(pt => {
34+
pt=layout
35+
pt
36+
})
37+
set block(spacing: layout.at("spacing", default: 1.6em))
38+
}
39+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#let steel-blue = (
2+
"heading-color": rgb(64, 115, 158),
3+
"fill-color": rgb(64, 115, 158),
4+
"stroke-color": rgb(39, 60, 117),
5+
)
6+
7+
#let solar-orange = (
8+
"heading-color": rgb(227, 125, 20),
9+
"fill-color": rgb(243, 156, 18),
10+
"stroke-color": rgb(185, 81, 0),
11+
)
12+
13+
#let forest-green = (
14+
"heading-color": rgb(44, 102, 52),
15+
"fill-color": rgb(60, 141, 69),
16+
"stroke-color": rgb(27, 73, 35),
17+
)
18+
19+
#let crimson-accent = (
20+
"heading-color": rgb(176, 23, 31),
21+
"fill-color": rgb(204, 41, 54),
22+
"stroke-color": rgb(112, 12, 24),
23+
)
24+
25+
#let teal-mist = (
26+
"heading-color": rgb(0, 128, 128),
27+
"fill-color": rgb(64, 179, 162),
28+
"stroke-color": rgb(0, 88, 88),
29+
)
30+
31+
#let royal-purple = (
32+
"heading-color": rgb(90, 66, 178),
33+
"fill-color": rgb(120, 94, 196),
34+
"stroke-color": rgb(54, 33, 123),
35+
)
36+
37+
38+
#let _state-poster-theme = state("poster-theme", steel-blue)
39+
40+
41+
#let update-theme(..args) = {
42+
for (arg, val) in args.named() {
43+
_state-poster-theme.update(pt => {
44+
pt.insert(arg, val)
45+
pt
46+
})
47+
}
48+
}
49+
50+
#let set-theme(theme) = {
51+
_state-poster-theme.update(pt => {
52+
pt=theme
53+
pt
54+
})
55+
}

0 commit comments

Comments
 (0)