a multiformat document workflow with docutils

41
A Multiformat Document Workflow using Docutils Matthew Leingang New York University MAA Session on Publishing Math on the Web San Francisco, CA January 15, 2010

Upload: matthew-leingang

Post on 16-Jan-2015

1.490 views

Category:

Technology


4 download

DESCRIPTION

Docutils is my method for producing web pages in multiple formats, notable html and pdf. These are slides I gave for a 15-minute talk at the Joint Mathematics meetings in San Francisco in January 2009.

TRANSCRIPT

Page 1: A Multiformat Document Workflow With Docutils

A Multiformat Document Workflow

using DocutilsMatthew LeingangNew York University

MAA Session on Publishing Math on the WebSan Francisco, CAJanuary 15, 2010

Page 2: A Multiformat Document Workflow With Docutils

Multiformat

Page 3: A Multiformat Document Workflow With Docutils

∞�

n=1

1

n2=

π2

6

Multiformat

Page 4: A Multiformat Document Workflow With Docutils

∞�

n=1

1

n2=

π2

6

∞�

n=1

1

n2=

π2

6

Multiformat

Page 5: A Multiformat Document Workflow With Docutils

HTML

Page 6: A Multiformat Document Workflow With Docutils

HTML

Page 7: A Multiformat Document Workflow With Docutils

Take a Picture?

Page 9: A Multiformat Document Workflow With Docutils

Firefox

Page 10: A Multiformat Document Workflow With Docutils

Google Chrome

Page 11: A Multiformat Document Workflow With Docutils

LaTeX

Page 12: A Multiformat Document Workflow With Docutils

A third way?

Page 13: A Multiformat Document Workflow With Docutils

Docutils

http://docutils.sourceforge.net/∞�

n=1

1

n2=

π2

6

Page 14: A Multiformat Document Workflow With Docutils

Docutils has many products

PythonCode

Page 15: A Multiformat Document Workflow With Docutils

Docutils has many products

PythonCode ReST

Page 16: A Multiformat Document Workflow With Docutils

Docutils has many products

PythonCode

XHTML

ReST

Page 17: A Multiformat Document Workflow With Docutils

Docutils has many products

PythonCode

XHTML

ReST

LaTeX

Page 18: A Multiformat Document Workflow With Docutils

Docutils has many products

PythonCode

XHTML

ReST

LaTeX

PDF

Page 19: A Multiformat Document Workflow With Docutils

Docutils has many products

PythonCode

XHTML

ReST

LaTeX

PDFtroff

Page 20: A Multiformat Document Workflow With Docutils

Docutils has many products

PythonCode

XHTML

ReST

LaTeX PDF

PDFtroff

Page 21: A Multiformat Document Workflow With Docutils

Docutils has many products

PythonCode

XHTML

ReST

LaTeX PDF

XHTML

PDFtroff

Page 22: A Multiformat Document Workflow With Docutils

Docutils has many products

XHTML

ReST

LaTeX PDF

XHTML

Page 23: A Multiformat Document Workflow With Docutils

ReStuctured Text is human- and machine-readable

Page 24: A Multiformat Document Workflow With Docutils

ReStuctured Text is human- and machine-readable

San Francisco is \emph{beautiful} in January!LATEX

Page 25: A Multiformat Document Workflow With Docutils

ReStuctured Text is human- and machine-readable

San Francisco is \emph{beautiful} in January!

San Francisco is <strong>beautiful</strong> in January!

LATEX

HTML

Page 26: A Multiformat Document Workflow With Docutils

ReStuctured Text is human- and machine-readable

San Francisco is \emph{beautiful} in January!

San Francisco is <strong>beautiful</strong> in January!

San Francisco is *beautiful* in January!

LATEX

ReST

HTML

Page 27: A Multiformat Document Workflow With Docutils

SectionsTitle!!!!!

Introduction============

Math on the Web===============

XHTML-----

XHTML is an application ...

Page 28: A Multiformat Document Workflow With Docutils

SectionsTitle!!!!!

Introduction============

Math on the Web===============

XHTML-----

XHTML is an application ...

Configured by your usage

Page 29: A Multiformat Document Workflow With Docutils

LinksI'm going to JMM_ this year to give a talk__ on docutils. It’s a text format and suite of scripts with multiple output formats.

.. _JMM: http://www.ams.org/amsmtgs/2124_intro.html__ http://www.ams.org/amsmtgs/2124_abstracts/1056-n5-630.pdf

ReST

Page 31: A Multiformat Document Workflow With Docutils

Demonstration

∞�

n=1

1

n2=

π2

6

Page 32: A Multiformat Document Workflow With Docutils

Adding LaTeX to ReST

Do an example such as :latex:`$\int x^2e^x\,dx$` where they have to integrate by parts twice, an example suchas :latex:`$\int e^x \sin x\,dx$` where they have to integrate by parts twicethen solve for the original integral, and an example where :latex:`$dv = dx$`works.

Page 33: A Multiformat Document Workflow With Docutils

Adding a role to docutilsdef latex_role(role, rawtext, text, lineno, inliner,options={}, content=[]): """ Latex role. """

i = rawtext.find('`') tex = rawtext[i+1:-1] return latex_math(tex), [] def register(): register_canonical_role('latex', latex_role)

Page 34: A Multiformat Document Workflow With Docutils

Adding a role to docutilsdef latex_role(role, rawtext, text, lineno, inliner,options={}, content=[]): """ Latex role. """

i = rawtext.find('`') tex = rawtext[i+1:-1] return latex_math(tex), [] def register(): register_canonical_role('latex', latex_role)

Page 35: A Multiformat Document Workflow With Docutils

Adding a role to docutilsdef latex_role(role, rawtext, text, lineno, inliner,options={}, content=[]): """ Latex role. """

i = rawtext.find('`') tex = rawtext[i+1:-1] return latex_math(tex), [] def register(): register_canonical_role('latex', latex_role)

Page 36: A Multiformat Document Workflow With Docutils

Processing LaTeX

with demos

∞�

n=1

1

n2=

π2

6

Page 37: A Multiformat Document Workflow With Docutils

Processing LaTeX •latex + dvipng

with demos

∞�

n=1

1

n2=

π2

6

Page 38: A Multiformat Document Workflow With Docutils

Processing LaTeX •latex + dvipng

•docutils MathML writer

with demos

∞�

n=1

1

n2=

π2

6

Page 39: A Multiformat Document Workflow With Docutils

Processing LaTeX •latex + dvipng

•docutils MathML writer

•tth

with demos

∞�

n=1

1

n2=

π2

6

Page 40: A Multiformat Document Workflow With Docutils

TTHhttp://hutchinson.belmont.ma.us/tth/

Page 41: A Multiformat Document Workflow With Docutils

Thanks

∞�

n=1

1

n2=

π2

6

@mleingang#JointMath