Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View matsen's full-sized avatar

Erick Matsen matsen

View GitHub Profile
@matsen
matsen / from_scratch.sh
Last active December 15, 2015 12:49
Script for installing all of the software that I use.
#!/bin/sh
set -e
set -o
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y \
autojump \
@matsen
matsen / svg2tiff
Created December 12, 2012 01:05
A script to convert SVG to a TIFF acceptable to PLOS
#!/bin/sh
# Convert all arguments (assumed SVG) to a TIFF acceptable to PLOS
# Requires Inkscape and ImageMagick 6.8 (doesn't work with 6.6.9)
for i in $@; do
BN=$(basename $i .svg)
inkscape --without-gui --export-png="$BN.png" --export-dpi 300 $i
convert -compress LZW -alpha remove $BN.png $BN.tiff
mogrify -alpha off $BN.tiff
@matsen
matsen / latex-skeleton.tex
Last active October 27, 2016 19:52
Framework for a latex file designed for both arXiv and journal submission.
\documentclass{amsart}
\usepackage[round]{natbib}
\usepackage{graphicx}
\usepackage[notref,notcite]{showkeys}
\usepackage{url}
% in case of supplementary material
% \usepackage{xr}
% \externaldocument{lcfit_supp}
@matsen
matsen / SConstruct
Created December 5, 2012 20:06
SConstruct (http://scons.org) I use for building latex documents, featuring continuous build and auto SVG -> PDF conversion via inkscape.
from SCons.Script import VariantDir, Environment, \
Builder, Depends, Flatten
import os
VariantDir('_build', src_dir='.')
env = Environment(ENV=os.environ)
inkscape = Builder(action = 'inkscape --without-gui --export-pdf=$TARGET $SOURCE')
env['BUILDERS']['Inkscape'] = inkscape
env['BUILDERS']['Latexdiff'] = Builder(action = 'latexdiff $SOURCES > $TARGET')