Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kimushun1101 committed Apr 9, 2024
1 parent dd1218a commit 2b4a599
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 37 deletions.
44 changes: 7 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,9 @@ Typst で日本語論文を書くときのテンプレートです.
雰囲気を掴みたい場合には [こちらの Typst Web Application](https://typst.app/project/w41EH6HRoEsXp95IW_y1WK) をお試しください.
コンパイル済みの資料を確認したいだけでしたら [こちらの GitHub Pages](https://kimushun1101.github.io/typst-jp-conf-template/typst-jp-conf.pdf) からお読みできます.

## ローカル開発環境構築
[Typst](https://typst.app/) をインストール方法を示します.
[Typst の GitHubページ](https://github.com/typst/typst) にある通りですが,Typst のローカル環境へのインストールは以下の 3 つのパターンが簡単かと思われます.

### Windows
PowerShell を開き以下のコマンドを入力する.
```powershell
winget install --id Typst.Typst
```
`winget` コマンドが有効でない場合には,Microsoft Store から [アプリインストーラー](https://apps.microsoft.com/detail/9nblggh4nns1) をインストールすると使えるようになります.

### Mac
[Homebrew](https://brew.sh/ja/) を導入して,以下のコマンドを入力する.
```sh
brew install typst
```
[このページ](https://brew.sh/ja/) の通りですが,Homebrew のインストールは以下のコマンドで行えます.
```sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

### Rust を通してインストール
Ubuntu の場合などはこの方法をオススメします.
[Rust](https://www.rust-lang.org/ja/tools/install) をインストールして,以下のコマンドを入力する.
```sh
cargo install --git https://github.com/typst/typst --locked typst-cli
```
[このページ](https://www.rust-lang.org/ja/tools/install) の通りですが,Rust のインストールは以下のコマンドで行えます.
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

## 使用方法
1. GitHub に慣れていない方は,GitHub ページの `<>Code▼` から `Download ZIP` して展開してください.
GitHub に慣れていない方は,GitHub ページの `<>Code▼` から `Download ZIP` して展開してください.
慣れている方は,`git clone` したり `use this template` したり,適宜扱ってください.
2. PowerShell やターミナルで展開したディレクトリに移り,以下のコマンドを入力することで `main.pdf` が生成されます.
```
typst compile main.typ
```

### VS Code を使用する場合
1. [VS Code](https://code.visualstudio.com/) をインストール.
Expand All @@ -74,6 +38,12 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
`Ctrl` + `K` のあと `V`) でプレビューを表示.[トップにある動画](#typst-jp-conf-template) の操作です.
2. `Ctrl` + `S` で PDF を生成.

### 他のエディターで執筆する場合

筆者は試せていませんが,他のエディターでも同様の拡張機能はありそうです.
また,Typst のインストールおよびコンパイルは,コマンドラインでも行えます.
お使いの OS によってインストール方法が異なるため,詳細は[別ページ](docs/native-install.md)にまとめました.

## 参考元
- (unofficial) IFAC Conference Template for Typst : https://github.com/typst/packages/tree/main/packages/preview/abiding-ifacconf/0.1.0
- charged-ieee : https://github.com/typst/packages/tree/main/packages/preview/charged-ieee/0.1.0
Expand Down
40 changes: 40 additions & 0 deletions docs/native-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ローカル環境構築

## コマンドによるインストール
Typst のインストール方法は,[Typst の GitHubページ](https://github.com/typst/typst) にある通りですが,以下の 3 つのパターンが簡単かと思われます.

### Windows
PowerShell を開き以下のコマンドを入力する.
```powershell
winget install --id Typst.Typst
```
`winget` コマンドが有効でない場合には,Microsoft Store から [アプリインストーラー](https://apps.microsoft.com/detail/9nblggh4nns1) をインストールすると使えるようになります.

### Mac
[Homebrew](https://brew.sh/ja/) を導入して,以下のコマンドを入力する.
```sh
brew install typst
```
[このページ](https://brew.sh/ja/) の通りですが,Homebrew のインストールは以下のコマンドで行えます.
```sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

### Rust を通してインストール
Ubuntu の場合などはこの方法をオススメします.
[Rust](https://www.rust-lang.org/ja/tools/install) をインストールして,以下のコマンドを入力する.
```sh
cargo install --git https://github.com/typst/typst --locked typst-cli
```
[このページ](https://www.rust-lang.org/ja/tools/install) の通りですが,Rust のインストールは以下のコマンドで行えます.
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

## コマンドによるコンパイル
1. [Typst](https://typst.app/) をインストール.
2. 解凍したフォルダーの `main.typ` を編集.
3. PowerShell やターミナルで `main.typ` のあるディレクトリに移り,以下のコマンドで `main.pdf` を生成.
```
typst compile main.typ
```

0 comments on commit 2b4a599

Please sign in to comment.