Python for Poets

The Idea

  1. Use Mobile Devices for Writing
  2. Go from text files to finished publication

Mobile Devices - Tandy WP2

wp2.jpg

Mobile Devices - Palm TX

mobilekeyboard.jpg

Starting at A - ReST Text

Line Block Example

| There was an old party of Lyme
| Who married three wives at one time.
| When asked: ‘Why the third?’
| He replied: ‘One’s absurd,
| And bigamy, sir, is a crime.’

Arriving at X: Verse Package for LaTeX

LaTeX Verse Package Example

begin{verse}
There was an old party of Lyme \\
Who married three wives at one time. \\
hspace{2em} When asked: ‘Why the third?’ \\
hspace{2em} He replied: ‘One’s absurd, \\
And bigamy, sir, is a crime.’
end{verse}

The Initial Process - ReST to XML

a) Worked with Jacob Smullyan at WNYC to convert from ReST: http://svn.johntynan.com/poems/trunk/drafts/AllMyExes.txt

  1. to XML: http://svn.johntynan.com/poems/trunk/drafts/AllMyExes.xml

The Initial Process (cont.) - XML to LaTEX

c) convert the xml (using libxml2, libxslt and a modified version of Stefan Merten's xslt script, xml2rst.xsl):

http://svn.johntynan.com/poems/trunk/scripts/libxml/xml2latex.py and http://svn.johntynan.com/poems/trunk/scripts/libxml/xml2latex.xsl

The Initial Process (cont.) - LaTEX to PDF

d) to arrive at the finished PDF: http://svn.johntynan.com/poems/trunk/scripts/latex/poetry202.pdf

The Refined Process

  1. which converts entire directories of ReST files directly to LaTEX: http://svn.johntynan.com/poems/trunk/drafts/
  2. Then, Texmaker is used to arrive at the finished PDF: http://www.xm1math.net/texmaker/

Screenshot

scripts-docutils-verse-writer.gif

To Do

Python for Poets

Hope you found this useful.

Thank You.