Recently needed to create a giant crossword (4 sheets of A0 paper, basically 4 m^2 of crosswords). Quick how-to.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ A0 + A0 + A0 + A0 +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
We need a list of words and their corresponding clues.
Crosswords are generally protected by copyright, and very few datasets are publicly available. However, a great dataset of historic New York Times crosswords is available here: https://github.com/cwang912/nyt-crossword.
The NYT dataset is in TSV format.
We need to:
- Put it in a syntax that
genxword(our crossword generator tool) will recognize - Remove some words which, oddly enough, don't have a corresponding clue
parse.go does this (go run parse.go).
If you run into parsing issues, you might need to convert the \r line endings to \r\n.
We'll name the output clues_parsed.txt.
genxword is a great tool for that.
Output format: SVG (s option) so that we can use other tools to deal with size and print layout.
genxword -n 2000 /path/to/clues_parsed.txt sgenxword will interactively ask grid size.
A0 paper is 1189 x 841 mm. Say that we want each crossword box to be about 20 x 20 mm. That means:
- floor(1189 / 20) = 59 rows
- floor(4 * 841 / 20) = 168 columns
Take a bit less to account for print margins.
Using cairosvg to create a PDF from the previously created SVG.
Let's say we want a 300 dpi PDF, basic calculations using A0 paper size (1189 x 841 mm) give us:
- width = 37795 points
- height = 13583 points
cairosvg -f pdf -d 300 -W 37795 -H 13583 -s 1 -o cairo_output.pdf genxword_output.svgThis giant crossword will actually be printed on multiple A0 sheets. pdfposter can divide it up into multiple pages.
Input size is four A0 sheets (-p 4x1a0) and output page size is A0 (-m a0):
pdfposter -m a0 -p 4x1a0 cairo_output.pdf pdfposter_output.pdfYou may want to add print margins to the document. Depending on the A0 printer you'll use, you might not need this.
Using pdfjam, and adjusting 0.3cm to whatever margin your printer needs:
pdfjam --paper a0paper --trim "-0.3cm -0.3cm -0.3cm -0.3cm" pdfposter_output.pdf -o pdfjam_output.pdf
You can now print your giant crossword.