% fmmcc.sth % mmcc style with frames % HtX (1.0) (c) 1997, Richard M. Salter % Please read copyright and distribution agreement \input{report.sth} \typeout{Substyle: mmcc} \typeout{Substyle: frames} \seticondir{icons/} \setlibdir{./} \base{} %\seticondir{http://klingon.cs.iupui.edu/~aharris/mmcc/icons/} \setappletdir{http://www.cs.oberlin.edu/~rms/applets/} %\setappletdir{http://www.cs.indiana.edu/mmcc/applets/} \newcommand{\htx}{HtX} \newctr{exctr}\newctr{exsol}\newctr{hntctr} \newenvironment{framesetdoc}[1][2]{ \begin{excursion}{#3}{w} \mkp*{/head} \ifdef[\mkp*[rows="#1"]{frameset}]{#1} \ifdef[\mkp*[cols="#2"]{frameset}]{#2}} {\mkp*{/frameset}\mkp*{/html}\end{excursion}} \newenvironment{frameset}[0][2]{ \ifdef[\mkp*[rows="#1"]{frameset}]{#1} \ifdef[\mkp*[cols="#2"]{frameset}]{#2}} {\mkp*{/frameset}} \newcommand{\frame}[1][2]{ \mkp*[name="#1" #2 src="#3"]{frame} } \newcommand{\jsheader}{ \begin{javascript}[\mainfileroot] function retoc() { var callingURL = document.URL; var tmp = callingURL.lastIndexOf("?"); var tocurl; if (tmp != -1) { {tocurl = callingURL.substring(tmp+1, callingURL.length);} if (top.frames[1].frames.length == 0) { top.frames[0].location='\mainfileroot tc.html#'+tocurl+'?'+tocurl; } } } \end{javascript} } % Section, subsection, subsubsection with frames \newcommand{\section}[1][2]{ \setbuf{sect}{Section: #3} \ifthen {\or{\or{\numeq{\ctr{nav}}{2}}{\numle{\ctr{navlvl}}{0}}} {\nonempty{#2}}} \ifdef[\header{2}{\bundle*{0}[#2]{|#3|}}] [\header{2}{\bundle*{0}{#3}}]{#2}\par \ifelse \pgprelude{\jsheader\setprop{olprop}{retoc()}} \pghead{\header{3}{\buf{sect}}\par} \bundle{0}[#1]{#3}\setctr{pgdepth}{\depth} \pgfoot{\hr\address{\buf{me}}} \endif} \newcommand{\subsection}[1][2]{ \setbuf{subsect}{Subsection: #3} \ifthen {\or{\or{\numeq{\ctr{nav}}{2}}{\numle{\ctr{navlvl}}1}} {\nonempty{#2}}} \ifdef[\header{3}{\bundle*{1}[#2]{|#3|}}] [\header{3}{\bundle*{1}{#3}}]{#2}\par \ifelse \pgprelude{\jsheader\setprop{olprop}{retoc()}} \pghead{\header{3}{\buf{sect}\break ...\buf{subsect}}\par} \bundle{1}[#1]{#3}\setctr{pgdepth}{\depth} \pgfoot{\hr\address{\buf{me}}} \endif} \newcommand{\subsubsection}[1][1]{ \setbuf{subsubsect}{Subsubsection: #3} \ifthen {\or{\or{\numeq{\ctr{nav}}{2}}{\numle{\ctr{navlvl}}2}} {\nonempty{#2}}} \ifdef[\header{3}{\bundle*{2}[#2]{|#3|}}] [\header{3}{\bundle*{2}{#3}}]{#2}\par \ifelse \pgprelude{\jsheader\setprop{olprop}{retoc()}} \pghead{\header{3}{\buf{sect}\break ...\buf{subsect}\break ... ...\buf{subsubsect}}\par} \bundle{2}[#1]{#3}\setctr{pgdepth}{\depth} \pgfoot{\hr\address{\buf{11}}} \endif} \newcommand{\section*}[1][1]{\section[][#1]{#2}} \newcommand{\subsection*}[1][1]{\subsection[][#1]{#2}} \newcommand{\subsubsection*}[1][1]{\subsubsection[][#1]{#2}} \newcommand{\vlentry}[1][1]{ \libbuf*\nl\setlibbuf*{ \end{verbatim}\nl\header{5}{Use {\bf Back} to return}\eanchor} \nl\nl |\hr\anchor{rf#2}{\header{2}{\alt{#1}{#2}}}\par\begin{verbatim}|} \newcommand{\lentry}[1][1]{ \libbuf*\nl\setlibbuf*{\eanchor} \nl\nl |\hr\anchor{rf#2}{\header{2}{\alt{#1}{#2}}}\par\nl|} \newbibfile[ffffbb][References]{refs} \newcommand{\docheader}[3]{ \begin{center} \title{Module \hash #2: #3} \begin{table}[cellpadding=10][][halign=center] \image{\icondir mmcc.gif}\col[valign=middle halign=center] \header{3}{\centering\it #1}\row[][halign=center]\par \header{4} {\centering Indiana University\\Multi-campus Modular\\Computing Curriculum} \end{table} \end{center} \hr[noshade size=2] {\div[center]\header{1}{Module \hash #2: #3}} \hr[noshade size=2]} \newenvironment{goallist}{ \header{2}{\it\image[middle][][hspace=15]{\icondir goal.gif} Goals} \begin{itemize}} {\end{itemize}\hr[noshade size=2]} \newenvironment{prereqs}{ \header{2}{\it\image[middle][][hspace=15]{\icondir suitcase.gif} Prerequisite Skills} \begin{itemize}} {\end{itemize}\hr[noshade size=2]} \newenvironment{lab}{\section{Laboratory Assignment}}{} \newenvironment{lab*}{\section*{Laboratory Assignment}}{} \newenvironment{summary}{\section{Summary}}{} \newenvironment{summary*}{\section*{Summary}}{} \newenvironment{vocab}{ \section{Vocabulary} \hr[noshade size=2] \header{2}{\it\it\image[middle][][hspace=15]{\icondir type.gif} Vocabulary / Main Concepts} \begin{description}} {\end{description}\hr[noshade size=2]} \newenvironment{leftimage}[1]{ \image[left][][hspace=15 vspace=10]{#1}} {\break[left]} \newenvironment{rightimage}[1]{ \image[right][][hspace=15 vspace=10]{#1}} {\break[right]} % redef of gloss* to use frames \newenvironment{gloss*}[1][2]{ \incctr{\ctr{glosx}} \ifthen {\numeq{\ctr{cellgloss}}0} \key*[#1][M\ctr{glosx}\ctr{\ctr{glosx}}][#2]{#3} \incctr{glosx} \begin{keyhole}{\alt{#1}{#3}} \ifelse \cellref[#1][M\ctr{glosx}\ctr{\ctr{glosx}}][#2] {M\ctr{glosx}\ctr{\ctr{glosx}}}{#3} \incctr{glosx} \begin{cell}{\alt{#1}{#3}} \endif} {\decctr{glosx} \ifthen {\numeq{\ctr{cellgloss}}0} \end{keyhole} \ifelse \end{cell} \endif} \newcommand{\key*}[1][3]{\tolink[#3][#2]{#2} {\tagclean{kh@\alt{#1}{#4}}}{#4}} \newcommand{\cellref}[2][3]{ \xtolink[#3][#2]{#4} {\celldir/\tagclean{cl@\alt{#1}{#5}}.html\hash\tagclean{cl@\alt{#1}{#5}}} {#5}} \newenvironment{cell}[1][1]{ \setbuf0{\celldir/\tagclean{cl@#2}} \fcreate{\buf*0} \setprop{olprop}{} \begin{excursion}{\buf*0}{w} \preamb[ffffd0]{#1} \anchor{cl@#2}{\header{2}{\alt{#1}{#2}}}} {\postamb \end{excursion}} % q and a \newbuf{ansf} \newctr{qctr} \newctr{cellans} \newcommand{\cellans}{\setctr{cellans}1} \newcommand{\keyans}{\clrctr{cellans}} \newenvironment{quest} { \incctr{qctr} \anchor{Q\ctr{qctr}}{\par\image[BOTTOM]{\icondir begin_colorline.gif}} \begin{description} \item[\bf Q. \ctr{qctr}]} { \ifthen {\numeq{\ctr{cellans}}0} \vspace{50} \end{excursion}\par \ifelse \par \end{cell}\par \endif \image[TOP]{\icondir end_colorline.GIF}\par} \newcommand{\ans} {\par \end{description}\hr \ifthen {\numeq{\ctr{cellans}}0} \tolink[\image[MIDDLE]{\icondir green_query.GIF}] {Q\ctr{qctr}}{A\ctr{qctr}}{Click here for the answer:} \begin{excursion}{\buf{ansf}}{a} \anchor{A\ctr{qctr}}{\bf A. \ctr{qctr}}\cdots\cdots\cdots \ifelse \cellref[A\ctr{qctr}][] [\image[MIDDLE]{\icondir green_query.GIF}] {Q\ctr{qctr}}{Click here for the answer:} \begin{cell}{A\ctr{qctr}} \endif} \newenvironment{hint}[1]{ \incctr{hntctr} \begin{gloss*}[#1] [\image[TOP][Click Here]{\icondir green_bang!.GIF}] {\bf Hint:}} {\end{gloss*}} \newcommand{\newansfile}[1][1]{ \begin{excursion}{#2}{w} \preamb[#1]{Answers} \end{excursion} \setbuf{ansf}{#2}} % multiple choice question using applet \newctr{mcq}\newctr{mcstar}\newbuf{mcalt} \newenvironment{mcquest}{ \setctr{mcq}{-1} \clrctr{mcstar} \incctr{qctr} \anchor{Q\ctr{qctr}}{\par\image[BOTTOM]{\icondir end_colorline.GIF}} \begin{quote} \begin{applet}[\appletdir Mcquest] [\substr{1}{6}{\getprop{bgprop}}]{200}{300}{mcquest} \begin{capture}{0} \semiverb[\mans:\mans*][\end{capture}]{mcquest}} {\ifthen {\numeq{\ctr{mcq}}{0}} \jparam{quest}{\ctr{qctr}. \buf0} \ifelse \jparam{A\ctr{mcq}}{\buf*{mcalt}} \jparam{R\ctr{mcq}}{\buf0} \ifthen {\numeq{\ctr{mcstar}}{1}} \jparam{C\ctr{mcq}}{\ctr{mcq}} \clrctr{mcstar} \endif \endif \incctr{mcq} \jparam{alts}{\ctr{mcq}} \end{applet}\end{quote} \image[TOP]{\icondir end_colorline.GIF}\par } \newcommand{\mans}[1]{ \end{capture} \ifthen {\numeq{\ctr{mcq}}{-1}} \jparam{quest}{\ctr{qctr}. \buf0} \ifelse \jparam{A\ctr{mcq}}{\buf*{mcalt}} \jparam{R\ctr{mcq}}{\buf*0} \ifthen {\numeq{\ctr{mcstar}}{1}} \jparam{C\ctr{mcq}}{\ctr{mcq}} \clrctr{mcstar} \endif \endif \setbuf{mcalt}{#1} \incctr{mcq} \begin{capture}{0} } \newcommand{\mans*}[1]{ \end{capture} \ifthen {\numeq{\ctr{mcq}}{-1}} \jparam{quest}{\ctr{qctr}. \buf0} \ifelse \jparam{A\ctr{mcq}}{\buf*{mcalt}} \jparam{R\ctr{mcq}}{\buf*0} \ifthen {\numeq{\ctr{mcstar}}{1}} \jparam{C\ctr{mcq}}{\ctr{mcq}} \clrctr{mcstar} \endif \endif \setbuf{mcalt}{#1} \incctr{mcq} \incctr{mcstar} \begin{capture}{0} } % exercises % new method \newctr{exdpth} \newenvironment{exercise}[0][2]{ \incctr{exctr} \setctr{exdpth}{\depth} \hr[noshade] \ifthen {\nonempty{#1}} \header{2}{\bundle*{3}[#2]{Exercise \ctr{exctr}: #1}} \ifelse \header{2}{\bundle*{3}{Exercise \ctr{exctr}}} \endif} {\\\hr[noshade]\unbundle\par} \newcommand{\solutionon}{\setctr{exsol}{1}} \newcommand{\solutionoff}{\clrctr{exsol}} \newenvironment{exsol}[0][1]{ \ifthen {\ctr{exsol}} \\Click here for the solution: \ifthen {\nonempty{#1}} \setbuf{99}{.#1} \ifelse \setbuf{99}{} \endif \begin{gloss*}[Solution to Exercise \ctr{exctr}\buf{99}] {\image[MIDDLE]{\icondir pink_query.GIF}} \ifelse \begin{excursion}{/dev/null}{w} \endif } {\ifthen {\ctr{exsol}} \end{gloss*}\ifelse \end{excursion}\endif} % references \newcommand{\cite}[2]{ \setbrefbuf{rf@#1\/ \brefbuf} \tolink[][\tagclean{rx@#1}]{\tagclean{rx@#1}}{\tagclean{rf@#1}}{#2}} \newcommand{\bibentry}[1]{ \bibbuf*\nl\nl|\anchor{rf@#1}{\header{2}{#1}}\par\nl| \setbibbuf*{\hr[]} } \newcommand{\refentry}[1]{\bibbuf\par \anchor{rf@#1}{\header{2}{#1}}\par \setbibbuf*{\hr[]}} % vocabulary \newcommand{\vref}[1][1]{ \setrefbuf{rf\alt{#1}{#2}\/ \refbuf} \setbuf0{\tagclean{rf\alt{#1}{#2}}} \setbuf1{\tagclean{xf\alt{#1}{#2}}} \ifthen {\isref\buf0} \tolink[][\buf1]{\buf1}{\buf0}{{\it #2\/}} \ifelse {\it #2} \image{\icondir smenaw.gif} \endif} \newcommand{\vocab}{ % {\library{vcbl}} \section{Vocabulary} \centerline{\image{\icondir type.gif}}\par \dblsrt[\refbuf]{anchor}{\libfile.htx} %\postamb } % html display \newctr{htmld} \newenvironment{html-display}{ \incctr{htmld} \begin{capture}{0} \semiverb[][\end{capture}]{html-display}} {\mkp*{pre} \buf0\nl \mkp*{/pre} \par \xtolink[][htmldx\ctr{htmld}]{htmldx\ctr{htmld}} {htmld\ctr{htmld}.html}{Click here to View} \setprop{olprop}{} \begin{excursion}{htmld\ctr{htmld}}{w} \preamb{HTML Example \ctr{htmld}} \buf*0\nl\postamb \end{excursion} } \newcommand{\sp}[0][1]{ \ifthen {\empty{#1}} \'160 \ifelse \newctr{ictr} \for{ictr}{#1}{1}{\'160} \endif} \newcommand{\latex}{LaTeX} \newcommand{\LaTeX}{LaTeX} \newcommand{\doindex}{\section{Index}\makeindex} \newcommand{\indx}[1][1][Vt]{ \incctr{index} \setbuf1{@i\depth @\ctr{index}} \anchor{\buf1}{} \asinsert{#2}[|#1|]{\buf1}} \newcommand{\makeindex}{ {\centering\header{2}{Index}}\par \mkp*[cellpadding=5]{table} \aslist[\mkp*{b}][\mkp*{/b}\sp[2]][\par] {\image[][][border=0]{\icondir bsmiley.gif}} \mkp*{/table} } \newcommand{\htxonly}[1]{#1} \newcommand{\latexonly}[1]{} %% dynamic framing \newcommand{\frlink}[3][2] {\xlink[#1][#2]{\mainfileroot df.html?\curfile\hash #3?\uref{#4}}{#5}} \newcommand{\tolink}[3][3] { \newbuf{plain} \newbuf{hot} \ifthen {\nonempty{#1}} \setbuf*{hot}{#1} \setbuf*{plain}{#6} \ifelse \setbuf*{hot}{#6} \endif \begin{javascript}[\frlink:\buf:\alt:\anchor] if (top.frames[1].frames.length == 0) { document.writeln('\buf{plain} \frlink[#2][#3]{#4}{#5}{\buf{hot}}') } else { document.writeln( '\anchor[#3]{#2}{\alt{\buf{plain}}{\buf{hot}}}'); } \end{javascript}} \newcommand{\xfrlink}[3][2] {\xlink[#1][#2]{\mainfileroot df.html?\curfile\hash #3?#4}{#5}} \newcommand{\xtolink}[3][3] { \newbuf{plain} \newbuf{hot} \ifthen {\nonempty{#1}} \setbuf*{hot}{#1} \setbuf*{plain}{#6} \ifelse \setbuf*{hot}{#6} \endif \begin{javascript}[\xfrlink:\buf:\alt:\anchor] if (top.frames[1].frames.length == 0) { document.writeln('\buf{plain} \xfrlink[#2][#3]{#4}{#5}{\buf{hot}}') } else { document.writeln( '\anchor[#3]{#2}{\alt{\buf{plain}}{\buf{hot}}}'); } \end{javascript}} \newcommand{\zlink}[2][2]{ \ifthen {\nonempty{#1}}% \label{#1}% {\mkp[target="_top" href="#3" name="\tagclean{#1}" #2]{a}#4}% \ifelse% {\mkp[target="_top" href="#3" #2]{a}#4}% \endif} %% TOC \newctr{toclvl} \newenvironment{toc}{\incctr{toclvl}}{\decctr{toclvl}} \newcommand{\tocitem}[2]{ \ifthen {\numeq{\ctr{toclvl}}{1}} \par{\mkp{nobr}\bf\script{cline("#1","#2")}} \ifelse \newctr{tctr} {\mkp{nobr}\for{tctr}{\plus{\ctr{toclvl}}{-1}}{1}{-} \script{cline("#1","#2")}} \endif \ifthen {\empty{\substr{20}{21}{#2}}}\break \ifelse\nl \endif } Colors \newcommand{\paleBlue}{\wallpaint{fbd8ff}} \newcommand{\palePink}{\wallpaint{ffbfe1}} \newcommand{\paleGreen}{\wallpaint{bfffcb}} \newcommand{\paleLavender}{\wallpaint{d8bfff}} \newcommand{\robinsEggBlue}{\wallpaint{c0ffff}} \newcommand{\pastelGreen}{\wallpaint{d4ffd4}} \newcommand{\palePurple}{\wallpaint{ffd4ff}} \newkeyhole[\mainfileroot\ key][d8bfff]{\curfileroot key} \newansfile[ffbfe1]{\curfileroot ans} \newcelldir{\mainfileroot cell} % frame creation \nobody \title{\mainfileroot} \outputon \getbase \mkp*{/head} \rtoc{0:1:2:3}{toc}[][tocitem] \begin{frameset}[][150,*]\nl \frame[contents]{\curfileroot tc.html?c0} \frame[main]{\curfileroot 0.html} \end{frameset} \begin{excursion}{\curfileroot df}{w} \begin{javascript}[\pct:\mainfileroot] var callingURL = document.URL; var frame1 = callingURL.substring(callingURL.indexOf('?')+1, callingURL.lastIndexOf('?')); var frame2 = callingURL.substring(callingURL.lastIndexOf('?')+1, callingURL.length); document.writeln('
'); \end{javascript} \mkp*{/head}\mkp*{/html} \end{excursion} \begin{excursion}{\curfileroot rt}{w} \begin{javascript} var callingURL = document.URL; var rtnURL = callingURL.substring(callingURL.indexOf('?')+1, callingURL.length); \end{javascript} \preamb[000000]{Return} \begin{center} {\mkp[name="rtnbar"]{form} \mkp*[type="button" onClick="parent.location=rtnURL" value="Return" name="rtnbtn"]{input}} \end{center} \postamb \end{excursion} \basefont{2} \begin{excursion}{\curfileroot tc}{w} \setbuf0{\getprop{lnprop}} \setbuf1{\getprop{txprop}} \setbuf2{\getprop{vlprop}} \setprop{lnprop}{ffff00} \setprop{txprop}{ff0000} \setprop{vlprop}{ffff00} \begin{javascript}[\mainfileroot] var callingURL = document.URL; var curname; if (callingURL.indexOf('#') == -1) { curname = "c0"; } else { curname = callingURL.substring(callingURL.indexOf('?')+1, callingURL.length); } var ctr = 0; function cline(clurl, text) { if (curname == 'c'+ctr) { document.write(''+text+"") } else { document.write('' +text+'') } ctr++; } \end{javascript} \preamb[000000]{Contents} \header{2}{Contents} \ifthen{\numeq{\pass}{2}}\input{\mainfileroot toc}\endif \par\postamb \end{excursion} \basefont{3} \setprop{lnprop}{\buf0}\setprop{txprop}{\buf1}\setprop{vlprop}{\buf2} \pgprelude{\jsheader\setprop{olprop}{retoc()}} %\pgprelude{\setprop{olprop} %{parent.frames[0].location='\mainfileroot tc.html?\curfile'}} \robinsEggBlue \bundle{0}{Title Page} \outputoff