クイックスタート¶
このガイドでは、数分でtypsphinxを使い始めることができます。
基本的なセットアップ¶
**typsphinxをインストール**(まだの場合):
pip install typsphinx
Sphinxプロジェクトに追加
conf.pyのextensionsリストにtypsphinxを追加:extensions = [ "typsphinx", ]
注釈
エントリーポイントのおかげで、
extensionsへの追加はオプションです。ビルダーは自動的に検出されます。Typst出力をビルド:
# Generate Typst markup sphinx-build -b typst source/ build/typst # Or generate PDF directly sphinx-build -b typstpdf source/ build/pdf
初めてのPDF¶
初めてのPDFを生成する最小限の例です:
シンプルな
index.rstを作成:Welcome to My Documentation =========================== This is a sample document. Features -------- - Easy to use - Beautiful PDFs - Fast compilation
PDFをビルド:
sphinx-build -b typstpdf source/ build/pdf
PDFは
build/pdf/index.pdfにあります!
設定オプション¶
conf.py にオプションを追加して出力をカスタマイズできます:
# Project information
project = "My Project"
author = "Your Name"
release = "1.0.0"
# Typst configuration
typst_documents = [
("index", "myproject", project, author, "typst"),
]
# Use mitex for LaTeX math
typst_use_mitex = True
# Custom template (optional)
typst_template = "_templates/custom.typ"
次のステップ¶
Configuration オプションについて学ぶ
ビルダー を探索(typst vs typstpdf)
Templates でカスタマイズ
より多くの例については Examples を参照