import random, sys header = '''\documentclass[8pt]{scrbook} \usepackage{i/a/utils/latex/sty/LSI-191x235+crop} \usepackage{i/a/workshop/bag/Boxes_and_Glue} \usepackage{00_NEWCOMMANDS} \\newcommand{\\tib}[1]{ \colorbox{black}{\color{white}#1} } \\begin{document} \setlength{\unitlength}{.5\paperwidth} ''' f = open('mypage.tex', 'w') f.write(header) f.write('\\begin{picture}(0,0)\n\n') #These words are from poems from Shakespeare, Sir William Scott and Sappho #let = ['blow', 'thou', 'winter', 'wind', 'art', 'not', 'so', 'unkind', 'as', 'mans', 'ingratitude', 'thy', 'tooth', 'is', 'not', 'keen', 'oh!', 'young', 'Lochinvar', 'is', 'come', 'out', 'of', 'the', 'west', 'through', 'all', 'the', 'wide', 'border', 'his', 'steed', 'was', 'the', 'best', 'and', 'save', 'his', 'good', 'broadsword', 'he', 'weapons', 'had', 'none', 'he', 'rode', 'all', 'unarmed', 'and', 'he', 'rode', 'all', 'alone', 'without', 'warning', 'as', 'a', 'whirlwind', 'swoops', 'on', 'an', 'oak', 'love', 'shakes', 'my', 'heart' ] #These words are from the Wikipedia page on Visual Poetry let = ['visual', 'poetry', 'is poetry', 'or', 'art', 'in which', 'the visual', 'arrangement', 'of text', 'images and symbols', 'is', 'important', 'in conveying', 'the intended', 'effect of', 'the work', 'it is', 'sometimes', 'referred to', 'as concrete', 'poetry', 'a term', 'that predates', 'visual poetry', 'and', 'at one time', 'was synonymous', 'with it' 'visual poetry', 'was', 'heavily influenced', 'by Fluxus', 'which is', 'usually', 'described', 'as', 'being intermedia', 'intermedia', 'work', 'tends', 'to blur', 'the distinctions', 'between different', 'media', 'and visual poetry', 'blurs', 'the distinction', 'between art', 'and text', 'whereas', 'concrete poetry', 'is still', 'recognizable', 'as poetry', 'being composed', 'of', 'purely', 'typographic', 'elements', 'visual poetry', 'is generally', 'much less', 'text-dependent', 'visual', 'poems', 'incorporate', 'text', 'but' 'the text', 'may have', 'primarily', 'a visual', 'function', 'visual', 'poems', 'often incorporate', 'significant', 'amounts', 'of non-text', 'imagery', 'in addition', 'to', 'text', 'there', 'remains some', 'debate', 'regarding', 'the distinction', 'between concrete', 'poetry', 'and visual', 'poetry', 'there', 'are', 'three dominant', 'views regarding', 'the issue', 'one view', 'is', 'that visual', 'poetry is', 'synonymous with', 'concrete', 'poetry', 'a second', 'view', 'is', 'that', 'visual', 'poetry', 'is', 'a type', '(or sub-category)', 'of concrete', 'poetry', 'and', 'the last', 'view', '(adopted in', 'this article)', 'is that', 'visual poetry', 'has', 'evolved into', 'a visual', 'form distinct', 'from concrete', 'poetry', 'this', 'view', 'is supported', 'by work', 'identified', 'as visual', 'poetry', 'in which', 'typographic', 'elements', 'are', 'secondary', 'to visual', 'elements', 'are minimal', 'or in some', 'cases', 'are absent', 'altogether from', 'the work', '!', '?', '!', '?', '!', '?'] for i in range(50): pos = random.randint(0,8) letter = let[pos] del let[pos] # print letter, f.write("\\put("+ str(random.random()) + " , "+ str(random.random()-1) + "){\\tib{" + letter + "}}\n") f.write('\n\\end{picture}\n') f.write('\\end{document}\n')