Skip to content

Instantly share code, notes, and snippets.

@aruneko
Last active August 29, 2015 14:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aruneko/a6c307d190c8e92bcd6b to your computer and use it in GitHub Desktop.
Save aruneko/a6c307d190c8e92bcd6b to your computer and use it in GitHub Desktop.
latexmkの一発インストールシェルスクリプト(Linux用)
#!/bin/sh
# インストール先ディレクトリの生成と本体のダウンロード
mkdir -p $HOME/opt/latexmk
wget -O $HOME/opt/latexmk/latexmk http://mirrors.ctan.org/support/latexmk/latexmk.pl
# 実行権限とPATHの設定
chmod +x $HOME/opt/latexmk/latexmk
echo 'PATH="$HOME/opt/latexmk:$PATH"' >> $HOME/.bashrc
# 設定ファイルの書き込み
# 参考:http://konn-san.com/prog/why-not-latexmk.html
cat << 'EOS' > $HOME/.latexmkrc
#!/usr/bin/env perl
$latex = 'platex -shell-escape -halt-on-error';
$latex_silent = 'platex -shell-escape -halt-on-error -interaction=batchmode';
$bibtex = 'pbibtex';
$dvipdf = 'dvipdfmx %O -o %D %S';
$makeindex = 'mendex %O -o %D %S';
$max_repeat = 5;
$pdf_mode = 3; # generates pdf via dvipdfmx
# Prevent latexmk from removing PDF after typeset.
# This enables Skim to chase the update in PDF automatically.
$pvc_view_file_via_temporary = 0;
# Use Skim as a previewer
$pdf_previewer = "xdg-open";
EOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment