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. Poster à la Sauce Hollandaise ============================= Difficulty: **... Preparing time: 1 hour Cooking time: 2 hours Ingredients =========== - 2 texts quite long, likely to have words in common - some elbow grease - some Helvetica Bold, or better: a freed equivalent Utensils ======== - `comm` - `tr` - `cat` - `sort` - `uniq` - `grep` (optional) - `less` (optional) - `enscript` - `ps2pdf` Steps ====== 01. Go to the project directory. `cd my_path/PleaseMakeMeDesign` 02. Create a new directory where you will work in. `mkdir wip` 03. Go to this directory. `cd wip` 04. Display the content of the first file in the shell. `cat ../texts/file_1.txt` 05. Put every word on a new line. `cat ../texts/file_1.txt | tr " " "\n"` 06. Suppress punctuation. `cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:]` 07. Make everything lowercase. `cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:]` 08. Sort by alphabetical order. `cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort` 09. Removes all duplicate words. `cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort | uniq` 10. Save the result in a file. `cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort | uniq > word_list_1.txt` 11. Repeat steps 1 to 7 with the second text. `cat ../texts/file_2.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort | uniq > word_list_2.txt` 12. Compare the words used in both texts (common words are in the middle). `comm word_list.txt word_list_2.txt` Tip: use a *pager* to be able to scroll up and down. `comm word_list_1.txt word_list_2.txt | less` 13. Select an interesting word in the result (with 5 lines before and after). `comm word_list_1.txt word_list_2.txt | grep -C 5 "anyword"` 14. Layout the text in a pdf (play with variable elements !). `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'` 15. Convert the postscript file to a pdf file. `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` Alternative end =============== 14. Layout the text on an A4 with automatic font-size so that it fits the page vertically. (the output file is "my_pdf.pdf") `comm word_list_1.txt word_list_2.txt | grep -C 5 "anyword" | ../scripts/./v-justify.sh` 15. Convert the postscript file to a pdf file. `comm word_list_1.txt word_list_2.txt | grep -C 5 "anyword" | ../scripts/./v-justify.sh | ps2pdf my_pdf.ps` Optional: superpose 2 posters !!! ================================= 1. Repeat the previous steps to have another poster. 2. Create a text file listing your pdf files. `ls *.pdf > pdf_list.txt` 3. Superpose ! `podofoimpose pdf_list.txt 2in1poster.pdf superimpose.plan lua` Here you are! You now have a wonderful Dutch style poster! ==========================================================