#!/usr/bin/env python
import sys

def main(outfile, chapname):
    with file(outfile, "w") as f:
        f.writelines([
            '\\includeonly{{{0}}}\n'.format(chapname),
            '\\input{_master}\n'])

if __name__ == "__main__":
    main(sys.argv[1], sys.argv[2])
