forked from scipy-conference/scipy_proceedings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor code from shell script to python script
- Loading branch information
1 parent
c0a992d
commit e2a2b1c
Showing
5 changed files
with
167 additions
and
154 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,24 +1,17 @@ | ||
#!/bin/bash | ||
|
||
DIR=$1 | ||
WD=`pwd` | ||
|
||
if [[ ! -d $DIR ]]; then | ||
echo "Usage: make_paper.sh source_dir" | ||
exit -1 | ||
fi | ||
|
||
AUTHOR=`basename $DIR` | ||
OUTDIR="output/$AUTHOR" | ||
TEX2PDF="pdflatex paper.tex" | ||
|
||
mkdir -p $OUTDIR | ||
cp $DIR/* $OUTDIR | ||
python publisher/build_paper.py $DIR $OUTDIR | ||
python publisher/build_paper.py $DIR | ||
if [ "$?" -ne "0" ]; then | ||
echo "Error building paper $DIR. Aborting." | ||
exit 1 | ||
fi | ||
|
||
cd $OUTDIR | ||
$TEX2PDF > /dev/null && $TEX2PDF | (python $WD/publisher/page_count.py) | ||
#cd $OUTDIR | ||
#$TEX2PDF > /dev/null && $TEX2PDF | (python $WD/publisher/page_count.py) |
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,49 @@ | ||
% These preamble commands are from build_paper.py | ||
|
||
% PDF Standard Fonts | ||
\usepackage{mathptmx} | ||
\usepackage[scaled=.90]{helvet} | ||
\usepackage{courier} | ||
|
||
% Make verbatim environment smaller | ||
\makeatletter | ||
\g@addto@macro\@verbatim\footnotesize | ||
\makeatother | ||
|
||
% Do not indent code sections | ||
\renewcommand{\quote}{} | ||
|
||
% Provide AMS mathematical commands such as "align" | ||
\usepackage{amsmath} | ||
\usepackage{amsfonts} | ||
\usepackage{bm} | ||
|
||
% Define colours for hyperref | ||
\usepackage{color} | ||
|
||
\definecolor{orange}{cmyk}{0,0.4,0.8,0.2} | ||
\definecolor{darkorange}{rgb}{.71,0.21,0.01} | ||
\definecolor{darkblue}{rgb}{.01,0.21,0.71} | ||
\definecolor{darkgreen}{rgb}{.1,.52,.09} | ||
|
||
\usepackage{hyperref} | ||
\hypersetup{pdftex, % needed for pdflatex | ||
breaklinks=true, % so long urls are correctly broken across lines | ||
colorlinks=true, | ||
urlcolor=blue, | ||
linkcolor=darkblue, | ||
citecolor=darkgreen, | ||
} | ||
|
||
% Include graphics for authors who raw-inlined figures | ||
% (then docutils won't automatically add the package) | ||
\usepackage{graphicx} | ||
|
||
\ifthenelse{\isundefined{\longtable}}{}{ | ||
\renewenvironment{longtable}{\begin{center}\begin{tabular}}% | ||
{\end{tabular}\end{center}\vspace{2mm}} | ||
} | ||
|
||
% Packages required for code highlighting | ||
\usepackage{fancyvrb} | ||
|
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
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,10 +1,11 @@ | ||
import glob | ||
import os | ||
|
||
output_dir = '../output' | ||
template_dir = '_templates' | ||
build_dir = '_build' | ||
work_dir = os.path.dirname(__file__) | ||
output_dir = os.path.join(work_dir,'../output') | ||
template_dir = os.path.join(work_dir,'_templates') | ||
build_dir = os.path.join(work_dir,'_build') | ||
bib_dir = os.path.join(build_dir, 'bib') | ||
toc_conf = os.path.join(build_dir, 'toc.json') | ||
proc_conf = os.path.join(os.path.dirname(__file__),'../scipy_proc.json') | ||
dirs = sorted([d.split('/')[2] for d in glob.glob('%s/*' % output_dir) if os.path.isdir(d)]) | ||
proc_conf = os.path.join(work_dir,'../scipy_proc.json') | ||
dirs = sorted([d.split('/')[-1] for d in glob.glob('%s/*' % output_dir) if os.path.isdir(d)]) |
This file was deleted.
Oops, something went wrong.