def write(klass, document, target=None, stylesheet=""):
        """
        convert a pyth document to a latex document

        we can specify a stylesheet as a latex document fragment that
        will be inserted after the headers.  This way we can override
        the default style.
        """
        writer = LatexWriter(document, target, stylesheet)
        return writer.go()