This repository has been archived by the owner on Sep 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use latexmk (copied from jsk-report-template/jsai-report)
- Loading branch information
Showing
4 changed files
with
41 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,41 @@ | ||
########################################################### | ||
# Thesis Generator for Creative Informatics | ||
# Makefile for compiling a conference / journal paper | ||
# Author: Yuki Furuta <[email protected]> | ||
# Date: 2015/11/12 | ||
########################################################### | ||
|
||
TARGET := main | ||
|
||
.PHONY: all open clean wipe forever preinstall pub publish | ||
OS=$(shell uname -s) | ||
ifeq ($(OS), Linux) | ||
OMAKE_INSTALL=sudo apt-get install -y -qq omake fam | ||
TEX_INSTALL=sudo apt-get install -y -qq texlive texlive-lang-cjk texlive-science texlive-fonts-recommended texlive-fonts-extra xdvik-ja dvipsk-ja gv | ||
endif | ||
ifeq ($(OS), Darwin) | ||
OMAKE_INSTALL=brew install -y opam && opam init -y -j4 -q && eval `opam config env` && opam install omake -y -j4 -q | ||
TEX_INSTALL=brew install -y caskroom/cask/brew-cask && brew cask install -y mactex && sudo tlmgr update --self --all | ||
endif | ||
|
||
all: preinstall | ||
omake | ||
|
||
forever: preinstall | ||
omake -P | ||
OS := $(shell uname -s) | ||
LATEXMK := $(shell command -v latexmk 2> /dev/null) | ||
LATEXMK_OPTION := -time -recorder -rules | ||
LATEXMK_EXEC := latexmk $(LATEXMK_OPTION) | ||
|
||
open: preinstall | ||
omake preview | ||
.PHONY: all install preview clean wipe | ||
|
||
publish: preinstall | ||
omake publish | ||
pub: publish | ||
all: install | ||
$(LATEXMK_EXEC) -pvc- $(TARGET) | ||
|
||
quiet: preinstall | ||
omake 2>&1 | egrep '^\!.*$$|error|Error|Warning' -C3 | ||
preview: install | ||
$(LATEXMK_EXEC) -pv $(TARGET) | ||
|
||
todo: | ||
egrep -r -C3 -n --color=auto "nowprinting|TODO" src | ||
forever: install | ||
$(LATEXMK_EXEC) -pvc $(TARGET) | ||
|
||
clean: preinstall | ||
omake clean | ||
clean: install | ||
$(LATEXMK_EXEC) -c | ||
|
||
wipe: clean | ||
git clean -X -f -i -e '.tex' | ||
wipe: install clean | ||
$(LATEXMK_EXEC) -C | ||
git clean -X -f -i -e '.tex' -e '.tex.orig' | ||
|
||
preinstall: | ||
@if ! which omake > /dev/null; then $(OMAKE_INSTALL); fi | ||
@if ! which platex > /dev/null; then $(TEX_INSTALL); fi | ||
install: | ||
ifndef LATEXMK | ||
@echo 'installing components...' | ||
ifeq ($(OS), Linux) | ||
sudo apt install -y -qq texlive texlive-lang-cjk texlive-science texlive-fonts-recommended texlive-fonts-extra xdvik-ja dvipsk-ja gv latexmk | ||
endif | ||
ifeq ($(OS), Darwin) | ||
brew tap caskroom/cask && brew cask install -v mactex && sudo tlmgr update --self --all | ||
endif | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$latex = 'platex -interaction=nonstopmode -halt-on-error -shell-escape'; | ||
$bibtex = 'pbibtex'; | ||
$dvipdf = 'dvipdfmx %O -o %D %S'; | ||
$makeindex = 'mendex %O -o %D %S'; | ||
|
||
$pdf_mode = 3; # for japanese | ||
# $pdf_mode = 1; # for english | ||
|
||
if ($^O eq 'darwin') { | ||
$pdf_previewer = 'open -a Preview'; | ||
} elsif ($^O eq 'linux') { | ||
$pdf_previewer = 'evince'; | ||
} |