% Slitex macros for framed slides.

\catcode`@=11 \endlinechar=-1

  \def\fs@titletextheight{25pt}
  \def\fs@footboxheight{0.5in}
  \def\fs@footboxdepth{0.75in}

  \def\fs@outerframewidth{20pt}
  \def\fs@titlebarheight{5pt}
  
  \def\fs@sidemargin{30pt}
  \def\fs@topmargin{30pt}
  \def\fs@botmargin{20pt}
  
  \def\fs@parstretch{500pt}

  \def\fs@pagetitlebox#1{
    \vbox{
      \dimen4=\fs@titletextheight
      \advance\dimen4 by\fs@outerframewidth\relax
      \advance\dimen4 by\fs@titlebarheight\relax
      \vbox to \dimen4{
	\offinterlineskip
	\dimen6=\fs@sidemargin\relax
	\hsize=\textwidth \advance\hsize by 2\dimen6\relax 
	\hrule height \fs@outerframewidth
	\vss
	\hbox to \hsize{\Large\sf\hss #1 \hss}
	\vss
	\hrule height \fs@titlebarheight
      }
    }
  }
  
  \long\def\fs@pagebodybox#1{
    \vbox{
      \offinterlineskip
      \dimen6=\fs@sidemargin\relax
      \hsize=\textwidth \advance\hsize by 2\dimen6\relax 
      \hbox to \hsize{
        \kern\dimen6
	\dimen4=\textheight 
	\advance\dimen4 by -\fs@topmargin\relax
	\advance\dimen4 by -\fs@botmargin\relax
	\advance\dimen4 by -\fs@titletextheight\relax
	\advance\dimen4 by -\fs@titlebarheight\relax
	\advance\dimen4 by -\fs@footboxheight\relax
        \vbox to \dimen4{
          \hsize=\textwidth\relax
          \parindent=0pt\relax
          \parskip=8pt plus \fs@parstretch\relax
          \topskip=0pt\relax
          \advance\abovedisplayskip by 0pt plus \fs@parstretch\relax
          \advance\belowdisplayskip by 0pt plus \fs@parstretch\relax
	  \renewcommand{\baselinestretch}{1.0}
          % \vskip-\lastskip
          \hrule height0pt
	  \kern\fs@topmargin
          \vskip 0pt plus \fs@parstretch
          {\large #1}
          \vskip 0pt plus \fs@parstretch
          \vskip 0pt plus \fs@parstretch
          \kern\fs@botmargin
          \hrule height0pt
        }
        \kern\dimen6
      }
    }
  }
  
  \def\fs@pagefootbox#1{
    \vbox{
      \offinterlineskip
      \dimen6=\fs@sidemargin\relax
      \hsize=\textwidth \advance\hsize by 2\dimen6\relax 
      \hrule height\fs@footboxheight depth\fs@footboxdepth width \hsize
    }
  }

  \long\def\framedslide#1#2{
    { 
      \setbox4\fs@pagetitlebox{#1}
      \setbox6\fs@pagebodybox{#2}
      \setbox8\fs@pagefootbox{}
      \pagebreak
      \vbox{
	\offinterlineskip
        \hrule height 0pt
        \kern-\fs@outerframewidth
        \hbox to \hsize{
	  \null
	  \kern-\fs@sidemargin \kern-\fs@outerframewidth
	  \vrule width \fs@outerframewidth
	  \hss
	  \vbox{
	    \offinterlineskip
	    \box4
	    \box6
	    \box8
	  }
	  \hss
	  \vrule width \fs@outerframewidth
	  \kern-\fs@sidemargin \kern-\fs@outerframewidth
	  \null
	}
	\kern -\fs@footboxdepth
        \hrule height 0pt
      }
    }
  }

\catcode`@=12 \endlinechar=`\^^M
