clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository


Download raw (4.1 KB)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="http://www.w3.org/1999/xhtml">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Conforming XHTML 1.0 Strict Template</title>



<pre><code>This is part of the please "computer | make me design" documentation.
Copyright 2010, Ivan Monroy Lopez, Stéphanie Vilayphiou, Alexandre Leray
and Ludivine Loiseau
See the file licences/fdl-1.3.txt for copying conditions.

<h1>Poster à la Sauce Hollandaise</h1>

<p>Difficulty: **...
Preparing time: 1 hour
Cooking time: 2 hours</p>


<li>2 texts quite long, likely to have words in common</li>
<li>some elbow grease</li>
<li>some Helvetica Bold, or better: a freed equivalent</li>


<li><code>grep</code> (optional)</li>
<li><code>less</code> (optional)</li>


<li><p>Go to the project directory.
<code>cd my_path/PleaseMakeMeDesign</code></p></li>
<li><p>Create a new directory where you will work in.
<code>mkdir wip</code></p></li>
<li><p>Go to this directory.
<code>cd wip</code></p></li>
<li><p>Display the content of the first file in the shell.
<code>cat ../texts/file_1.txt</code></p></li>
<li><p>Put every word on a new line.
<code>cat ../texts/file_1.txt | tr " " "\n"</code></p></li>
<li><p>Suppress punctuation.
<code>cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:]</code></p></li>
<li><p>Make everything lowercase.
<code>cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:]</code></p></li>
<li><p>Sort by alphabetical order.
<code>cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort</code></p></li>
<li><p>Removes all duplicate words.
<code>cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort | uniq</code></p></li>
<li><p>Save the result in a file.
<code>cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort | uniq &gt; word_list_1.txt</code></p></li>
<li><p>Repeat steps 1 to 7 with the second text.
<code>cat ../texts/file_2.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort | uniq &gt; word_list_2.txt</code></p></li>
<li><p>Compare the words used in both texts (common words are in the middle).
<code>comm word_list.txt word_list_2.txt</code><br />
Tip: use a <em>pager</em> to be able to scroll up and down.
<code>comm word_list_1.txt word_list_2.txt | less</code></p></li>
<li><p>Select an interesting word in the result (with 5 lines before and after).
<code>comm word_list_1.txt word_list_2.txt | grep -C 5 "anyword"</code></p></li>
<li><p>Layout the text in a pdf (play with variable elements !).
<code>comm word_list_1.txt word_list_2.txt | grep -C 5 "anyword" | enscript -B -f 'Helvetica-Bold@18/19' -T 16 -p 'my_pdf.ps'</code></p></li>
<li><p>Convert the postscript file to a pdf file.
<code>comm word_list_1.txt word_list_2.txt | grep -C 5 "anyword" | enscript -B -f 'Helvetica-Bold@18/19' -T 16 -p 'my_pdf.ps' | ps2pdf my_pdf.ps</code></p></li>

<h1>Alternative end</h1>

<li><p>Layout the text on an A4 with automatic font-size so that it fits the page vertically. (the output file is "my_pdf.pdf")
<code>comm word_list_1.txt word_list_2.txt | grep -C 5 "anyword" | ../scripts/./v-justify.sh</code></p></li>
<li><p>Convert the postscript file to a pdf file.
<code>comm word_list_1.txt word_list_2.txt | grep -C 5 "anyword" | ../scripts/./v-justify.sh | ps2pdf my_pdf.ps</code></p></li>

<h1>Optional: superpose 2 posters !!!</h1>

<li><p>Repeat the previous steps to have another poster.</p></li>
<li><p>Create a text file listing your pdf files.
<code>ls *.pdf &gt; pdf_list.txt</code></p></li>
<li><p>Superpose !
<code>podofoimpose pdf_list.txt 2in1poster.pdf superimpose.plan lua     </code></p></li>

<h1>Here you are! You now have a wonderful Dutch style poster!</h1>