This project is a collection of extensions and monkey patches to Sphinx to better format a PhD thesis.
Thanks to Sphinx for a kickass build system and docutils for the groundwork of multiple format output.
To my parents.
Creating a PhD thesis is typically done using LaTeX. This works really well for producing a PDF, but a giant PDF file is not a great way to put documents on the web. There are solutions that exist to turn latex source files into HTML, but in my experience, they tend to produce poor HTML output.
The Sphinx project is a wonderful tool for creating portable documents, allowing for output to many different formats. Unfortunately, it has many shortcomings when trying to typeset something so advanced as a PhD thesis. The aim of this project is to modify Sphinx to support all of the needs of a thesis writer. Many of the patches are not appropriate for contributing directly to the upstream Sphinx repository, so this is instead a separate project.
This sphinxtr output is available in several formats at: http://jterrace.github.com/sphinxtr.
The source code for sphinxtr can be found at: https://github.com/jterrace/sphinxtr.
Install the required Python packages:
pip install -r requirements.txt
You need make. The following targets are supported:
The following changes and additions have been made from vanilla Sphinx:
This chapter has typography stuff. This also shows how to have a toctree inside a chapter.
The title of this chapter, "Typography", is the first heading level. This section, "Headings", is the second level.
The third level heading. You probably shouldn't go beyond this because it just looks ridiculous, but you can anyway.
You can make emphasized text.
You can make bold text.
You can make fixed-width font.
You can make block quotes:
this is a block quote
You can make code blocks:
this is a code block
Some convenience substitutions are defined in the epilog:
You can have inline superscript or subscript text.
Big quotes, also known as an epigraph:
Your avatar can look any way you want it to, up to the limitations of your equipment. If you're ugly, you can make your avatar beautiful. If you've just gotten out of bed, your avatar can be wearing beautiful clothes and professionally applied makeup. You can look like a gorilla or a dragon, or a giant talking penis in the Metaverse. Spend five minutes walking down the street, and you will see all of these.
—Neal Stephenson, Snow Crash
This is a few examples of different list types.
Math uses latex math syntax:
Equations can have labels which you can reference 1.
You can reference a section by its label. This chapter is Chapter 5.
Vector figures are nicely supported. You should have a PDF file and an SVG file. The PDF will be used for the latex output and the SVG for the HTML output. The HTML output has a nice zoom feature using Colorbox.
See an example in Figure 6.1. I suggest making figures in something like Inkscape. If you have only a vector PDF, you can use pdf2svg to convert (brew install pdf2svg or apt-get install pdf2svg).
The subfigure directives allow you to place multiple figures side-by-side in the document. Here's an example:
Tables can be put inside the figtable directive which automatically numbers them, adds a caption, and adds a label.
Table 6.4 has all right-aligned columns.
|Left Align||Right Align|
|Some text is left align||Followed by right-aligned|
|Some more text here||And more text here|
|And even more text||Also even more text here|
Table 6.5 has one column left-aligned and one column right-aligned.
Text wrapping in tables work if you specify the width and either raggedleft or raggedright.
|Users||Stores a list of users who have authenticated with OpenID.|
|Names||Stores a list of the 3D models in the database with their associated metadata.|
|TempFiles||Temporarily stores the binary file data of uploaded files until they have been processed.|
|Files||Stores the binary file data for uploaded and verified files.|
|Sessions||Stores HTTP session information used by the Django framework to look up session state associated with a user's browser cookie.|
|OpenIdAssocs, OpenIdNonces||Stores OpenID authentication information for users.|
|CeleryResults||Stores the result of application processing tasks (see Section something).|
|APIConsumers||Stores a list of consumers of the API for use with the OAuth protocol.|
A text wrapping table example is shown in Figure 6.6.
|||. COLLADA - Digital Asset Schema Release 1.4.1 Specification (2nd Edition). http://www.khronos.org/files/collada_spec_1_4.pdf, 2008.|
|||, , , . Unsupervised Conversion of 3D Models for Interactive Metaverses. Proc. ICME '12, 2012.|
This work is licensed under a Creative Commons Attribution 3.0 United States License.