Created
August 21, 2013 13:05
-
-
Save draftcode/6294207 to your computer and use it in GitHub Desktop.
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
\mode<presentation> | |
\useoutertheme{default} | |
\useinnertheme{default} | |
\usefonttheme{structurebold} | |
\useoutertheme[subsection=false]{miniframes} | |
% No outer color theme | |
\usecolortheme{orchid} | |
\beamertemplatenavigationsymbolsempty | |
\beamertemplatefootpagenumber | |
\setbeamertemplate{frametitle}[default][center] |
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
require "rake/clean" | |
$OUTPUT = File.basename(File.expand_path("..", __FILE__)) | |
$OUTPUTDIR = "out" | |
$TEX = "platex" | |
$TEXFLAGS = "" | |
$DVIPDF = "dvipdfmx" | |
$DVIPDFFLAGS = "" | |
$BIBTEX = "pbibtex" | |
$BIBTEXFLAGS = "" | |
############################################################################## | |
def find_target | |
files = FileList["*.tex"].pathmap("%n") | |
if files.length == 1 | |
files.first | |
else | |
false | |
end | |
end | |
def check_require_bibtex(logfile) | |
File.foreach(logfile) do |line| | |
return true if /bbl/ =~ line | |
end | |
false | |
end | |
$TARGET ||= find_target | |
if !$TARGET | |
puts "I don't know which tex file to build. Please specify a build target in the Rakefile." | |
end | |
$OUTPUT ||= $TARGET | |
$TEXFILE = "#$TARGET.tex" | |
$FLSFILE = "#$OUTPUT.fls" | |
$DVIFILE = "#$OUTPUT.dvi" | |
$PDFFILE = "#$OUTPUT.pdf" | |
$LOGFILE = "#$OUTPUT.log" | |
$AUXFILE = "#$OUTPUT.aux" | |
$BBLFILE = "#$OUTPUT.bbl" | |
$BLGFILE = "#$OUTPUT.blg" | |
$FLSFILEPATH = $OUTPUTDIR ? "#$OUTPUTDIR/#$FLSFILE" : $FLSFILE | |
$DVIFILEPATH = $OUTPUTDIR ? "#$OUTPUTDIR/#$DVIFILE" : $DVIFILE | |
$PDFFILEPATH = $OUTPUTDIR ? "#$OUTPUTDIR/#$PDFFILE" : $PDFFILE | |
$LOGFILEPATH = $OUTPUTDIR ? "#$OUTPUTDIR/#$LOGFILE" : $LOGFILE | |
$AUXFILEPATH = $OUTPUTDIR ? "#$OUTPUTDIR/#$AUXFILE" : $AUXFILE | |
$BBLFILEPATH = $OUTPUTDIR ? "#$OUTPUTDIR/#$BBLFILE" : $BBLFILE | |
$BLGFILEPATH = $OUTPUTDIR ? "#$OUTPUTDIR/#$BLGFILE" : $BLGFILE | |
outputs = [ | |
$FLSFILEPATH, $DVIFILEPATH, $PDFFILEPATH, $LOGFILEPATH, | |
$AUXFILEPATH, $BBLFILEPATH, $BLGFILEPATH] | |
CLEAN.include((outputs-[$PDFFILEPATH]).to_a) | |
CLOBBER.include($PDFFILEPATH) | |
directory $OUTPUTDIR | |
desc "Compile DVI -> PDF" | |
task :pdf => $PDFFILEPATH | |
desc "Compile LaTeX -> DVI" | |
task :dvi => $DVIFILEPATH | |
task $DVIFILEPATH => $OUTPUTDIR do | |
outputflag = "-output-directory=#{$OUTPUTDIR}" if $OUTPUTDIR | |
otherflag = "-interaction=nonstopmode -recorder -jobname=#{$OUTPUT}" | |
sh "#{$TEX} #{$TEXFLAGS} #{outputflag} #{otherflag} #{$TARGET}" | |
if check_require_bibtex($LOGFILEPATH) | |
sh "#{$BIBTEX} #{$BIBTEXFLAGS} #{$AUXFILEPATH}" | |
sh "#{$TEX} #{$TEXFLAGS} #{outputflag} #{otherflag} #{$TARGET}" | |
end | |
sh "#{$TEX} #{$TEXFLAGS} #{outputflag} #{otherflag} #{$TARGET}" | |
end | |
task $PDFFILEPATH => :dvi do | |
sh "#{$DVIPDF} -p a4 #{$DVIPDFFLAGS} -o #{$PDFFILEPATH} #{$DVIFILEPATH}" | |
end |
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[dvipdfmx]{beamer} | |
\usepackage{draftcode_beamer} | |
\usepackage{amsmath,amssymb,amsthm} | |
\usepackage{color} | |
\title{} | |
\author{ | |
Masaya Suzuki\\ | |
Watanabe lab. at Graduate School of Information Science and Engineering\\ | |
12M38261\\ | |
[email protected]\\ | |
} | |
\date{} | |
\begin{document} | |
\begin{frame} | |
\titlepage | |
\end{frame} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment