5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitHub Actionsを使ってLaTeX文書をAspellでスペルチェックする

Last updated at Posted at 2018-12-14

はじめに

英語論文のスペルチェックにAspellを使ってる人は多いと思います。自分でローカルで実行する分には良いのですが、共同で執筆している場合などは軽微なスペルミスはあまり指摘したく/されたく無いですよね。こういう仕事にはCIツールが向いています。

最近、GitHub ActionsというGitHubのCIツールがベータ公開されました。ということで、早速Aspellを使って自動的にLaTeX文書をスペルチェックしてくれるGitHub Actionを作成してみました。

成果物はGitHub Actions for Aspellで公開しています。

使用方法

まず、リポジトリのルートディレクトリに .aspell.en.pws というファイル名でユーザ辞書を置きます。ユーザ辞書の作り方の詳細は省略しますが、大抵は以下のようなコマンドで辞書を作るのでは無いでしょうか。

$ aspell --dont-backup --lang=en --mode=tex --personal ./.aspell.en.pws -c main.tex

次に、リポジトリのルートディレクトリに .github/main.workflow を以下のように作成して .aspell.en.pws と一緒に git push します。

なお、ASPELL_PERSONAL./ は省略すると動かないようです。

workflow "Spell Checking with Aspell" {
  on = "push"
  resolves = ["GitHub Action for Aspell"]
}

action "GitHub Action for Aspell" {
  uses = "mh61503891/action-paper-aspell@master"
  env = {
    ASPELL_LANG = "en"
    ASPELL_MODE = "tex"
    ASPELL_PERSONAL = "./.aspell.en.pws"
    ASPELL_FILES = "main.tex main.bib"
  }
}

すると push イベントに反応してDockerでaspell が実行され、スペルミスが無ければ成功、有れば失敗します。

image.png

GitHub Actionsの作成方法メモ

今後

スペルチェックだけでなく学会の執筆要項に準拠しているかをチェックするLinterとかできたら便利そうだなと考えています。

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?