ぼちぼち更新していく。
- GitHub - typst/typst: A new markup-based typesetting system that is powerful and easy to learn.
- Typst Documentation
インストール
公式のGitHub のREADMEのInstallationの「Linux: View Typst on Repology」にはUbuntuのレポジトリはない。
しかし、snapに入ってる。
sudo snap install typst
でインストール完了。
実行
typst compile --font-path ~/.local/share/fonts/ test.typ
typst はシステム全体に入っているフォントしか拾ってくれないらしいので、--font-path ~/.local/share/fonts/
でローカルに入っているフォントも認識してくれるようにする。
記法
フォントサイズ
特定の箇所だけフォントサイズを変えたい場合。
#text(8pt)[このテキストだけ8ptになる。]
画像
詳細はImage Function – Typst Documentationを参照のこと。
#figure(
image("image/桜島.jpg"),/*height:10emなどで画像の高さ調整*/
caption: [寺山公園から見える桜島#v(0.2em)], /* キャプション名と下の余白#v(○em) */
placement: auto, /* 画像位置 auto,top,bottom,none(その場) */
)<桜島> /*本文で参照する際のキーワード*/
↓別途、表の画像を作って、挿入する場合。
#figure(
table(
image("image/表の画像.png", height:11em), /*heightを調整して段組の行を揃える*/
stroke:none,
),
caption: [果物], /* キャプション名 */
supplement: [表], /*「Table」を「表」に。*/
gap:0.5em, /* キャプションと表との間 */
placement: auto, /* 位置 auto,top,bottom,none(その場) */
)<表b> /*本文で参照する際のキーワード*/
図表番号(相互参照)
//「Figure」を「図」に。
#set figure(supplement: [図],)
本文中に「図1」などと入れる場合には、上記の「本文で参照する際のキーワード」を使い、本文で @桜島
などとすれば、自動で番号が付される。
参考文献
Bibliography Function – Typst Documentationを参照のこと。
#bibliography("works.bib",title:"参考文献",style:"ieee")
アドオン的なやつ
脚注をカスタム
GitHub - tudborg/notes.typ: Footnotes + Endnotes + Custom notes for Typst typesetting.からダウンロード(Code>Download ZIP をダウンロード)してきた notes.typ をコンパイルするファイルのあるディレクトリの中に入れる。
プリアンブルに
#import "notes.typ": note, notes
と書く。
/*文末脚注*/
#set par(justify: true,leading: 0.65em,first-line-indent: 0pt,)
#v(2em)*注*#v(-0.7em)
#notes()
/*文末脚注*/