Google Docs to LaTeX Converter

The really bad thing about Google Docs is that document structure is not
preserved in exported document formats such as HTML or ODT. It does not 
mark up headers with <h1>, <h2>, etc, and nested lists are flattened.
Even in ODT, each heading is assigned its own style.

This script tries to guess the sections and subsections based on its font
size, so you should not alter the headings after you have applied the 
heading style.

The aim of this script is to produce human-readable, properly formatted
LaTeX markup, so that you can make your own alterations to the markup 
afterwards and easily diff them with future versions of your Google Doc 

The script was written to convert my own documents, which are pretty simple
at the moment, so as I go along and encounter features that I need, I will 
enhance the converter. Feel free to make improvements and submit patches.


* To markup proper URLs, simply make Google point the link to empty text.
  You can trick the UI by putting an invalid URL like a single dash.
  URLs that are properly marked up will not result in overfull boxes (usually).

* To demarcate the appendix section of the document, insert a page break
  followed by a Heading 1 with the word 'Appendix'

* The following types of circle characters are supported:

    - &bull; filled circle
    - U+9679 filled circle
    - U+9675 unfilled circle

* To add caption to tables, create a Heading 5 with "Table:" prefixed to the
  actual caption. Labels attached to the heading will be attached to the table.

* To reference chapters/sections/subsections with the section numbers, create a 
  link to the bookmark but use either "\ref" or "\autoref" as the text to be linked.
  Optionally you may add a tilde in front to insert a non-breaking space, 
  like "~\ref", with the previous text.

* To cite a reference, use "\cite{...}" within a footnote.


gdoc2latex uses the following modules, all of which are distributed
under their own licensing terms, but are included in this source tree.
Please visit their respective URLs for their licensing terms and source code.

  * css-py @ http://code.google.com/p/css-py/
  * PLY (Python Lex-Yacc) @ http://www.dabeaz.com/ply/
  * BeautifulSoup @ http://www.crummy.com/software/BeautifulSoup/


Copyright (C) 2010 Darell Tan

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.