Skip to content

Instantly share code, notes, and snippets.

@eyliu
eyliu / homework.cls
Created December 3, 2009 08:29
LaTeX document class for typesetting homework
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{homework}[2009/05/15 v0.0.1 Document class for typesetting homework]
\LoadClass[12pt,letterpaper,answers]{exam}
\RequirePackage{xspace}
\newcommand{\course}[1]{\def\@course{#1\xspace}}
\newcommand{\problemlist}[1]{\begin{center}\large #1 \end{center}}
\makeatletter
@eyliu
eyliu / apportionment.py
Created November 15, 2009 23:30
Python script to automatically apportion representative seats for the Michigan Student Assembly
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright: 2009 Elson Liu
# License: BSD
# Requires: urllib2
# Requires: xlrd
"""
Download enrollment data for the University of Michigan, Ann Arbor campus
and apportion seats on the Michigan Student Assembly
"""
@eyliu
eyliu / constitution.cls
Created August 11, 2009 20:05
LaTeX document class for typesetting a constitution
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{constitution}[2009/05/15 v0.0.1 Document class for typesetting a constitution]
\LoadClass{report}
\RequirePackage[letterpaper,margin=1in]{geometry}
\RequirePackage[colorlinks,linkcolor=blue]{hyperref}
%\usepackage{hyperref}
\RequirePackage{titlesec}
@eyliu
eyliu / svn-multi.tex
Created June 2, 2009 21:22
LaTeX settings for Subversion keyword substitution
% LaTeX settings for Subversion keyword substitution
\usepackage{svn-multi}
\svnidlong
{$HeadURL: $}
{$LastChangedDate: $}
{$LastChangedRevision: $}
{$LastChangedBy: $}
\svnid{$Id: $}
% don't forget to set the Subversion properties:
@eyliu
eyliu / matlab.tex
Created May 31, 2009 00:34
LaTeX settings for MATLAB code listings
% LaTeX settings for MATLAB code listings
% based on Ted Pavlic's settings in http://links.tedpavlic.com/ascii/homework_new_tex.ascii
\usepackage{listings}
\usepackage[usenames,dvipsnames]{color}
% This is the color used for MATLAB comments below
\definecolor{MyDarkGreen}{rgb}{0.0,0.4,0.0}
% For faster processing, load Matlab syntax for listings
\lstloadlanguages{Matlab}%
@eyliu
eyliu / moharam1995.py
Created May 26, 2009 04:24
Fun with Electromagnetic Python: http://empy.sourceforge.net
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright: 2009 Elson Liu
# License: BSD
"""
Reproduces Fig. 2 in Moharam, Grann, Pommet, and Gaylord, "Formulation for
stable and efficient implementation of the rigorous coupled-wave analysis
of binary gratings", J. Opt. Soc. Am. A 12(5), pp. 1068–1076, 1995
(doi:10.1364/JOSAA.12.001068)
"""