÷ƒ’À;è TeX output 1996.10.01:1331‹ÿÿÿÿ ª ýs o ýÞ‘lm óDÓítG®G®cmr17¹ProsŽduction–7tof“solution“sheets“in“LŸüdú‘úKGóX«Q cmr12ºAŽŽ‘¹”¹T‘ý[™Ÿ¸-EŽ‘;gX‘`œ2Ÿ—Œó·ág£G® cmmi12»"ŽŽŽŸ’™RdºCop•¬ryrigh“t–ê¨(C)“1994,1995“bš¬ry“Mik˜e“Pi ŽŽŽŽŽŸˆ‹’щãOctobSŽer–ê¨1,“1996ŽŸ+Ä‘IóÂÖN ff cmbx12ÆCon•ŒÌten“tsŽ©!Ä‘I1Ž‘aLËInŒÌtros3ductionŽŸç‘IóKñ`y cmr10²This–ïÕpacš¸ãk‘ÿqÇage“is“a“moGdi cation“of“the“author's“previous“st˜yle“option“óßêŸ'EŽ‘ãxXb˜o˜ok“ideaŽ¡‘Iof–Š¨binding“solutions“to“exercises.‘ÁI‘Ššha•¸ãv“e›Š¨tak“en˜the˜oppGortunit“y˜with˜this˜revisionŽ¡‘Ito–¸¯alter“the“format“of“the“solutions,‘…so“that“they“are“noš¸ãw“presen˜ted“as“LŸýó5‘üffóÙ“ Rcmr7±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxXŽ¡‘Ien•¸ãvironmen“ts–8àrather“than“bGeing“started“with“a“command“and“ended“with“the“endŽ¡‘Iof–UUthe“surrounding“en•¸ãvironmen“t,–UUa“wholly“un-LŸýó5‘üff±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxXy“w•¸ãa“y–UUof“doing“things!Ž¡‘XThe–ƒŒother“main“cš¸ãhange“is“that“sev˜eral“ le“handles“are“allo˜w˜ed“to“bGe“activ˜e“atŽ¡‘Ionce.‘]TThis–ýallo¸ãws“some“solutions“in“a“b•Go“ok–ý(for“instance)“to“go“to“the“appGendices,Ž¡‘Iand–Àsome“to“go“to“a“separate“ le,‘xto“bGe“prinš¸ãted“and“handed“to“the“studen˜ts“as“theŽ¡‘Icourse›õ.progresses.‘QºMoreo•¸ãv“er,‘ithe˜actual˜ph“ysical˜ les˜opGened˜with˜eac“h˜ le˜handleŽ¡‘Ican–iHnoš¸ãw“bGe“v‘ÿqÇaried“in“the“same“job,‘®Eallo˜wing“man˜y“di eren˜t“ les“to“bGe“createdŽ¡‘Iaccording–ÕÈto“the“same“format.‘óTh¸ãus,›õäfor“instance,˜eacš¸ãh“c˜hapter“of“a“b•Go“ok‘ÕÈcouldŽ¡‘Icreate–èëits“oš¸ãwn“solution“ le,‘ Ñallo˜wing“the“user“to“use“Ç\include“²on“bGoth“c˜haptersŽ¡‘Iand‘UUsolutions.Ž¡‘XFinally‘ÿ*ª,‘‚an•¸ãy›y#n“um“bGer˜of˜solution-t“ypGes˜ma“y˜no“w˜b•Ge˜b“ound˜to˜an¸ãy˜ le,‘‚not˜justŽ¡‘Ithe›Ñt•¸ãw“o˜old˜ones,‘ìsolution˜and˜hin“t.‘VñThe˜format˜of˜eac“h˜solution˜t“ypGe˜is˜under˜theŽ¡‘Icomplete–UUcon¸ãtrol“of“the“user.Ž¦‘IÆ2Ž‘aLËThe–ffdos3cumenšŒÌtation“driv˜er“ leŽŸç‘I²This– ¨is“the“driv¸ãer“ le“that“prošGduces“this“do˜cumen¸ãtation.‘‘¿W‘ÿ*ªe“use“the“do˜cumen¸ãtŽ¡‘Iclass–UUproš¸ãvided“b˜y“the“LŸýó5‘üff±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxX‘ü2Ÿÿó  b> cmmi10µ"ŽŽ‘+þT²distribution“for“prošGducing“the“do˜cumen¸ãtation.ŽŸ‘Lüs±1Ž‘Sª®ó ©±Ê cmsy9Ëhó!ÒoÇw cmss9ÌdriverŽ‘oËiŽ¤ ‘Lüs±2Ž‘Sª®óߤN cmtt9È\documentclass{ltxdoc}Ž¡‘Lüs±3Ž‘Sª®È\RecordChangesŽ¡‘Lüs±4Ž‘Sª®È\begin{document}Ž¡‘Lüs±5Ž‘]ÚÈ\DocInput{answers.dtx}Ž¡‘Lüs±6Ž‘]ÚÈ\PrintIndexŽ¡‘Lüs±7Ž‘]ÚÈ\PrintChangesŽ¡‘Lüs±8Ž‘Sª®È\end{document}Ž¡‘Lüs±9Ž‘Sª®Ëhó5ùž" cmmi9Ê=ÌdriverŽ‘oËiŽŽŸ’ø²1ŽŽŒ‹* ª ýs o ý´‘IÆ3Ž‘aLËUser‘ffinŒÌterfaceŽŸç‘I²The–UUpac¸ãk‘ÿqÇage“needs“to“bGe“included“with“the“commandŽ©(!’†lžÈ\usepackage[nosolutionfiles]{answers}ŽŸ Ÿ(!‘I²If–­ÿthe“optional“argumenš¸ãt“is“giv˜en,‘Ïwsolutions“appšGear“at“that“p˜oin¸ãt“in“the“text,‘ÏwratherŽ¤ ‘Ithan–ùbbGeing“written“to“external“ les.‘]ïThis“alloš¸ãws“a“demonstrator's“v˜ersion“to“bGeŽ¡‘IproGduced.Ž¡‘XAfter–UUthat,“there“should“bGe“sev¸ãeral“declarations“of“the“formŽ‘÷ 6È\NewassociationŽŽŽŽ¦‘nÌ°\Newassociation{xxx}{yyy}{zzz}ŽŸ Ÿ(!‘I²where–…Çxxx“²is“an“en•¸ãvironmen“t–…in“the“doGcumenš¸ãt,‘‘and“Çyyy“²is“an“en˜vironmen˜t“whic˜hŽ¡‘Iwill–®7surround“the“con•¸ãten“ts–®7of“Çxxx“²when“it“is“written“to“sym¸ãbGolic“ le“handle“Çzzz².Ž¡‘IThe–ónames“Çxxx²,›€Çyyy“²and“Çzzz“²should“consist“of“letters“only‘ÿ*ª,˜not“n•¸ãum“bGers,˜punc-Ž¡‘Ituation–UUor“spaces.Ž¡‘XBy–>`default,‘ø¢output“will“go“to“Çzzz.tex“²if“Çzzz“²is“opGen.‘ ,éThe“commandŽ‘èótÈ\solutionextensionŽŽŽŽ¡‘IÇ\solutionextension–n=²can“bGe“rede ned“to“c¸ãhange“Çtex“²to“some“other“extension.Ž¡‘IAlternativš¸ãely‘ÿ*ª,‘…‚the–H­output“ lename“can“bGe“c˜hanged“as“an“optional“parameter“toŽ¡‘IÇ\Opensolutionfile²,‘ï!and–Ð_eac¸ãh“Ç\Opensolutionfile“²on“the“same“handle“can“useŽ¡‘Ia–UUdi erenš¸ãt“ph˜ysical“ le.Ž¡‘XAš¸ãt–UUsome“pGoin˜t“the“user“t˜ypGesŽ‘í­ È\OpensolutionfileŽŽŽŽ¡‘èót\ClosesolutionfileŽŽŽŽ¦‘nÌ°\Opensolutionfile{zzz}Ž¤ ‘nÌ°...Ž¡‘nÌ°\Closesolutionfile{zzz}Ž¡Ÿ(!‘I²to–þcreate“a“ le“of“solutions“written“bš¸ãy“en˜vironmen˜ts“Çxxx“²to“en˜vironmen˜ts“Çyyy².Ž¤ ‘IIf–u†this“construction“is“used“sevš¸ãeral“times,‘½’then“sev˜eral“ les“of“solutions“will“bGeŽ¡‘Icreated.‘ GThe–ñÅuser“maš¸ãy“wish“these“ les“to“ha˜v˜e“di eren˜t“names.‘ GIf“the“formŽ¡‘IÇ\Opensolutionfile{zzz}[www]²,‘ õthen–úÝÇwww.tex“²is“used“as“actual“ le“output“nameŽ¡‘Irather–©than“Çzzz.tex².‘8XThis“alloš¸ãws“ le“handle“Çzzz“²to“create“man˜y“ les“Çwww.tex²,‘Ë~sa˜yŽ¡‘Ione–±Tfor“eacš¸ãh“c˜hapter“of“a“b•Go“ok,‘Ò!or–±Tone“for“eac˜h“problem“sheet.‘;These“could“then“bGeŽ¡‘IproGcessed–§using“Ç\include“²commands.‘[âThe“same“v‘ÿqÇalue“of“Ç\solutionextension“²isŽ¡‘Iused–†'for“the“optional“argumenš¸ãt“as“for“the“main“argumen˜t.‘>The“name“Çwww“²shouldŽ¡‘Ifolloš¸ãw–UUthe“usual“ le“naming“con˜v˜en˜tions.Ž¡‘XIn–8ãaddition,‘qÇmaterial“can“bGe“written“directly“to“a“ le“b¸ãy“means“of“Ç\Writetofile².Ž‘LøÈ\WritetofileŽŽŽŽ¡‘I²Its–!à rst“argumen¸ãt“is“the“ le“handle“Çzzz“²and“its“second“is“the“line“of“text“to“bGeŽ¡‘Iwritten.‘_It–¤ois“most“impGortanš¸ãt“to“remem˜bGer“that“an˜y“con˜trol“w˜ords“in“the“line“toŽ¡‘IbšGe–E‹written“should“b˜e“preceded“bš¸ãy“Ç\protect²,‘H³otherwise“the“primitiv˜e“T‘þU>Ÿ'EŽ‘ãxX“Ç\writeŽ¡‘I²command–Q"will“expand“them.‘e-Also,‘as“the“argumenš¸ãt“is“read“in“T‘þU>Ÿ'EŽ‘ãxX'“usual“w˜a˜yŽ¡‘Ib•Gefore›Þæb“eing˜written,‘Jan•¸ãy˜trailing˜spaces˜after˜a˜con“trol˜w“ord˜will˜disappGear˜un-Ž¡‘Iless–¤3precautions“are“tak•¸ãen.‘^aTh“us,›·êto–¤3write“Ç\xx‘?ýyyy“²to“the“ le,˜the“user“can“t¸ãypGeŽ¡‘IÇ\protect\xx\space‘?ýyyy².Ž¡‘XAlternativš¸ãely‘ÿ*ª,–UUa“bloGc˜k“of“text“can“bGe“sa˜v˜ed“to“ le“handle“Çzzz“²b˜y“means“ofŽ‘3PÈFilesaveŽŽŽŽ¦‘nÌ°\begin{Filesave}{zzz}Ž¤ ‘|ùr....Ž¡‘nÌ°\end{Filesave}Ž¡ŽŸ’ø²2ŽŽŒ‹ u ª ýs o ý´‘I²around–s:it“once,‘ sÇzzz“²has“bšGeen“op˜ened.‘&iThe“restrictions“that“apply“to“Ç\WritetofileŽ¤ ‘I²abGo•¸ãv“e–UUdo“not“apply“to“this“en•¸ãvironmen“t.Ž¡‘XOne–UUof“the“generated“ les“can“bGe“read“usingŽ‘í­ È\ReadsolutionfileŽŽŽŽŸë‘nÌ°\Readsolutionfile{zzz}Ž© Ÿë‘I²pro¸ãvided–ÿthe“ le“has“not“bšGeen“closed“and“re-op˜ened.‘UAlternativ¸ãely‘ÿ*ª,‘Fsimply“Ç\inputŽ¡‘I²or–UUÇ\include“²it“if“preferred.Ž¡‘XNone–ù[of“the“ le“opGerations“should“ha•¸ãv“e›ù[an“y˜e ect˜if˜the˜ le˜handle˜Çzzz˜²has˜notŽ¡‘Ib•Geen›UUop“ened,˜or˜if˜Çnosolutionfiles˜²is˜sp“eci ed.Ž¤ r‘IÆ4Ž‘aLËA–ffsimple“exampleŽŸç‘I²Here–UUis“a“straigh•¸ãtforw“ard–UUexample“to“illustrate“ho¸ãw“these“macros“are“used.ŽŸ F{‘I±10Ž‘Sª®ËhÌex1Ž‘ŸøËiŽ¦‘I±11Ž‘Sª®È\documentclass[12pt,a4paper]{article}Ž¦‘I±12Ž‘Sª®È\usepackage{answers}Ž¦‘I±13Ž‘Sª®È\Newassociation{sol}{Solution}{ans}Ž¦‘I±14Ž‘Sª®È\newtheorem{ex}{Exercise}Ž¦‘I±15Ž‘Sª®È\begin{document}Ž¦‘I±16Ž‘Sª®È\Opensolutionfile{ans}[ans1]Ž¦‘I±17Ž‘Sª®È\section{Problems}Ž¦‘I±18Ž‘Sª®È\begin{ex}Ž¦‘I±19Ž‘a×pÈFirst‘¹–exerciseŽ¦‘I±20Ž‘a×pÈ\begin{sol}Ž¦‘I±21Ž‘p2ÈFirst‘¹–solution.Ž¦‘I±22Ž‘a×pÈ\end{sol}Ž¦‘I±23Ž‘Sª®È\end{ex}Ž¦‘I±24Ž‘Sª®È\begin{ex}Ž¦‘I±25Ž‘a×pÈSecond‘¹–exerciseŽ¦‘I±26Ž‘a×pÈ\begin{sol}Ž¦‘I±27Ž‘p2ÈSecond‘¹–solution.Ž¦‘I±28Ž‘a×pÈ\end{sol}Ž¦‘I±29Ž‘Sª®È\end{ex}Ž¦‘I±30Ž‘Sª®È\Closesolutionfile{ans}Ž¦‘I±31Ž‘Sª®È\section{Solutions}Ž¦‘I±32Ž‘Sª®È\input{ans1}Ž¦‘I±33Ž‘Sª®È\end{document}Ž¦‘I±34Ž‘Sª®ËhÊ=Ìex1Ž‘ŸøËiŽ¡‘IÆ5Ž‘aLËA–ffcomplicated“exampleŽŸç‘I²The–0ïfolloš¸ãwing“is“an“(o˜v˜er-complicated)“example“of“the“use“of“pac˜k‘ÿqÇage“Çanswers².‘e¥ItŽ¤ ‘Iuses–UUsome“of“the“re nemen¸ãts“describGed“later.ŽŸ F{‘I±35Ž‘Sª®ËhÌex2Ž‘ŸøËiŽ¦‘I±36Ž‘Sª®È\documentclass[12pt,a4paper]{article}Ž¦‘I±37Ž‘Sª®È\usepackage{answers}%\usepackage[nosolutionfiles]{answers}ŽŸF{‘I²First–yøan“en•¸ãvironmen“t›yøwhic“h˜con“tains˜problems˜and˜n“um“bGers˜them.‘ß±This˜is˜basedŽ¡‘Ion–UUa“LŸýó5‘üff±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxX“theorem,“but“with“a“roman“b•Go“dy–UUrather“than“italic.ŽŸ F{‘I±38Ž‘Sª®È\newtheorem{Exc}{Exercise}Ž¦‘I±39Ž‘Sª®È\newenvironment{Ex}{\begin{Exc}\normalfont}{\end{Exc}}ŽŽŸ’ø²3ŽŽŒ‹ÿ ª ýs o ý´‘I²Three–N±sorts“of“solution“are“written“to“t•¸ãw“o›N±di eren“t˜ les.‘]ÚFile˜handle˜Çtest˜²willŽ¤ ‘Iconš¸ãtain–ß‘the“solutions“and“hin˜ts“that“the“studen˜ts“will“see;‘$°Çtesttwo“²con˜tains“theŽ¡‘Isolutions–»to“the“problems“whicš¸ãh“they“will“probably“hand“in,‘*sand“so“these“m˜ust“bGeŽ¡‘Iformatted‘UUseparately‘ÿ*ª.Ž©‘I±40Ž‘Sª®È\Newassociation{solution}{Soln}{test}Ž¤ ‘I±41Ž‘Sª®È\Newassociation{hint}{Hint}{test}Ž¡‘I±42Ž‘Sª®È\Newassociation{Solution}{sSol}{testtwo}ŽŸ‘I²Because–½õwš¸ãe“w˜an˜t“to“mark“di eren˜t“t˜ypGes“of“problem“in“the“master“ le“of“problems,ŽŸ ‘Iwš¸ãe–UUde ne“the“follo˜wing.Ž¦‘I±43Ž‘Sª®È\newcommand{\prehint}{~[Hint]}Ž¡‘I±44Ž‘Sª®È\newcommand{\presolution}{~[Solution]}Ž¡‘I±45Ž‘Sª®È\newcommand{\preSolution}{~[Homework]}ŽŸ‘I²W‘ÿ*ªe–$Þproš¸ãvide“an“extra“parameter“when“w˜e“opšGen“ le“handle“Çtest²;‘Œ¢this“is“b˜ecauseŽ¤ ‘Iw•¸ãe›N8w“an“t˜to˜write˜a˜Ç\section˜²command˜to˜the˜solution˜ le.‘\qThis˜is˜merely˜anŽ¡‘Iillustration–UUhere,“but“wš¸ãould“bGe“more“relev‘ÿqÇan˜t“if“the“solution“ le“w˜ere“Ç\include²d.Ž¦‘I±46Ž‘Sª®È\newcommand{\Opentesthook}[2]%ŽŸ ‘I±47Ž‘a×pÈ{\Writetofile{#1}{\protect\section{#1:‘¹–#2}}}ŽŸ‘I²The–uedefault“text“proGduced“when“LŸýó5‘üff±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxXmeets“the“solution“en•¸ãvironmen“ts–ueis“hereŽ¡‘ImoGdi ed.Ž¦‘I±48Ž‘Sª®È\renewcommand{\Solnlabel}[1]{\emph{Solution‘¹–#1}}Ž¤ ‘I±49Ž‘Sª®È\renewcommand{\Hintlabel}[1]{\emph{Hint‘¹–#1}}Ž¡‘I±50Ž‘Sª®È\renewcommand{\sSollabel}[1]{\emph{Solution–¹–to“#1}}Ž¡‘I±51ŽŽ¡‘I52Ž‘Sª®È\begin{document}Ž¤‘I²W‘ÿ*ªe–UUopGen“handle“Çtest“²as“actual“ le“Çtest1.tex²,Ž¦‘I±53Ž‘a×pÈ\Opensolutionfile{test}[ans2]{Solutions}Ž¡‘I²and–UUwrite“some“text“on“it.Ž¦‘I±54Ž‘a×pÈ\Writetofile{test}{\protect\subsection{Some‘¹–Solutions}}Ž¡‘I²Handle–UUÇtesttwo“²is“opGened“as“Çtesttwo.tex².Ž¦‘I±55Ž‘a×pÈ\Opensolutionfile{testtwo}[ans2x]Ž¤ ‘I±56Ž‘a×pÈ\Writetofile{testtwo}{%Ž¡‘I±57Ž‘p2È\protect\subsection{Extra‘¹–Solutions}}ŽŸ‘I²No¸ãw–UUthe“problems.Ž¦‘I±58Ž‘a×pÈ\section{Exercises}Ž¡‘I±59Ž‘a×pÈ\begin{Ex}Ž¡‘I±60Ž‘p2ÈAn–¹–exercise“with“a“solution.Ž¡‘I±61Ž‘p2È\begin{solution}Ž¡‘I±62Ž‘~0ôÈThis–¹–is“a“solution.Ž¡‘I±63Ž‘~0ôÈ\relax{}Ž¡‘I±64Ž‘p2È\end{solution}Ž¡‘I±65Ž‘a×pÈ\end{Ex}Ž¡‘I±66Ž‘a×pÈ\begin{Ex}Ž¡‘I±67Ž‘p2ÈAn–¹–exercise“with“a“hint“and“a“secret“solution.Ž¡‘I±68Ž‘p2È\begin{hint}Ž¡‘I±69Ž‘~0ôÈThis–¹–is“a“hint.Ž¡‘I±70Ž‘p2È\end{hint}Ž¡‘I±71Ž‘p2È\begin{Solution}Ž¡‘I±72Ž‘~0ôÈThis–¹–is“a“secret“solution.Ž¡‘I±73Ž‘p2È\end{Solution}ŽŽŸ’ø²4ŽŽŒ‹"S ª ýs o ý´‘I±74Ž‘a×pÈ\end{Ex}Ž¤ ‘I±75Ž‘a×pÈ\begin{Ex}Ž¡‘I±76Ž‘p2ÈAn–¹–exercise“with“a“hint.Ž¡‘I±77Ž‘p2È\begin{hint}Ž¡‘I±78Ž‘~0ôÈThis–¹–is“a“hint.Ž¡‘I±79Ž‘p2È\end{hint}Ž¡‘I±80Ž‘a×pÈ\end{Ex}ŽŸ‘I²W›ÿ*ªe–ø_close“the“t•¸ãw“o–ø_solution“ les“and“immediately“input“their“con•¸ãten“ts.‘ZäW˜e‘ø_couldŽ© ‘Iha•¸ãv“e–UUused“Ç\include“²here.ŽŸ‘I±81Ž‘a×pÈ\Closesolutionfile{test}Ž¡‘I±82Ž‘a×pÈ\Readsolutionfile{test}Ž¡‘I±83Ž‘a×pÈ\clearpageŽ¡‘I±84Ž‘a×pÈ\Closesolutionfile{testtwo}Ž¡‘I±85Ž‘a×pÈ\Readsolutionfile{testtwo}Ž¡‘I±86Ž‘Sª®È\end{document}Ž¡‘I±87Ž‘Sª®ËhÊ=Ìex2Ž‘ŸøËiŽŸ!Ä‘IÆ6Ž‘aLËA–fffurther“exampleŽŸç‘I²Here–%“is“an“example“suggested“to“the“author“b¸ãy“Martin“OsbGorne“to“a“situation“notŽ¦‘Ioriginally–ùãenš¸ãvisaged.‘SLHere,‘ -the“exercises“and“solutions“are“not“n˜um˜bGered;‘_they“areŽ¦‘Ió&ý': cmti10Ñdescrib–ÿ}'e“d².ŽŸ‘I±88Ž‘Sª®ËhÌex3Ž‘ŸøËiŽ¡‘I±89Ž‘Sª®È\documentclass[12pt,a4paper]{article}Ž¡‘I±90Ž‘Sª®È\usepackage{answers}Ž¡‘I±91Ž‘Sª®È\newenvironment{Ex}[1]{\begin{trivlist}\item–¹–\emph{#1}“%Ž¡‘I±92Ž‘a×pÈ\renewcommand{\Currentlabel}{#1}}{\end{trivlist}}Ž¡‘I±93Ž‘Sª®È\Newassociation{solution}{Soln}{solutions}Ž¡‘I±94ŽŽ¡‘I95Ž‘Sª®È\renewenvironment{Soln}[1]{\begin{trivlist}\itemŽ¡‘I±96Ž‘a×pÈSolution–¹–to“\emph{#1}“}{\end{trivlist}}Ž¡‘I±97ŽŽ¡‘I98Ž‘Sª®È\begin{document}Ž¡‘I±99Ž‘Sª®È\section*{Problems}Ž¡‘E±100Ž‘a×pÈ\Opensolutionfile{solutions}[ans3]Ž¡‘E±101Ž‘a×pÈ\begin{Ex}{First‘¹–exercise}Ž¡‘E±102Ž‘p2ÈAn–¹–exercise“with“a“solution.Ž¡‘E±103Ž‘p2È\begin{solution}Ž¡‘E±104Ž‘~0ôÈThis–¹–is“a“solution.Ž¡‘E±105Ž‘~0ôÈ\relax{}Ž¡‘E±106Ž‘p2È\end{solution}Ž¡‘E±107Ž‘a×pÈ\end{Ex}Ž¡‘E±108Ž‘a×pÈ\begin{Ex}{Second‘¹–exercise}Ž¡‘E±109Ž‘p2ÈA–¹–second“exercise“with“a“solution.Ž¡‘E±110Ž‘p2È\begin{solution}Ž¡‘E±111Ž‘~0ôÈThis–¹–is“another“solution.Ž¡‘E±112Ž‘p2È\end{solution}Ž¡‘E±113Ž‘a×pÈ\end{Ex}Ž¡‘E±114Ž‘a×pÈ\Closesolutionfile{solutions}Ž¡‘E±115Ž‘Sª®È\section*{Solutions}Ž¡‘E±116Ž‘a×pÈ\Readsolutionfile{solutions}Ž¡‘E±117Ž‘Sª®È\end{document}ŽŽŸ’ø²5ŽŽŒ‹- ª ýs o ý´‘E±118Ž‘Sª®ËhÊ=Ìex3Ž‘ŸøËiŽŸ!Ä‘IÆ7Ž‘aLËIdenŒÌti cationŽŸç‘I²This–ë¹pac¸ãk‘ÿqÇage“can“only“bGe“used“with“LŸýó5‘üff±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxX‘ü2Ÿÿµ"ŽŽ‘)?c²,‘Qso“an“appropriate“message“is“dis-ŽŸ ‘Ipla•¸ãy“ed–UUwhen“another“format“is“used.Ž¤‘E±119Ž‘Sª®ËhÌansw¾9ersŽ‘"EŸËiŽŸ ‘E±120Ž‘Sª®È\NeedsTeXFormat{LaTeX2e}[1996/06/01]Ž©‘X²Announce–UUthe“pacš¸ãk‘ÿqÇage“name“and“its“v˜ersion:Ž¡‘E±121Ž‘Sª®È\ProvidesPackage{answers}[1996/07/10]Ž¦‘X²And–UUdispla¸ãy“it“on“the“terminal“(and“the“log“ le):Ž¡‘E±122Ž‘Sª®È\typeout{Package–¹–`answers'“<\filedate>.}Ž¤ ‘E±123Ž‘Sª®È\typeout{\Copyright}ŽŸ!Ä‘IÆ8Ž‘aLËOptionsŽŸç‘I²There–2øis“a“single“option“Çnosolutionfiles“²that“switc¸ãhes“output“o “to“ les“andŽ© ‘IproGduces–UUthe“solutions“here-and-no¸ãw.ŽŸ‘E±124Ž‘Sª®È\newif\ifanswerfiles‘¹–\answerfilestrueŽ¡‘E±125Ž‘Sª®È\DeclareOption{nosolutionfiles}{\answerfilesfalseŽ¡‘E±126Ž‘a×pÈ\typeout{No–¹–answer“files“being“produced}}%Ž¡‘E±127Ž‘Sª®È\ProcessOptionsŽ¡‘E±128ŽŽŸ‘X²As–ëthis“pacš¸ãk‘ÿqÇage“no˜w“relies“hea˜vily“on“the“Çverbatim“²pac˜k‘ÿqÇage,‘Šw˜e“ensure“thatŽ¦‘Ithat–UUis“loaded.Ž¤‘E±129Ž‘Sª®È\RequirePackage{verbatim}ŽŸ!Ä‘IÆ9Ž‘aLËFile‘ffhandlingŽŸç‘ê9ÞÈ\solutionextensionŽŽŽ‘I²The–UUdefault“extension“for“solution“ les“is“de ned“here.Ž¡‘E±130Ž‘Sª®È\newcommand{\solutionextension}{tex}ŽŸ‘I²It–UUmaš¸ãy“bGe“c˜hanged“with“Ç\renewcommand².ŽŸ‘yºÈFilesaveŽŽŽ‘I²W‘ÿ*ªe–F\de ne“an“en•¸ãvironmen“t–F\ÇFilesave“²with“one“parameter,‘‚the“ le“handle.‘DÜIt“isŽ¦‘Isimilar–UUto“the“example“of“Sc¸ãh‘úÿÿopf“in“the“description“of“Çverbatim².Ž¡‘E±131Ž‘Sª®È\newenvironment{Filesave}[1]{%Ž¤ ‘E±132Ž‘a×pÈ\@bsphackŽ¡‘E±133Ž‘a×pÈ\def\verbatim@processline{}%Ž¡‘E±134Ž‘a×pÈ\Iffileundefined{#1}{}{%Ž¡‘E±135Ž‘p2È\Ifopen{#1}{%Ž¡‘E±136Ž‘~0ôÈ\def\verbatim@processline{%Ž¡‘E±137Ž’Œ]¶È\Ifanswerfiles{%Ž¡‘E±138Ž’šŠxÈ\immediate\write\@nameuse{#1@file}%Ž¡‘E±139Ž’¨·:È{\the\verbatim@line}%Ž¡‘E±140Ž’Œ]¶È}{}%Ž¡‘E±141Ž‘~0ôÈ}%Ž¡‘E±142Ž‘p2È}{}%ŽŽŸ’ø²6ŽŽŒ‹5ã ª ýs o ý´‘E±143Ž‘a×pÈ}%Ž¤ ‘E±144Ž‘a×pÈ\let\do\@makeother\dospecialsŽ¡‘E±145Ž‘a×pÈ\catcode`\^^M\active‘¹–\catcode`\^^I=12\relaxŽ¡‘E±146Ž‘a×pÈ\verbatim@startŽ¡‘E±147Ž‘Sª®È}{\@esphack}Ž©€4‘“b\WritetofileŽŽŽ‘I²It–5is“also“useful“to“ha•¸ãv“e–5a“command“to“write“material“to“the“ l