Skip to content

quic-style:0.0.1 #2380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions packages/preview/quic-style/0.0.1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.github
scripts
tests
Justfile
docs
fonts
17 changes: 17 additions & 0 deletions packages/preview/quic-style/0.0.1/.typstignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# this is not a "standard" ignore file, it's specific to this template's `scripts/package` script
# list any files here that should not be uploaded to Universe when releasing this package

# if you are used to ignore files, be aware that .typstignore is a bit more limited:
# - only this file is used; .typstignore files in subdirectories are not considered
# - patterns must match file/directory names from the beginning: `x.typ` will not match `src/x.typ`
# - `*` in patterns works, but also matches directory separators: `*.typ` _will_ match `src/x.typ`
# .git and .typstignore are excluded automatically

.github
scripts
tests
Justfile
# PDF manuals should be included so that they can be linked, but not their sources
docs/*
!docs/*.pdf
fonts
25 changes: 25 additions & 0 deletions packages/preview/quic-style/0.0.1/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# [unreleased](https://github.com/JamesxX/graceful-genetics/tags/)
## Added

## Removed

## Changed

## Migration Guide from v0.1.X

---

# [v0.1.1](https://github.com/JamesxX/graceful-genetics/releases/tags/v0.1.1)
## Added
- `make-venue` is a template argument to allow the end-author to change the "header" shown on the first page
- `make-title` is another template argument for the same ends but for the title + authors + abstract + keywords combo. It is placed in the page floating scoped to `parent`.

## Removed

## Changed
- `set page(columns: 2)` instead of `show: columns(2)`

---

# [v0.1.0](https://github.com/JamesxX/graceful-genetics/releases/tags/v0.1.0)
Initial Release
24 changes: 24 additions & 0 deletions packages/preview/quic-style/0.0.1/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>
116 changes: 116 additions & 0 deletions packages/preview/quic-style/0.0.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# typst-quic-style

![](thumbnails/typst-quic-style-design.png)

A cohesive Typst design template that can be used in various situations—daily life, research, and experiments!

Forked from [JamesxX/graceful-genetics](https://github.com/JamesxX/graceful-genetics) — thanks!

## 日本語対応

- 段落の字下げ (見出しの直下も字下げする)
- 行間
- 日本語フォント (Zen Kaku Gothic New, Zen Old Mincho)
- 表の上にキャプション

など...

## Required Fonts

This template requires the following fonts:

- [Zen Kaku Gothic New](https://fonts.google.com/specimen/Zen+Kaku+Gothic+New) - For Japanese sans-serif text
- [Zen Old Mincho](https://fonts.google.com/specimen/Zen+Old+Mincho) - For Japanese serif text
- TeX Gyre Heros - For English sans-serif text
- TeX Gyre Pagella - For English serif text

Please download and install these fonts on your system before using the template.

### Font Installation

1. Download the fonts:

- Zen fonts can be downloaded from Google Fonts
- TeX Gyre fonts can be downloaded from [GUST e-foundry](https://www.gust.org.pl/projects/e-foundry/tex-gyre)

2. Install the fonts on your system:
- For Linux: Copy the font files to `~/.local/share/fonts/` and run `fc-cache -f -v`
- For macOS: Double-click the font files and click "Install Font"
- For Windows: Double-click the font files and click "Install"

## Package Installation

- Linux: ~/.local/share/typst/packages/local
- macOS: ~/Library/Application Support/typst/packages/local
- Windows: %APPDATA%\typst\packages\local

## Package Structure

The main components of this package are:

- `src/` - Core implementation files
- `template/` - Template files for different document types
- `thumbnails/` - Preview images of the templates

Additional files for development and documentation:

- `docs/manual.pdf` - Detailed documentation of the package
- `examples/` - Example documents showcasing different use cases
- `tests/` - Test files for development

## Media

<p align="center">
<img alt="paper" src="./thumbnails/paper.jpg" width="45%">
&nbsp; &nbsp; &nbsp; &nbsp;
<img alt="progress report" src="./thumbnails/progress_report.jpg" width="45%">
&nbsp; &nbsp; &nbsp; &nbsp;
</p>

<p align="center">
<img alt="note" src="./thumbnails/note.jpg" width="45%">
&nbsp; &nbsp; &nbsp; &nbsp;
<img alt="log" src="./thumbnails/log.jpg" width="45%">
</p>

## Getting Started

To use this template, simply import it as shown below:

```typ
#import "@preview/quic-style:0.0.1"

#show: quic-style.template.with(
title: [タイトル],
authors: (
(
name: "name",
department: "department",
institution: "institution",
city: "city",
country: "country",
mail: "[email protected]",
),
),
date: (
year: 2025,
month: "May",
day: 7,
),
keywords: (
"Space",
"Mail",
"Astromail",
"Faster-than-Light",
"Mars",
),
doi: "",
abstract: [
Recent advances in space-based document processing have enabled faster mail delivery between different planets of a solar system. Given the time it takes for a message to be transmitted from one planet to the next, its estimated that even a one-way trip to a distant destination could take up to one year. During these periods of interplanetary mail delivery there is a slight possibility of mail being lost in transit. This issue is considered so serious that space management employs P.I. agents to track down and retrieve lost mail. We propose A-Mail, a new anti-matter based approach that can ensure that mail loss occurring during interplanetary transit is unobservable and therefore potentially undetectable. Going even further, we extend A-Mail to predict problems and apply existing and new best practices to ensure the mail is delivered without any issues. We call this extension AI-Mail.
],
doc_type: "PROGRESS_REPORT", // or "NOTE", "LOG", "PAPER"
)

// セクション
= 1.
```
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
161 changes: 161 additions & 0 deletions packages/preview/quic-style/0.0.1/src/impl.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
#let make-venue(doc_type) = {
let top_text = ""
let bottom_text = ""
let fill_color = luma(140) // Default color

if doc_type == "PROGRESS_REPORT" {
top_text = "PROGRESS"
bottom_text = "REPORT"
fill_color = rgb("#ffa500") // 例: オレンジ系の色
} else if doc_type == "PAPER" {
top_text = "PAPER"
bottom_text = "" // PAPER の場合は下のテキストなし
fill_color = rgb("#4169e1") // 例: 青系の色
} else if doc_type == "NOTE" {
top_text = "NOTE"
bottom_text = "" // NOTE の場合は下のテキストなし
fill_color = rgb("#3cb371") // 例: 緑系の色
} else if doc_type == "LOG" {
top_text = "LOG"
bottom_text = "" // LOG の場合は下のテキストなし
fill_color = luma(140)
}
// 他のタイプが必要な場合はここに追加

move(
dy: -1.9cm,
{
box(
rect(fill: fill_color, inset: 10pt, height: 2.5cm)[
#set text(font: "Zen Old Mincho", fill: white, weight: 700, size: 20pt)
#align(bottom)[#top_text] // 変数を使用
],
)
set text(22pt, font: "Zen Kaku Gothic New")
// 下のテキストが存在する場合のみ表示
if bottom_text != "" {
box(pad(left: 10pt, bottom: 10pt, [#bottom_text])) // 変数を使用
}
},
)
}

#let make-title(
title,
authors,
date,
abstract,
keywords,
) = {
// タイトルでは, 字下げを打ち消し
set par(
justify: true,
leading: 1.1em,
spacing: 1.9em,
first-line-indent: (
all: false,
amount: 0pt,
),
)

set par(spacing: 1em)
set text(font: "Zen Kaku Gothic New")

par(
justify: false,
text(24pt, fill: rgb("004b71"), title, weight: "bold"),
)

text(
12pt,
authors.enumerate().map(((i, author)) => box[#author.name #super[#(i + 1)]]).join(", "),
)
parbreak()

for (i, author) in authors.enumerate() [
#set text(8pt)
#super[#(i + 1)]
#author.institution
#link("mailto:" + author.mail) \
]

if date != none {
v(8pt)
set text(10pt)
align(right)[#date]
v(8pt)
} else {
v(8pt)
}
set text(10pt)
set par(justify: true)

[
#heading(outlined: false, bookmarked: false)[Abstract]
#text(font: "Zen Old Mincho", abstract)
#v(3pt)
*Keywords:* #keywords.join(text(font: "Zen Old Mincho", "; "))
]
v(18pt)
}

#let template(
title: [],
authors: (),
date: [],
doi: "",
keywords: (),
abstract: [],
doc_type: "NOTE",

Check warning on line 109 in packages/preview/quic-style/0.0.1/src/impl.typ

View check run for this annotation

Typst package check / @preview/quic-style:0.0.1

packages/preview/quic-style/0.0.1/src/impl.typ#L109

This argument seems to be part of public function. It is recommended to use kebab-case names.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, it would be better to use kebab-case here:

Suggested change
doc_type: "NOTE",
doc-type: "NOTE",

And rename it in other places as well.

make-venue: make-venue,
make-title: make-title,
body,
) = {
set page(
paper: "a4",
margin: (top: 1.9cm, bottom: 1in, x: 1.6cm),
columns: 2,
numbering: "1", // ページ番号を追加
)

// 日本語テキストの可読性向上のための設定
set par(
justify: true,
leading: 1.1em,
spacing: 1.9em,
first-line-indent: (
all: true,
amount: 1em,
),
)
set text(10pt, lang: "ja", font: "Zen Old Mincho")
set list(indent: 8pt)
// show link: set text(underline: false)
show heading: set text(size: 11pt)
show heading.where(level: 1): set text(font: "Zen Kaku Gothic New", fill: rgb("004b71"), size: 12pt)
show heading.where(level: 2): set text(font: "Zen Kaku Gothic New", fill: rgb("004b71"), size: 11pt)
show heading.where(level: 3): set text(font: "Zen Kaku Gothic New", fill: rgb("004b71"), size: 10pt)
show heading: set block(above: 16pt, below: 8pt)
show heading.where(level: 1): set block(below: 12pt)
show heading.where(level: 2): set block(below: 12pt)
show heading.where(level: 3): set block(below: 12pt)

place(make-venue(doc_type), top, scope: "parent", float: true)
place(
make-title(title, authors, date, abstract, keywords),
top,
scope: "parent",
float: true,
)


show figure: align.with(center)
show figure: set text(8pt)
show figure.caption: pad.with(x: 10%)

//表のときにはキャプションを上へ
show figure.where(kind: table): set figure.caption(position: top)

// show: columns.with(2)
body
}
1 change: 1 addition & 0 deletions packages/preview/quic-style/0.0.1/src/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import "impl.typ": template
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading