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.
Difficulty: **... Preparing time: 1 hour Cooking time: 2 hours
comm
tr
cat
sort
uniq
grep
(optional)less
(optional)enscript
ps2pdf
Go to the project directory.
cd my_path/PleaseMakeMeDesign
Create a new directory where you will work in.
mkdir wip
Go to this directory.
cd wip
Display the content of the first file in the shell.
cat ../texts/file_1.txt
Put every word on a new line.
cat ../texts/file_1.txt | tr " " "\n"
Suppress punctuation.
cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:]
Make everything lowercase.
cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:]
Sort by alphabetical order.
cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort
Removes all duplicate words.
cat ../texts/file_1.txt | tr " " "\n" | tr -d [:punct:] | tr [:upper:] [:lower:] | sort | uniq
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
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
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
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"
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'
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
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
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
Repeat the previous steps to have another poster.
Create a text file listing your pdf files.
ls *.pdf > pdf_list.txt
Superpose !
podofoimpose pdf_list.txt 2in1poster.pdf superimpose.plan lua