製品紹介
Koma:伝わる資料を、プレーンテキストで
Koma
Koma 0.1.0 を 8 枚で紹介。構造、CSS テーマ、TeX 数式とグラフ、レイアウト、書き出しと .komadoc、実測レイアウト検査、LSP、MCP。
koma export の出力
1 ページ目
2 ページ目
3 ページ目
4 ページ目
5 ページ目
6 ページ目
7 ページ目
8 ページ目
ソース
===
title: "Koma:伝わる資料を、プレーンテキストで"
theme: default
lang: ja
paginate: true
css: |
page.language-cover { background: #112820; color: #eef8f3; }
box.eyebrow, box.url { color: #94d6b9; font-family: monospace; font-size: 0.70em; letter-spacing: 0.10em; }
box.masthead { color: #eafef4; font-family: monospace; font-weight: 700; font-size: 3.05em; }
box.message { color: #eef8f3; font-size: 1.18em; font-weight: 700; }
box.cover-note { color: #a7c4b6; font-size: 0.76em; }
box.source-sample { background: #e9f5ee; border-radius: 14px; padding: 26px 22px; color: #14382c; font-size: 0.73em; }
page { background: #fbfbfa; color: #181a20; }
page.dark { background: #14161b; color: #f2f3f6; }
label { color: #0d7a66; font-weight: 700; letter-spacing: 0.08em; font-size: 0.72em; }
label.on-dark { color: #5fe3c8; }
title.on-dark { color: #ffffff; }
subtitle { color: #525866; font-weight: 400; }
subtitle.on-dark { color: #b8becb; }
authors.on-dark { color: #9be0cf; font-weight: 500; }
date.on-dark { color: #5fe3c8; font-weight: 500; }
box.card {
background: #ffffff;
border: 1px solid #dfe3ea;
border-radius: 14px;
padding: 18px 22px;
row-gap: 8px;
}
box.card h3 { font-size: 1.05em; margin: 0; color: #0d7a66; }
box.accent-bar {
background: #e8f5f1;
border-left: 5px solid #0d7a66;
border-radius: 0 10px 10px 0;
padding: 14px 18px;
font-size: 0.92em;
}
figure.theme-card {
border: 1.5px solid #d5dbe5;
border-radius: 10px;
background: #ffffff;
padding: 8px 8px 10px;
}
===
---
layout: blank
class: language-cover
---
[box .eyebrow x=7% y=10% w=85% h=6%:
KOMA MARKUP LANGUAGE / 0.1
]
[box .masthead x=7% y=23% w=45% h=23%:
`[koma:]`
]
[box .message x=7% y=54% w=43% h=15%:
伝わる資料を、プレーンテキストで
]
[box .cover-note x=7% y=73% w=43% h=8%:
構造は角括弧、スタイルは CSS。
]
[box .url x=7% y=88% w=43% h=6%:
komalang.org
]
[box .source-sample x=54% y=29% w=39% h=47%:
```koma
[title: タイトルから始める]
[main:
- **Markdown** で書く。
- CSS で見た目を整える。
]
```
]
+++
[label: 01 · 構造]
[title: 1 つの読めるテキストファイルが文書になる]
[subtitle:
ページは `+++` で区切り、役割は角括弧の要素で、本文は Markdown と LaTeX で書く
]
[main:
[col weight=3:
```koma
===
theme: default
===
[title: コーヒーは最初に早く冷める]
[main:
- 放熱速度は温度差 $\Delta T$ に比例
- ==10 分以内==に飲むのが適温
]
+++
[title: 次の実験]
```
]
[col weight=2:
[box .card:
# 隠れた状態のない素直な構文
- 要素:`[title:]`、`[main:]`、`[col:]`、`[box:]`、`[chart:]`
- 設定は `===` と `---` のあいだに記述
- ノートは末尾の `"""` に記述
]
[box .accent-bar:
同じ構文で `type: article`・`A4` や `type: poster`・`A0` も作れます。
]
]
]
"""
角括弧を指して、ページ内の各部品に明確な役割があり、本文は素直な Markdown のまま書けることを伝える。
"""
+++
[label: 02 · テーマと CSS]
[title: 1 つの本文を、好みの密度や独自 CSS で]
[subtitle:
組み込みの `talk`・`default`・`report` や、独自の `theme.koma` を選べます
]
[main:
[row:
[col:
[figure .theme-card:
[image src="assets/theme-default.ja.png" alt="組み込み Default テーマで描いた橋のスライド":]
**Default**・組み込み(`34px`)
]
]
[col:
[figure .theme-card:
[image src="assets/theme-editorial.ja.png" alt="Editorial CSS テーマで描いた橋のスライド":]
**Editorial**・`theme.koma`
]
]
[col:
[figure .theme-card:
[image src="assets/theme-dark.ja.png" alt="Dark CSS テーマで描いた橋のスライド":]
**Dark**・`theme.koma`
]
]
]
[box .accent-bar:
資料に `theme: ./themes/editorial/theme.koma` と書きます。
テーマの `css: |` に装飾を書き、必要に応じて同じファイルにレイアウトを定義します。
]
]
+++
[label: 03 · 数式とグラフ]
[title: TeX 数式も関数グラフも最初から組み込み]
[subtitle:
LaTeX の数式を組版し、`[chart:]` が関数式や CSV から軸・目盛り・凡例つきで描画する
]
[main:
[col weight=2:
ニュートンの冷却の法則:
$$
T(t) = T_{\text{room}} + (T_0 - T_{\text{room}})\,e^{-kt}
$$
右のグラフは 1 つの要素だけで記述:
```koma
[chart f="20 + 70*exp(-0.08*x)"
labels=("T(t)")
domain=(0, 40) range=(0, 100)
x-title="$t$ (分)"
y-title="$T$ (°C)":]
```
]
[col weight=3:
[figure:
[chart h=470px f="20 + 70*exp(-0.08*x)" labels=("T(t)") domain=(0, 40) range=(0, 100) x-title="$t$ (分)" y-title="$T$ (°C)":]
ベクター SVG として出力され、PowerPoint へは編集可能なグラフに変換。
]
]
]
+++
[label: 04 · レイアウト]
[title: 基本は自動流し込み、必要なときだけ厳密配置]
[subtitle: テーマの段組み、CSS マルチカラム、座標指定を 1 つの言語で使い分ける]
[main:
[col:
[box .card style="flex: 1":
# 流れと段組み
`[col:]` や `[row:]` で自然に整列。さらに CSS の `columns: 2` でワークシートや記事の段組みにも対応。
```koma
[main:
[col weight=2: ...]
[col weight=3: ...]
]
```
]
]
[col:
[box .card style="flex: 1":
# 厳密な位置指定
チラシや図解の注釈は `x=`・`y=`・`w=`・`h=` を `%` や `px` で直接指定。
```koma
[box x=60% y=30%
w=32% h=42%: ...]
```
]
]
[col:
[box .card style="flex: 1":
# セマンティック CSS
資料や `theme.koma` の `css: |` で、クラスと `--koma-*` 変数を使って装飾します。
```koma
[box .accent: ...]
[callout: ...]
```
]
]
]
+++
[label: 05 · 書き出しと携行]
[title: 1 つのファイルから、提出に必要なあらゆる形式へ]
[subtitle:
`@komalang/koma` CLI で PDF・PowerPoint・HTML・PNG・`.komadoc` パッケージを一貫生成
]
[main:
[col weight=3:
```sh
# 印刷用 PDF・編集可能な PowerPoint・HTML・PNG
koma export talk.koma -o talk.pdf
koma export talk.koma -o talk.pptx
koma export talk.koma -o talk.html
koma export talk.koma --to png -o pages
# 書体・画像・表紙つきの単一アーカイブに梱包
koma pack talk.koma --cover -o talk.komadoc
```
]
[col weight=2:
[box .card:
# そのまま配れる出力品質
- **PDF**:書体埋め込み・ベクター数式
- **PowerPoint**:あとから編集できるテキストとグラフ
- **単一 HTML**:1 ファイルでそのまま共有
- **`.komadoc`**:表紙サムネイルつきの携行パッケージ
]
]
]
+++
[label: 06 · 検査・Git・AI]
[title: コードと同じ品質管理を文書にも]
[subtitle:
実測レイアウト検査・唯一の標準整形・LSP・読み取り専用 MCP を `@komalang/koma` に内蔵
]
[main:
[col:
[box .card style="flex: 1":
# `koma check --layout`
実ブラウザー組版で文字切れ・はみ出し・要素の重なりを発表前に自動検出。
]
[box .card style="flex: 1":
# `koma format --write`
仕様で定めた唯一の標準形に整え、Git の差分を小さく読みやすく維持。
]
]
[col:
[box .card style="flex: 1":
# `koma lsp` と VS Code
VS Code・Zed・Neovim で構文色分け・リアルタイム診断・アウトライン・プレビューを提供。
]
[box .card style="flex: 1":
# `koma mcp` と AI 協働
ローカル読み取り専用 MCP と unist 構文木により、人と AI が安全な差分で共同編集。
]
]
]
+++
---
layout: section
class: dark
---
[label .on-dark: 今すぐ試す]
[title .on-dark: komalang.org でそのまま書いてみる]
[subtitle .on-dark: ブラウザー上の Playground で体験でき、エディター KomaDocs は komadocs.com で公開中]
"""
Koma 0.1.0 は komalang.org で試せます。専用エディター KomaDocs は komadocs.com で利用できます。
"""