support for linenumbering, fix refs, doublespace, add refs, add tex output