; TeX output 1996.12.09:1045soDtGGcmr17Some7tMacrostoDraqwCrosswords!", cmsy10XQ cmr12BHamiltonKelly2K cmsy8y〺DecemrbSer9,1996-w!Kt : cmbx9Abstracthȍoo cmr9Thelow cmss9crossw9ordenvironmentisintendedtobAeusedtotypAesetcrossword bpuzzlesTforuseinnewsletters,etc.I ffcTNff cmbx12Contents/"V cmbx101In9troQductionXX1xxK`y cmr101.1&How XtoSpGecifyClue &NumbGersȍ..........p22De nitionToftheMacrosX32.1&CountersUUandLengthsT..p32.2&ReadingPandW*ritingthe&CluesFڍ............p52.3&T*abulatingUUtheClues8U...p63ŀCreatingTtheGrid<7 ŀ3.1܀MacrosusedwhenPopu-܀latingUUtheGrid;......p8ŀ3.2܀TheUU 'ExXmethoGdoftypGe-settingthese, "5-:Aacmr61LܿThatXatRMCShasabthe\lights"whichreceivethe Ianswers"totheclues.W*orkisinhandItoĺbGeabletohandlethe!p0J cmsl10Mephisto/AzedItypGevofgrid,?inwhichonlythickergridIlinesUUseparatethelights. 7+XAf+samplefqcrosswordappGearsasFi-IgureK1;_FI'veleftthegridblankforIthosewhowantsomeintellectualexer-Icise:thosepwhodon'tcancheatbyre-IadingthesourcelistingattheendofIthisUUarticle!XThewholecrossword,includingtheI\cluetcommands(#': cmti10q.v.),isbracketedtwi-Ithinthe$m#R cmss10crosswordײenvironment. 5LThisIrequires\thattheuserspGeci estwo\pa-Irameters:I !", cmsy10h%F C cmbxti10gridsizeٚi}ThisisanumbGerwhichspGe-bci esthecolumns(androws)inbtheUUsquaregrid.ܬIhvisibleٚiuThisn'ExXtoinputabyes/noanswerbyinteractionwithbtheUUuser.XAnanalogousenvironmentisprovi-Ided~espGeciallyfortypesettingasmallerIversionDofagridshowing,?forexample,I\LastMonth'sSolution".Inthisofco-Iurse,dthe.answersalwaysOappGear,andIthecluesarenotprinted.>AgainittakesItwoUUparameters:Ihgridsizeٚi}AsbGefore,thisspeci esthebnumbGerUUofsquaresineachaxis.ܬIhhei>aderffAtext¸in1SometextwhichwillbGebsetH(inbQold)abGoveHthecompletedbgrid.IHereisanexampleofthecrossword*en-Ivironment:ð.SLastTmon9th'ssolution^2ѣfdaq a aRuq a afAMfOf0WOfyBURfmGfb/7NfXIfKZRDf@ Nf4QAf)jTflS^2q a a^2pfdaTRu< a a1UW< a a):Lv9< a amN` < a aVDIE< a aB1I2ߟ< a a+nI< a a^2< a a^2fdaۣo NۣoUOۣogRۣoTۣo0WOۣoySۣooI` S a aۣoVͨHۣoKTۣo@?Aۣo4QBۣo)|Bۣo3AۣoGS^2ҬfdaAhZERuyĄ a aA:TWyĄ a aA:Bv9yĄ a aAnfL` yĄ a aAWAIEyĄ a aA@ZR2ߟyĄ a aA)զEyĄ a aAGS^2KgfdaQ3CQIQڑSQySQ:AQ{rIQnfL` 5 a aQURMQKUQ@.TQ4QAQ)lRQ5RQE^2؄fda~SRu a a~uOW a a~{Iv9 a a~mA`  a aT a aIE a a~@E2ߟ a a~)|A a a~NN^2Ifda3hZE3uC3N3U3BDv9U a a3m~D3bqE3W7S3M6I3@ZR35P3)lR3U3GS^2&fdaYDRu a a柤 a aW a a-ȟ a av9 a anE`  a aW&CIE a a=n a a2ߟ a a'!P a a a aGS^2+fdaZ NZUOZ>IZTZEZyǫLZmPZaYMZXIIE a aZ@EZ4åUZ* SZNZE^2cfdavARu0j a aAMW0j a a:Gv90j a akj0j a a` 0j a aVͨNIE0j a a@ZR2ߟ0j a a)lR0j a aYL^2 fda3CILXAM:AyBURmA` ۄ a aVOLAoL?O5P)զE IT^2w~fdau5h NRuwmL a au5hLXGWwmL a au5hEv9wmL a au5hmR` wmL a au5hURMIEwmL a au5h@.T2ߠwmL a au5h)PPwmL a au5hGS^2l>fdaiٍ=IiٍxNiٍ>IiٍMiٍRiٍyEiٍmUT` l a aiٍW[EiٍL/Siٍ@Siٍ4QAiٍ)PPiٍMiٍkI^2``fda`. a aRu`. a a^rJgRW`. a a^rJCv9`. a a^rJnfL` `. a a^rJVͨNIE`. a a^rJ@E2ߠ`. a a^rJ)զE`. a a^rJYL^2U{фfdaUH a aSȑRSuOSTS:ASyǫLSmpUSbdBSURMSKoAS@ZRS575ES)PPUH a a^2UH a a^2JBfdaaqafeҟqafeCqafeqafe\%qafeqafevqafek7xqafe_qafeTtZqafeI˟qafe=erriJThe[numbGerofthelightonthegrid,?forexample{17}./Seeq1.1bGelowfordetailsofhowmorecomplexspGeci cationsmayUUbGegivenformultiplelights.hAi>cross/DownOiQq"ThisparametermustbGeeithertheletter`A'or`D',inuppGer-case.hci>olffAnumberriDzGThe& b> cmmi10x-coGordinateofthe rst7squareofthelight.lTheleft-mostRcolumnofthegridisnumbGe-redUU1.hri>owffAnumberriHThe y[ٲ-coGordinateofthe rstsquareofthelight.wThetop-mostUUrowisnumbGered1.hanswerri0The Sanswertotheclue(orZthatpartofitwhichap-pGears QinthelightnumbGeredhclueffnumb}'eriV:p).This^mustbGeastringofuppGer-caselettersonly};no(spaces,]npunctuation,hyphens,etc.Iffffr J= "5-:2LܿTheXloÎwer-caseletters`&Cscmtt8y'and`n'arealsorecognized2 sosvIhtext¸ii^The.textoftheclueitself. OIf byouwanttouseanyL5ffA͉TU>'ExXma-bcrosinthistext,Psuchas\dots,beachijAnythingJ!toappGearafterthebtext,Iinxparentheses;thiswillmostbusuallybGeusedforgivingtheblength#oftheanswer,ٖsuch#as\7"borw\2,6,3-3". -AlsousedwhenthebtexteoftheclueisassoGciatedwithbanother3lightwhenthisparameterbmay:saysomethinglike\see14d".位I'N cmbx121.1gHow toSp`ecifyCluegNumb`ersISometimesthesolutiontooneclueisIsplitRamongstanumbGerRof\lights".T*oIcoverthiseventuality*,3!providea\cluevforSe}'ach;ofthelightsinvolved,T%withthe solution(tothatlightalonegivenashansweri&'.XAllexceptthe\cluecorres-pGondingtothe rstlightofthesolutionshouldHhaveanullhtextظimX,andthehhelpiparameterfbshouldbGesomethinglike\see7d". 9ōIf0Wthis nalparameteristotallyempty*,MnoBcorrespGondingcluenumbGerissprinted:thisfacilitywouldbGeusedwhenthecurrentclueisthenextconse-cutivelight,whenitisusualtoomitanyfurtherUUreferencetothecluenumbGer.The.9\clueforthe rstlightofthe(solutionshouldprovidetheen-tir}'eclue;asitshtextظiו,andthehhelpishouldVsaysomethinglike\7,3-3".4Thehclueffnumb}'eri? eldshouldconsistofthenumbGerNofthatlight, followedNimme-diatelyrbythetextrequiredtodescribGetheUotherlights,YseparatedfromitbysomeXnon-digitcharacter,}forexample,aUUspace.XF*ornexample,suppGosetheclue\Bill'sdesiredoutcome?",hasthesolution`ACT IOFUUP*ARLIAMENT'whichistogointolights9dand13a.qThen^3x?"ߤN cmtt9\clue{13}{A}{5}{1}{PARLIAMENT}{}{see9d} x?\clue{9{\noexpand\rm\&}13a}{D}{1}{10}{ACTOF}%`{Bill'sdesiredoutcome?}{3,2,10}IwillUUproGduceI13Y(seeUU9d)IamongstUUtheACROSSUUclues,andI9T&13atHٲBill'sUUdesiredoutcome?q(3,2,10)IamongstUUtheDOWNclues!čI2aLDe nitionffoftheMacros3P\ninept3P\@listiIW*eMsde neanewfontsizetoensurecluesaresetat9pt,znomatterwhatstyleIsizeSoptionisine ect.m-Thiscommandalsode nessuitableparametersforlistIenvironmentsUUsetinthissizeoftypGe.Ls1S) cmsy9hpack9age#g i Ls2S\def\ninept{\@setsize\ninept{11pt}\ixpt\@ixptLs3]\abovedisplayskip8.5ptplus3ptminus4ptIffffr J= "5-:3LܿnoteXthe\noexpandbWWSx9>WWSv$8uB fddC_WWT 7BWW16WW35UWW흅4۰WWx3WWT)2gKWW/{1uBWWuB „fdu"fed-feR֟feAfe0(feџfezfe#fe̟fe}ufekfeXǟfeFpfe4fe!Ÿfeukfe2q2tA9CROSS -T8ATP9ointsathousandtestedforwitc9hcraft.(4)-T9ATGourmet's.triumphan9tcryon ndingATmiddle-cutTP9aci csalmon!p(3)-T10ATOne3h9undredstridebackwardsacrossaATP9ole.p(3-3)-T11ATFifties' jazzrecordabAoutEasternc9hilds'ATpla9y:.p(2-4)-T12ATTimetable<"createdb9yeditorinsynagogueATofTSpain.p(8)-T13ATThedialectagirlmixeduptanglearoundATsym9bAolic>diagramusedbymaritimestu-ATden9t!p(15)-T15ATWireTfasteningbAen9troadnarrowly:.p(7)-T17ATHammerheadconsumesGermancompan9yATandTcastsashade.p(7)-T20ATStrangecelalienc9hopstomakea gurewithAToAddTsides.p(7,8)-T23ATSoundsjlik9eahoarseeditorcametointotal!AT(8)-T25ATAssertV3withoutproAofev9eryone,|mforV3example,ATEnglish.p(6)-T26ATFlourishedTexaminationof o9wers.p(6)-T27ATFloAor|co9veringdiscardsfumingsulphuricATacidTandreturnstonothing.p(3)-T28AT\Latin foracandle"tobAesilen9tnoteaboutATaircraftman?p(4)" @(dffOgyDO9WN U1WW:aterTrushnoisedisturbssho9wso!p(6)U2WMisc9hievousc?childwithclothmeasurehesi-WtatesTtoassem9blerotor.p(8)U3WMercifully6inclinedtopassroundten?Na9y:,WabAoutTshortblo9wer!p(15)U4WSortion?dAnisotrongiv9esitanewtwist!W(7)U5WWildlyandbAoisterouslyrearrangeBillyWMa9yTThird,roughly:.p(15)U6WSatirical/rbAookor lm|giv9eoddsaboutre-WvisionTof\Dune"?p(4-2)U7&24(0PremiertoAokinaLordLieutenan9tandWallbpla9yedanoldgameinLondonstreet.(4-W4)U14WW:orkTexpAendedinpo9werTgames?p(3)U16WATc9hurchcircle(orpartofone).p(3)U18WEncircle)hindrancesunderhairinlongcurls.W(8)U19WBosso9verotorhinolaryngologydepartmentWundergraduate.p(7)U21WOldTdo9vecoteinParisianmuseum.p(6)U22WLik9e7ornamentalfabric,@forexample,that'sWinTbAequest.p(6)U24W(SeeT7)MܲFigureUU1:qASampleCrossword4?CsoLs4]\belowdisplayskip\abovedisplayskip Ls5]\abovedisplayshortskip\z@plus2ptLs6]\belowdisplayshortskip4ptplus2ptminus2ptLs7]\def\@listi{\itemsep0ptLs8f\parsep\z@plus1ptLs9f\topsep4ptplus2ptminus2ptI10S}}6I2.1gCountersandLengthsuT L\ifnumberit \numberittrue 6\numberitfalseIThecrosswordenvironmentdrawsagrid(withblackandwhitesquares);Fyeach I\light"intowhichaclue'sansweristobGewrittenhastobenumbGered,}andthisInumbGerwillbetypeset(using\tiny)inthetop-leftcornerofthe rstsquareofItheUUlight.XThisestyleoptionalsoprovidesthecrossword*environment,j!whichisintendedItoKbGeusedtoproduce\lastmonth'ssolution"inasmallergrid.>ThereisinsucientIroGomforcluenumberstoappearonthegridinthismode,+so\ifnumberitisusedItoUUindicatewhetherthenumbGersUUshouldbeset.I11S\newif\ifnumberit$\gr@dsizey\p@csizeIThe6counter\gr@dsizeisusedtoholdthewidthofthegrid,asthenumbGerofIsquaresUUineachdirection.XT*opreventtoGomuchrun-timearithmetic,9thecounter\p@csizeissettobGeIoneUUcounthigherthan\gr@dsize.I12S\newcount{\gr@dsize} I13S\newcount{\p@csize}'|\Down3P\AcrossIAsHWwemovearoundthegrid,Jdeterminingwhethersquaresareblackorwhite,JweIutilizeUUthecounters\Acrossand\DowntokeeptrackofourloGcation.I14S\newcount{\Down} I15S\newcount{\Across}6I2.2gReadingandWritingtheCluesuT3P\tf@acr3P\tf@dwn 6\OpenClueFilesIWhilst ^wearedeterminingtheappGearanceofthegrid,\wecopythetextofeachofIthecluestoanauxiliary le,sothatthelattermaylaterbGereadbacktogenerateItheUUcluesthemselvesafterthegridhasbGeenprinted.XThis`macroopGensanew le,lwith leextension.acr,andputsintoittheIcommands`necessarytotypGesettheAcrossclues.VItalsoopensa.dwn le,cQwhichIisUUsimilarly lledwiththeDownclues.XNext~paragraphisnolongertrue.I~changedthecoGdingtoallowmorethan6IcrosswordstobGeusedinonedocument. UsingtheapproachoutlinedbGelowtheIsystemUUwouldrunoutofwritechannelsprettysoGon.q(FMi)X[These lesarecreatedinthesamemannerastable-of-contents(.toc) les,Ietc;thustIL5ffA͉TU>'ExXwillcreate le\handles"withnames\tf@acrand\tf@dwn.ΤHo-Iwever,mthatwouldordinarilyattempttor}'eadߋthegiven le rst,mandalsomightIdeferIntheactualopGening;ztherefore,swestartanewgroupinwhichwerede neIL5ffA͉TU>'ExX'sUU@inputcommandandTU>'EX's\openoutprimitive.q]I16S\newwrite\tf@acr I17S\newwrite\tf@dwn5VsoI18S\def\OpenClueFiles{% I19]\immediate\openout\tf@acr\jobname.acr\relaxI20]\immediate\openout\tf@dwn\jobname.dwn\relaxIHere'sUUthepreliminarymaterialthatgetsinsertedintothe.acr le.I21]\@writefile{acr}{\begin{minipage}[t]{70mm}}%I22]\@writefile{acr}{\centerline{\textbf{\ACROSStext}}}%I23]\@writefile{acr}{\sloppy}%I24]\@writefile{acr}{\ninept}%I25]\@writefile{acr}{\begin{ClueList}}%IWhilstUUsomethingsimilargoGesintothe.dwn le.I26]\@writefile{dwn}{\begin{minipage}[t]{70mm}}%I27]\@writefile{dwn}{\centerline{\textbf{\DOWNtext}}}%I28]\@writefile{dwn}{\sloppy}%I29]\@writefile{dwn}{\ninept}%I30]\@writefile{dwn}{\begin{ClueList}}} L\ACROSStext $\DOWNtextI31S\newcommand\ACROSStext{ACROSS}I32S\newcommand\DOWNtext{DOWN}f\CloseClueFilesIAfter|'thegridhasbGeenprinted,we|'canclosethe\clues" les;thesewilllaterbe Iread+backin(bythe\endcrosswordcommand)tosetthetextofthecluesbGelowItheUUgrid.XBeforeclosing,~weinsertthematerialthatcompletesthetwoClueListenviro-Inments;UU rstlyacross...I33S\def\CloseClueFiles{% I34]\@writefile{acr}{\end{ClueList}}%I35]\@writefile{acr}{\end{minipage}}%IThenUUforthedownclues.I36]\@writefile{dwn}{\end{ClueList}}%I37]\@writefile{dwn}{\end{minipage}}%INowXQwecanclosethose les,Yandmakethem\invisible"ifsomeonetriestowrite ItoUUthem.I38]\immediate\closeout\tf@acr\let\tf@acr\relaxI39]\immediate\closeout\tf@dwn\let\tf@dwn\relaxI40]\endgrafI41S}6I2.3gTabulatingtheCluesuTITheauxiliary lescontainthetextsoftheclues,ҥeachgivenasan\itemforthe IClueListOenvironment.aThisissimilartoadescriptionlist,exceptthatoverlongIlabGelsUUrunonintothetextratherthanstickingouttotheleft.$\ClueList 6\ClueListLabelIThisUUsetsuptheClueListenvironment,UUandde nestheappGearanceofthelabel.I42S\def\ClueListlabel#1{\hspace\labelsep{\bf#1}\hss} I43S\def\ClueList{\list{}{\labelwidth\leftmarginI44]\advance\labelwidthby-\labelsepI45]\let\makelabel\ClueListlabel}}I46S\let\endClueList\endlist6dso L\PrintCluesIThefollowingmacroreadsinthetwo les(ofAcrossandDownclues),Nandsets IthemGalongsideeachother,Jseparatedbyaverticalrule.mCCluesaresetinthestyleIofUUtheClueListenvironment.I47S\def\PrintClues{% I48]\centerline{%I49f\begin{tabular}{c|c}I50p2\@input{\jobname.acr}I51p2&I52p2\@input{\jobname.dwn}I53f\end{tabular}I54]}\endgrafI55S}!čI3aLCreatingfftheGridITheremainingcommandsareconcernedwithcreating(and,/optionally*,pGopula- Iting)UUthecrosswordgrid\crosswordIThe=crosswordenvironmenttakestwoparameters:fviz.thesizeofthematrix,BandIthe6indicationofwhetherthegridistoincludetheanswers.k(IfthelatterisIomitted,UUL5ffA͉TU>'ExXwillrequestitinteractively*.)I56S\def\crossword#1#2{%XW*e starto witha\vtopbGoxandagrouptoholdeverythingwithintheIenvironment,UUsoastoensurethatuser-enteredtextremainswiththecrossword.I57]\endgraf\leavevmode I58]\vtop\bgroupXThecrosswordenvironmentusesthefull-sizegrid,ȮandhasthelightsnumbGered.IF*urthermoreitdoGesn'thaveanyheadingtooutput(seethecrossword*environ-Iment).I59f\unitlength6mm\numberittrue I60f\def\Header{}%XW*enowopGentheauxiliary lesintowhichthecluesarewritten,ÌanddetermineI(interactivelyUUifnecessary)whethertheanswersaretobGewrittenintothegrid.I61f\OpenClueFiles I62f\TestAnswers{#2}%XFinally*,PwegeneratethenecessarymacrostodescribGethegridasbeingentirelyI lledUwithblacksquares;foreachsquare,amacrowhosenameisoftheform\RiCi,I\RxiiCviii,)etc.iscreated.J)Asthe\cluecommandsarereadin,thesewillbGeIrede nedtoproGducethecorrectappearancewhenthemacrosarelaterexpanded.I63f\SetUpGrid{#1}}\endcrosswordIWhenValltheclueshaveVbGeenprocessed,WYwecaninvoke\FinishGridtodrawtheIgrid.TheeX\FinishGridand\PrintCluescommandsdrawthegridandtabulateItheclues,respGectively*.`ByenclosingtheminaverticalmoGdelist,weensurethatItheyUUremainstucktogetherononepage!7oРsoXThec'ExXinternalcommand\@gobble)andtheIrecursionUUwillthenunravel.I87]\ifx#2\@nil\let\nextlet=\@gobbleXOtherwise,wehaveanotherletterofthehansweri,vin#2,sowecall\letterputItoAde nethemacrocorrespGondingtothissquare,|andcountonemorepositionIoGccupiedUUinthecurrentdirection.I88]\else\letterput{#2}\advance#1by\@neXAfter4the rsttimeIanyway).qW*eUUevenprovidetheuserwithsomehelp!E115yw^\ifNoerr E116\errhelp{TwointersectinglightstriedtoE117pputdifferentletters^^Jinthesamesquare!E118pYou'veprobablyconfusedtheircoordinates.^^JE119pCarryon,andexaminetheprintout.}E120\errmessage{Illegalredefinitionofsquare\ther@w\thec@l.E121pWas:\expandafter\meaning\csname\ther@wE1226v\thec@l\endcsname.E123pNow:\noexpand#1}E124\NoerrfalseE125yw^\fiE126p2\fiXSowfar,=wedon'tseemtoneedtochangeanything,=butifthenew#1whichhas IbGeen{passedto\putsquarespeci esthatitbenumbered,Dwe{mustsubsumeanyIexistingUUde nitionwhichdo}'esnP'tH-haveanumbGer.XAgain,;we5wmaketempGoraryreassignmentsforthetwopGotentialmacros,;whichIisUUwherewemakeuseofthetwonewtokensthatweinvented.E127p2\let\lettersquare=\blank E128p2\let\numbersquare=\numberedXIfthefollowingtestsucceeds,weknowthatthenewparameterspGeci esaInumbGeraswellasaletter.ThiscodecouldbeexpandedtocheckwhethertheIoriginalLde nitionalsospGeci edanumber,0IandLifsoensurethattheyaretheIsame,butwouldanybGodyreallybGesillyenoughtogivedi erentnumbGersforcluesIstartingUUfromthesamesquare?!E129p2\expandafter\ifx#1\NumberE130yw^\need@dtrueE131p2\fiE132f\fiE133]\fiXNow'weknowwhetherwemust(re)de nethemacrowhichisuniquetothisIsquare.IfLwemust,weexpandour#1,soastogettheactualnumbGerandletterIpassedrinthroughthatparameter,RbutkeepthenameoftheplacementmacroIitself^4Ȳunexpanded.E134]\ifneed@dE135kJ\expandafter\edef\csname\ther@w\thec@l\endcsname{\noexpand#1}E136]\fiE137S}I&effr J= "5-:4LܿThisXwillb'ExX2"-wehavetosave\iterateastheinternalsof\loopIhavebGeenstreamlined._Withtheoldcodeonlythe rstrowwasupGdated|thisisItheUUrpGcieforusinganunpublishedimplementationfeature.E182S\def\blackenrow{\let\savediterate\iterate E183]\loop\relax\ifnum\Across>\z@E184f\setsquare{\blacksquare}%XW*eWthenshiftourselvesbacktothenextcolumntotheleftanditerate.yIfIwe'veUUreachedtheendofthisinnerloGop,were-establishthede nitionof\body.XAgainUUwith2ethishastobGe\iterate.wE185f\advance\Acrossby\m@neE186]\repeatE187]\let\iterate\savediterateE188S}2\SetUpGridIThisUUmacrocreatesanemptygridoftheappropriatesize.E189S\def\SetUpGrid#1{%wXW*eu0 rstlymakeanoteofthehgridsize[i0Hparameterinthe\gr@dsizecounter, IfromwhichthewidthandheightofthegridmaybGecomputed.W*ealsosettheI\p@csizecountertobGeonegreaterthan\gr@dsizetosaveourrecomputingthisIquantityUUmanytimesover.E190]\gr@dsize=#1 E191]\p@csize=#1\advance\p@csizeby\@newXRight,ܒthisaiswherewestarttogeneratethegriditself.?vW*estartatthebGottomIedge,rbGecauseyTU>'ExXloopsareeasiestifcountingdowntozero.0Therefore,rthe\DownIcounterUUissetequaltothehighestrownumbGerattainable.E192]\Down=\gr@dsizewXW*e6nowstartaloGop, sothefollowingcoGdewillberepeatedforeachrowoftheIgridʚinturn.їAswiththerows,weʚproGcessthecolumnsfromhighestaddresstoIlowest,UUsothe\Acrosscounterisalsosettothehighestcolumnattainable.E193]\loop E194f\Across=\gr@dsize14ŋsoXProvidedtswehaven'tdecrementeddowntothe0throw,|;westarto theinner IloGop$~toprocesseachcolumn:thisisdonebyinvokingaseparatemacro|theIalternativetowhichwouldbGetoenclosetheinnerloopinagroup,{whichwouldIrequireUUtheuseofglobalde nitionsforeachsquare.E195f\ifnum\Down>\z@ E196yw^\blackenrowXAfterwardsUUwemoveourselvesuponerow,anditerateforthenextrow.E197yw^\advance\Downby\m@neE198]\repeatE199S}IAndUUthat'stheendof\SetUpGrid!3P\thec@l 3P\ther@wI\thec@l!and\ther@wmacrosgenerateastringofletters,T startingwith`C' (for Icolumn)Aand`R'AK(forrow)respGectively*.6_TheremainderofthestringconsistsofIthe`Olower-caseRomannumeralequivqalenttothecurrentvqalueoftheappropriateIcounter.WrSuchUall-letterstringsareusedtocreatethenamesformacroswhichcanIbGeUUuniqueforeachsquareofthegrid.E200S\def\thec@l{C\romannumeral\Across}E201S\def\ther@w{R\romannumeral\Down}b\TestAnswersIThisemacrointeractswiththeuser,iifnecessary*,togetayesornoindicationofIwhether)theanswersshallbGewrittenintothegrid.NocheckismadethattheIuser-shasenteredavqalidrespGonse,5mbuttheuseof\answerissuchthatanyanswerIapartUUfroma`y'(inuppGer-orlower-case)UUistreatedasifitwere`n'."\f@rstIT*o)/determinewhatparameterhasbGeenprovided,2ortheresponseelicited,2wewillIrequire1alittlemacrotopassonthe rsttokenofalistterminatedbyafullstop.E202S\def\f@rst#1#2.{#1}XW*e$commencebylower-casingthegivenparameter,settingthelower-casedIversionUUintothemacro\answer.E203S\def\TestAnswers#1{\edef\next{\def\noexpand\answer{#1}}% E204]\lowercase\expandafter{\next}%IW*eUUcanthenextractjustthe rstcharacterE205]\edef\answer{\expandafter\f@rst\answer.}%ITheUUwedeterminewhetherit'stheletter`y'or`n'...E206]\if\answery\else\if\answern\elseIIfthehvisible[i(K*parameterisn'teitherofthese,weasktheusertogiveusananswer!E207f\typein[\answer]{Makeanswersvisible?[Y/N]:}\fi E208]\fiIOK,T\answernowcontainssomerespGonse;Tlet'supper-caseitandextractjustits I rstUUcharacterE209]\edef\next{\def\noexpand\answer{\answer}}% E210]\uppercase\expandafter{\next}%E211]\edef\answer{\expandafter\f@rst\answer.}%E212S}15TsoI3.4gSettingtheGriduT3P\letterIThisZistheexpansionwhichisused(for\letterinsquare,andwithintheexpan- Isionof\numberedsquare)whenthegridisactuallybGeingtyp}'eset[fromthestoredIsquares'UUmacros.E213S\def\letter#1{{\put(\Across,-\Down){\makebox(1,1){\sffamily#1}}}}f\numberedsquareIThise3macroisused(for\numbersquare)whenthelightsarebGeingdrawnwithlightInumbGeringJenabled.nBItputsthenumberJ(andtheletteroftheanswertoo,Ldepen-IdingzupGonthede nitionof\letterwhichiscurrent)atthecurrentcoGordinateIpGositionUUspeci edby(\Across,\Down).E214S\def\numberedsquare#1#2{% E215]\put(\Across,-\Down){%XT*oinsertthecluenumbGer,fwegenerateitwithinasub-picture,ofsizeequaltoIoneUUsquare.E216f\begin{picture}(1,1)(0,0)XW*eAstickthenumbGerinthetop-leftcornerofan(invisible)bGoxwhich llstheIcentralUU81%ofthearea.E217p2\put(0.05,0.05){\makebox(0.9,0.9)[tl]{\tiny#1}} E218f\end{picture}%E219]}XW*ealsosettheletterinthesquare(depGendinguponthede nitionof\letter IwhichUUapplies.E220]\letter{#2}}t\unnumberedsquareIDespiteMitsname,thismacroisinvokedM(through\numbersquare)forthosesquaresIwhich}wouldordinarilycarryalight'snumbGer,*wereitnotforthefactthattheInumbGersUUhavebGeensuppressedbythecrossword*environment.XIt[justdiscardsthehclueffnumb}'eriFpgiveninthe rstparameterandsetstheIcurrentUUletterbyinvoking\letter,whichusesthesecondparameter...E221S\def\unnumberedsquare#1{\letter} L\FinishGridINow4wecanproGcessallthestoredmacroswhichde netheappGearanceofeachIsquare minthegrid,8andthusgeneratetheprintedversionthereof,8usingL5ffA͉TU>'ExX'sIpictureUUenvironment.XThisdScommandmakesappropriaterede nitionsofsomemacroswhichproGducedIdi erentUUe ectsduringthe llingofthegrid.E222S\def\FinishGrid{%XIfthecustomerdoGesn'twantthelettersputintothegrid,thenweneedonlyIthrowUUawayanyparametertoletter.E223]\if\answerY\else\let\letter=\@gobble\fiXAsstatedintheintroGduction,HwhentypGesettingthegridinasmallerver-Ision,& there^isinsucientspacetoincludethenumbGersforthelights;ObytestingI\ifnumberitMwecandeterminewhetheramacrowhichexpandsto\numbersquareIshallUUresultinanumbGerUUbeingprintedornot.E224]\ifnumberit E225f\let\numbersquare=\numberedsquare16ެsoE226]\else E227f\let\numbersquare=\unnumberedsquareE228]\fiXAnything*that'sbGeenstoredasa\lettersquareis\set"usingthe\letter ImacroUU(whichwemighthavejust\letequalto\@gobble).E229]\let\lettersquare=\letterb\blacksquareIAny6blacksquaresthatarestillleftinthegridaresetbymeansofthiscommand:E230]\def\blacksquare{%XTheUUblacksquareitselfismerelyaruleoftheappropriatedimensions.E231f\put(\Across,-\Down){\rule{\unitlength}{\unitlength}}}XNowUUwecometotheactualbGodyof\FinishGrid. XW*eUUstarto atthebGottom-mostrowofthegrid...E232]\Down=\gr@dsizeXThe)wholegridiscreatedinacentered\hboxinapictureenvironment.BBy Io settingtheoriginnegatively*,$@wecanaddresseachrowbysimplynegatingtheyIcoGordinate;UUthuscolumnxinthehighestrowis(x;1).E233]\centerline{% E234f\begin{picture}(\p@csize,\p@csize)(1,-\p@csize)XW*e?~nowcyclethrougheachoftherows.+The rstthingweoutputisahorizontalIruleofthefullwidthofthegrid,VonesuchrulebGeinggeneratedforeachrowofItheUUgrid,providingthehorizontallinesacrossverticallights.E235f\loop\ifnum\Down>\z@ E236p2\put(1,-\Down){\line(1,0){\the\gr@dsize}}XNowweareabGouttocycleacrossallthecolumnsofthecurrentrow;GXagain,Iit'sUUconvenientforustoworkbackwardstotheleft...E237p2\Across=\gr@dsizeXT*o&dothisweneedaninnerloGop;63thishastobeinsideagroupsoastoisolateItheUUe ectsofits\repeatcommand.E238p2{\loop\ifnum\Across>\z@XT*o6settheappropriateob8jectinthissquare,pwemerelyinvokethemacrowhichIhasWcbGeenassociatedwiththesquare.wThuswe'llendupwithablacksquare,WoraInumbGeredUUorplainsquare,thelattertwoUUofwhichmayalsocontainaletter.E239~0\csname\ther@w\thec@l\endcsnameXNowweadvqancetothenextcolumnanditerate.'That'stheendoftheinnerIloGopUUforeachofthecolumnsofthecurrentrow.E240~0\advance\Acrossby\m@ne E241t\repeatE242p2}%XNowUUwecandecrementdowntothenextrowanditeratethroughtherows.E243p2\advance\Downby\m@neE244f\repeat17랠soXW*e'vesofardrawnahorizontallineunder2eachoftherows; thenext\put IdrawsUUa nallineab}'ovethetop-mostrow.E245f\put(1,0){\line(1,0){\the\gr@dsize}}XSimilarly*,\.aZshortloGopcandrawverticalrulesattheleft-handedgeofeachofIthecolumns,startingwithalineontheleftofanimaginarycolumntotherightIof thewholegrid,whichwillthereforeformalinetotherightofthe nalcolumn.E246f\Across=\p@csize E247f\loop\ifnum\Across>\z@E248p2\put(\Across,0){\line(0,-1){\the\gr@dsize}}E249p2\advance\Acrossby\m@neE250f\repeatXAndUUthatcompletesthepicture.E251f\end{picture}%E252]}%E253S}E254Sh(5" cmmi9=pack9age#g iXFinally*,UUhere'stheinputwhichproGducedthecrosswordin gure1eY\begin{crossword}{15}{N} sF\input{grid-1}eY\end{crossword}E255Shgrid0HiE256S\clue{1}{A}{3}{1}{PERAMBULATOR}{Strollercarryingthebaby}{12}E257S\clue{8}{A}{1}{3}{IMPASSE}{EasternnotereturnedaboutpredicamentresultingE258=indeadlock}{7}E259S\clue{9}{A}{9}{3}{TERMINI}{Manyendsbroughtbackinoneminutesoak}{7}E260S\clue{11}{A}{1}{5}{TIEPOLO}{VenetianpaintertodrawSpanishgipsydance?}{7}E261S\clue{12}{A}{9}{5}{ARAMAIC}{SemiticlanguageofoneinchargeoffollowingaE262sheep}{7}E263S\clue{13}{A}{1}{7}{ENSUE}{Followthreedirectionsandbendeastward}{5}E264S\clue{14}{A}{7}{7}{IMPLETION}{Fillingfeeble-mindedpersonwholosthisheadE265jBaboutone}{9}E266S\clue{16}{A}{1}{9}{SURPRISED}{Ripapartwithduresstakenunawares}{9}E267S\clue{19}{A}{11}{9}{DUNCE}{Stupidpersonfromhillchurch}{5}E268S\clue{21}{A}{1}{11}{ERRATUM}{Publishedcorrection---returnwalled-upE269ܰsailor}{7}E270S\clue{23}{A}{9}{11}{LIASSIC}{LowerJurassicseatripbackwards[thus]}{7}E271S\clue{24}{A}{1}{13}{SABBATH}{MidnightmeetingofwitchesathospitalonrestE272ܰday?}{7}E273S\clue{25}{A}{9}{13}{ISOTRON}{Sortionwithanaccelerator?}{7}E274S\clue{26}{A}{2}{15}{STANDINGROOM}{SubstitutehusbandrelegatedhereatE275Pcrowdedwedding}{8-4}E276S\clue{1}{D}{3}{1}{PEPPERS}{Showersbandwithlonelyhearts?}{7}E277S\clue{2}{D}{5}{1}{RESTORE}{Concerningmoneysaved---reinstatetoformerE278=owner}{7}E279S\clue{3}{D}{7}{1}{MNEMONICS}{No-oneinhigherdegreeproducesmemoryE280ܰjoggers}{9}E281S\clue{4}{D}{9}{1}{ULTRA}{EnigmaticsecretofWW\,I\kern-.1emI?}{5}E282S\clue{5}{D}{11}{1}{ACREAGE}{Currentabouttimeflowsovermeasuredarea}{7}18soE283S\clue{6}{D}{13}{1}{ORIGAMI}{Maybemagicendlesslyraisedbeforeonewith E284Japaneseartisticskill}{7}E285S\clue{7}{D}{1}{2}{LISTLESSNESS}{EnrollfeweroncebeforeheadsufferingaE286nlanguidmalaise}{12}E287S\clue{10}{D}{15}{3}{INCANDESCENT}{White-hotPeruvianreorganizedobjectsE288Pcoveringsmallcoin}{12}E289S\clue{15}{D}{9}{7}{PEDALLING}{PennyledarearrangedfishengagingincyclicE290jBactivity!}{9}E291S\clue{17}{D}{3}{9}{RAREBIT}{Welshtoast?Anunusualdrill!}{7}E292S\clue{18}{D}{5}{9}{RETRAIN}{Keepinmind,takein,andacquirenewE293skills}{7}E294S\clue{19}{D}{11}{9}{DIABOLO}{Twiceahighballthrownuproundatwo-headedE295ܰtop}{7}E296S\clue{20}{D}{13}{9}{NOSTRUM}{Nogoodmanwithspiritoffersquackremedy}{7}E297S\clue{22}{D}{7}{11}{MAHDI}{Iwouldshortlyoveract,sentup,andtheE298=downfallofGordon}{5}E299Sh=grid0HiE300Shgrid1HiE301S\clue{8}{A}{1}{2}{SWAM}{Pointsathousandtestedforwitchcraft.}{4}E302S\clue{9}{A}{6}{2}{OHO}{Gourmet'striumphantcryonfindingmiddle-cutE303W(Pacificsalmon!}{3}E304S\clue{10}{A}{10}{2}{ICECAP}{OnehundredstridebackwardsacrossaE305Pole.}{3-3}E306S\clue{11}{A}{1}{4}{BOPEEP}{Fifties'jazzrecordaboutEasternchilds'E307=play.}{2-4}E308S\clue{12}{A}{8}{4}{SCHEDULE}{TimetablecreatedbyeditorinsynagogueE309ܰofSpain.}{8}E310S\clue{13}{A}{1}{6}{THALASSOGRAPHER}{ThedialectagirlmixeduptangleE311aroundsymbolicdiagramusedbyE312maritimestudent!}{15}E313S\clue{15}{A}{1}{8}{HAIRPIN}{Wirefasteningbentroadnarrowly.}{7}E314S\clue{17}{A}{9}{8}{UMBRAGE}{HammerheadconsumesGermancompanyE315andcastsashade.}{7}E316S\clue{20}{A}{1}{10}{SCALENETRIANGLE}{StrangecelalienchopstomakeaE317}\figurewithoddsides.}{7,8}E318S\clue{23}{A}{1}{12}{AMOUNTED}{SoundslikeahoarseeditorcametoinE319jBtotal!}{8}E320S\clue{25}{A}{10}{12}{ALLEGE}{Assertwithoutproofeveryone,forE321ܰexample,English.}{6}E322S\clue{26}{A}{1}{14}{FLORAL}{Flourishedexaminationofflowers.}{6}E323S\clue{27}{A}{8}{14}{NIL}{FloorcoveringdiscardsfumingsulphuricacidE324Tandreturnstonothing.}{3}E325S\clue{28}{A}{12}{14}{TACE}{``Latinforacandle''tobesilentnoteE326=aboutaircraftman?}{4}E327S\clue{1}{D}{2}{1}{SWOOSH}{Waterrushnoisedisturbsshowso!}{6}E328S\clue{2}{D}{4}{1}{IMPELLER}{MischievouschildwithclothmeasureE329hesitatestoassemblerotor.}{8}E330S\clue{3}{D}{6}{1}{COMPASSIONATELY}{MercifullyinclinedtopassroundE331 0ten?Nay,aboutshortblower!}{15}E332S\clue{4}{D}{8}{1}{TORSION}{Sortion?AnisotrongivesitanewE333=twist!}{7}E334S\clue{5}{D}{10}{1}{DITHYRAMBICALLY}{WildlyandboisterouslyrearrangeE335BillyMayThird,roughly.}{15}E336S\clue{6}{D}{12}{1}{SENDUP}{Satiricalbookorfilm---giveoddsabout19lsoE337=revisionof``Dune''?}{4-2} E338S\clue{7{\noexpand\rm\&}24}{D}{14}{1}{PALL}{PremiertookinaLordE339LieutenantandallplayedanE340oldgameinLondonstreet.}{4-4}E341S\clue{14}{D}{14}{6}{ERG}{Workexpendedinpowergames?}{3}E342S\clue{16}{D}{2}{8}{ARC}{Achurchcircle(orpartofone).}{3}E343S\clue{18}{D}{12}{8}{RINGLETS}{EncirclehindrancesunderhairinlongE344jBcurls.}{8}E345S\clue{19}{D}{8}{9}{STUDENT}{Bossoveroto\-rhino\-laryng\-o\-logyE346departmentundergraduate.}{7}E347S\clue{21}{D}{4}{10}{LOUVRE}{OlddovecoteinParisianmuseum.}{6}E348S\clue{22}{D}{14}{10}{LEGACY}{Likeornamentalfabric,forexample,E349ܰthat'sinbequest.}{6}E350S\clue{24}{D}{2}{12}{MALL}{}{See{\bf7}}E351Sh=grid1HiE352Shexa0iE353S\documentclass{article}E354S\usepackage{crosswrd}E355S\pagestyle{empty}E356S\setlength\topmargin{-1in}E357S\setlength\textheight{10.7in}E358E359S\begin{document}E360f\begin{crossword}{15}{?}E361f\input{grid0}E362f\end{crossword}E363S\end{document}E364Sh=exa0iE365Shexa1iE366S\documentclass{article}E367S\usepackage{crosswrd}E368S\pagestyle{empty}E369S\setlength\topmargin{-1in}E370S\setlength\textheight{10.7in}E371S\begin{document}E372f\section*{ASampleCrossword}E373f\textit{(Chamber'sTwentiethCenturydictionary)}E374f\begin{crossword}{15}{?}E375p2\input{grid1}E376f\end{crossword}E377f\begin{crossword*}{15}{Solutiontogrid0}E378p2\input{grid0}E379f\end{crossword*}E380S\end{document}E381Sh=exa1i20;/#fcmti8.߆T cmtt12) cmsy9(5" cmmi9'N cmbx12&Cscmtt8%F C cmbxti10$m#R cmss10#': cmti10"ߤN cmtt9!p0J cmsl10 cmmi10K`y cmr10ٓRcmr7Zcmr5y