Last active
December 10, 2015 20:08
-
-
Save tailriver/4486003 to your computer and use it in GitHub Desktop.
makeによるTeX論文作成用タイプセット
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
\setcounter{chapter}{0} | |
\chapter{Introduction} | |
\section{Background} | |
Lorem ipsum dolor sit amet ... | |
\section{Purpose} | |
Lorem ipsum dolor sit amet ... |
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
\setcounter{chapter}{4} | |
\chapter{Conclusion} | |
Lorem ipsum dolor sit amet ... |
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
\begin{thebibliography}{99} | |
% snip | |
\end{thebibliography} |
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
\frontmatter | |
\maketitle | |
\tableofcontents | |
\mainmatter |
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
SERIALIZER=./serialize.pl $(TEX_PREAMBLE) | |
PLATEX=platex -interaction=batchmode -halt-on-error -kanji=utf8 -shell-escape | |
DVIPDFMX=dvipdfmx | |
TEX_PREAMBLE=preamble.tex | |
TEX_COVER=cover.tex | |
TEX_CHAPTER=1_introduction.tex\ | |
5_conclusion.tex\ | |
7_bibliography.tex\ | |
PDF_THESIS=thesis.pdf | |
PDF_CHAPTER=$(TEX_CHAPTER:tex=pdf) | |
.PHONY: all chapter thesis clean | |
.INTERMEDIATE: $(PDF_THESIS:pdf=dvi) | |
all: chapter thesis | |
chapter: $(PDF_CHAPTER) | |
thesis: $(PDF_THESIS) | |
clean: | |
$(RM) $(PDF_THESIS) $(PDF_CHAPTER) $(PDF_THESIS:pdf=log) | |
%.pdf: %.dvi | |
$(DVIPDFMX) $< | |
-$(RM) $*.aux $*.toc | |
thesis.dvi: $(TEX_COVER) $(TEX_CHAPTER) $(TEX_PREAMBLE) | |
$(SERIALIZER) $(TEX_COVER) $(TEX_CHAPTER) >temp.tex | |
@$(PLATEX) -jobname=$(@:.dvi=) temp.tex | |
@$(PLATEX) -jobname=$(@:.dvi=) temp.tex | |
$(PLATEX) -jobname=$(@:.dvi=) temp.tex | |
-$(RM) temp.tex | |
%.dvi: %.tex $(TEX_PREAMBLE) | |
$(SERIALIZER) $< >temp.tex | |
$(PLATEX) -jobname=$* temp.tex || (less $*.log && false) | |
@$(PLATEX) -jobname=$* temp.tex | |
-$(RM) temp.tex $*.log |
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
\documentclass[a4j,11pt]{jsbook} | |
\usepackage[dvipdfm]{graphicx} | |
\title{Sein und Zeit} | |
\author{Martin Heidegger} | |
\date{1927} |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
binmode STDOUT => ':utf8'; | |
my $preamble = shift @ARGV; | |
open my $PREAMBLE, '<:utf8', $preamble or die $!; | |
print while <$PREAMBLE>; | |
close $PREAMBLE; | |
print "\\begin{document}\n"; | |
for my $chapter (@ARGV) { | |
open my $CHAPTER, '<:utf8', $chapter or die $!; | |
while (<$CHAPTER>) { | |
s/、/,/g; | |
s/。/./g; | |
print $_; | |
} | |
close $CHAPTER; | |
} | |
print "\\end{document}\n"; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment