changeset 91:6a12eb22be8c paper_final

Update Makefile
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Sun, 01 Mar 2015 13:05:17 +0900
parents b29ab7ecf509
children 0354d3693324
files paper/Makefile paper/escape_agda.rb paper/fig/delta_example.xbb paper/fig/functor.xbb paper/fig/functor_in_haskell.xbb paper/fig/monad_laws.xbb paper/fig/morphism_composition_law.xbb paper/fig/natural_transformation.xbb paper/fig/natural_transformation_in_haskell.xbb paper/fig/non_delta_example.xbb paper/fig/ryukyu.xbb paper/fig/simple_category.xbb paper/main.pdf paper/replace_agda.rb
diffstat 14 files changed, 53 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/paper/Makefile	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/Makefile	Sun Mar 01 13:05:17 2015 +0900
@@ -1,20 +1,35 @@
-# target name
+# Settings
 TARGET=main
+BIBTEX=pbibtex
+BB=extractbb
+
+vpath pdf fig
+FIGURES=$(wildcard fig/*.pdf)
+FIGURES_FOR_TEX=$(subst .pdf,.xbb,$(FIGURES))
+
+vpath agda src
+SOURCES=$(wildcard src/*agda)
+SOURCES_FOR_TEX=$(subst .agda,.agda.replaced,$(SOURCES))
 
 # dependencies
 $(TARGET).pdf : $(TARGET).dvi
 	dvipdfmx $<
 
-$(TARGET).dvi : $(wildcard *.tex) $(wildcard fig/*.pdf)
-	ruby replace_agda.rb
+$(TARGET).dvi : $(wildcard *.tex) $(FIGURES_FOR_TEX) $(SOURCES_FOR_TEX)
 	platex  $(TARGET).tex
-	pbibtex $(TARGET)
+	$(BIBTEX) $(TARGET)
 	platex  $(TARGET).tex
 	platex  $(TARGET).tex
 
+%.xbb: %.pdf
+	$(BB) $<
+
+%.agda.replaced: %.agda
+	ruby escape_agda.rb $<
+
 
 # commands
-.PHONY : clean all open remake setup
+.PHONY : clean all open remake
 
 clean:
 	rm -f *.dvi *.aux *.log *.pdf *.ps *.gz *.bbl *.blg *.toc *~ *.core *.cpt *.lof *.lot *.lol *.bbl *.blg
@@ -27,7 +42,3 @@
 remake:
 	make clean
 	make all
-
-setup:
-	extractbb fig/*.pdf
-	ruby replace_agda.rb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/escape_agda.rb	Sun Mar 01 13:05:17 2015 +0900
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+
+Suffix     = '.agda.replaced'
+EscapeChar = '@'
+FileName   = ARGV.first
+
+ReplaceTable = {
+  '->' => 'rightarrow',
+  '∙'  => 'circ',
+  '≡' => 'equiv',
+  '×' => 'times',
+  '⟨'  => 'langle',
+  '⟩'  => 'rangle',
+  '∎'  => 'blacksquare'
+}
+
+code = File.read(FileName)
+ReplaceTable.each do |k, v|
+  escaped_str = EscapeChar + "$\\#{v}$" + EscapeChar
+  code = code.gsub(k, escaped_str)
+end
+
+File.write(FileName.sub(/.agda$/, Suffix), code)
--- a/paper/fig/delta_example.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/delta_example.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 559.000000 279.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:20 2015
 
--- a/paper/fig/functor.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/functor.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 545.000000 456.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:20 2015
 
--- a/paper/fig/functor_in_haskell.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/functor_in_haskell.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 324.000000 176.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:20 2015
 
--- a/paper/fig/monad_laws.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/monad_laws.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 464.000000 137.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:21 2015
 
--- a/paper/fig/morphism_composition_law.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/morphism_composition_law.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 412.000000 273.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:21 2015
 
--- a/paper/fig/natural_transformation.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/natural_transformation.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 211.000000 136.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:21 2015
 
--- a/paper/fig/natural_transformation_in_haskell.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/natural_transformation_in_haskell.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 322.000000 136.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:22 2015
 
--- a/paper/fig/non_delta_example.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/non_delta_example.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 504.000000 244.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:22 2015
 
--- a/paper/fig/ryukyu.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/ryukyu.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 595.000000 842.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:23 2015
 
--- a/paper/fig/simple_category.xbb	Fri Feb 20 22:14:01 2015 +0900
+++ b/paper/fig/simple_category.xbb	Sun Mar 01 13:05:17 2015 +0900
@@ -4,5 +4,5 @@
 %%HiResBoundingBox: 0.000000 0.000000 205.000000 82.000000
 %%PDFVersion: 1.3
 %%Pages: 1
-%%CreationDate: Thu Feb 12 18:06:21 2015
+%%CreationDate: Sun Mar  1 13:01:23 2015
 
Binary file paper/main.pdf has changed
--- a/paper/replace_agda.rb	Fri Feb 20 22:14:01 2015 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/usr/bin/env ruby
-
-replace_table = {
-  '->' => 'rightarrow',
-  '∙'  => 'circ',
-  '≡' => 'equiv',
-  '×' => 'times',
-  '⟨'  => 'langle',
-  '⟩'  => 'rangle',
-  '∎'  => 'blacksquare'
-}
-footer = '.replaced'
-
-sources = Dir.glob('src/*.agda')
-
-sources.each do |src|
-  code = File.read(src)
-
-  replace_table.each do |k, v|
-    code = code.gsub(k, "@$\\#{v}$@" )
-  end
-
-  File.write(src+footer , code)
-end