% H.A.Trujillo		
% Last Change:     27 Aug 2014
% 
% Orig written:	Jan 2011
% Rewritten:	Jun 2011

\documentclass[10pt]{article}		%<<<	
\usepackage[margin=1cm]{geometry}
\usepackage{tabularx}
\usepackage{colortbl}
\usepackage{ifthen}
\usepackage{fancyhdr}

\pagestyle{fancy}
    \renewcommand{\headrulewidth}{0pt}
    \cfoot{} \rfoot{\footnotesize\f\ \fe \fl \quad \w\ \we \wl}
    \setlength{\footskip}{0.2in}
\renewcommand{\tabularxcolumn} [1] {>{\centering\arraybackslash}p{#1}}

\newcommand{\blank}	[1] {\rule{#1}{0.4pt}}
\newcommand{\cellheight}    {3pt}
\newcommand{\nl}	    {\\[\cellheight] \cline{2-8}}
\newcommand{\NewBlock}	    {\\[\cellheight] \hline \cline{2-8}}
\newcommand{\shaded}	    {\cellcolor[gray]{0.75}}	% 0.9 too light
\newcommand{\test}	[2] {\ifthenelse{\isundefined{#1}} {} {#2} }

%%%%%  Switches  %%%%%% >>>


% -------  tweak things in this block -------

%%%%%%   Summer   %%%%%% <<<

% Summer:	  - Set "InUse" to needs of first lab day (Mon).
%		  - Set "Special" to needs of second lab day (Weds).
%		  - Omit all sections below "===" line

% Which days are "normal":
    %		  - 4-hour lab (1-5) spans both "first" and "second" periods
    %	\def \MonFirst  {}	\def \MonSecond {}	
    %	\def \TueFirst  {}	\def \TueSecond {}
    %	\def \WedFirst  {}	\def \WedSecond {}
    %	\def \ThuFirst  {}	\def \ThuSecond {}
    %	\def \FriFirst  {}	\def \FriSecond {}

% Which days are special:

    %	\def \SpecialMon{}
    %	\def \SpecialTue{}
    %	\def \SpecialWed{}
    %	\def \SpecialThu{}
    %	\def \SpecialFri{}

% Uncomment this:
    %	\def \SpecialFirst{}	\def \SpecialSecond {}	% 4-hour lab
    

% Toggle in needs:
    %	\def \InUse	{}	% Monday use
    %	\def \Early	{}	% NMR needed during first 90 min of period
    %	\def \Late	{}	% NMR will go overtime

    % 	\def \SpecialUsed {}	% Wednesday use
    %	\def \SpecialEarly{}	% Wednesday's expt needs NMR at start
    %	\def \SpecialLate {}	% Wednesday's expt needs NMR at end

% ========================================== >>>

%%%%%%   Fall + Spring   %%%%%% <<<

% Fall semester:  - Uncomment Monday needs, if different from rest of week.
    
    %	\def \SpecialUsed {}	% Prev Week's expt needed NMR
    %	\def \SpecialEarly{}	% Prev Week's expt needed NMR at start
    %	\def \SpecialLate {}	% Prev Week's expt needed NMR at end

% uncomment these as appropriate :
    %	\def \SpecialMon    {}	% One day is special (eg, wrapped Monday)
    %	\def \SpecialFirst  {}	% Special    1:00
    %	\def \SpecialSecond {}	% Special    2:00/2:20
% ______________

% Uncomment the NMR needs for the week:

    	\def \InUse	{}	% NMR used this week
    	\def \Early	{}	% NMR needed during first 90 min of period
    %	\def \Late	{}	% NMR will go overtime


% Uncomment the laboratory sections for the semester:
%		(omit "special" day from this block)

    	\def \MonFirst  {}	% Monday    1:00
    %	\def \MonSecond {}	% Monday    2:00
    
    %	\def \TueFirst  {}	% Tuesday   1:00
    	\def \TueSecond {}	% Tuesday   2:20
    %	\def \TueNight	{}	% Tuesday   6:00
    
    %	\def \WedFirst  {}	% Wednesday 1:00
    %	\def \WedSecond {}	% Wednesday 2:00
    
    %	\def \ThuAM	{}	% Thursday  8:00
    	\def \ThuFirst  {}	% Thursday  1:00
    %	\def \ThuSecond {}	% Thursday  2:20
    %	\def \ThuNight	{}	% Thursday  6:00
    
    %	\def \FriFirst  {}	% Friday    1:00
    %	\def \FriSecond {}	% Friday    2:00

%>>>

%%%%%%   NMR Course   %%%%%% <<<

% \def\NMRcourse{}

% ========================================== >>>

% -------------------------------------------

%%%%%%%%%%%%  switchboard  %%%%%%%%%%%%<<<

    \def \monA {} \def \tueA {} \def \wedA {} \def \thuA {} \def \friA {}
    \def \monB {} \def \tueB {} \def \wedB {} \def \thuB {} \def \friB {}
    \def \monC {} \def \tueC {} \def \wedC {} \def \thuC {} \def \friC {}
    \def \monD {} \def \tueD {} \def \wedD {} \def \thuD {} \def \friD {}
    \def \monE {} \def \tueE {} \def \wedE {} \def \thuE {} \def \friE {}
    \def \monF {} \def \tueF {} \def \wedF {} \def \thuF {} \def \friF {}
    \def \monG {} \def \tueG {} \def \wedG {} \def \thuG {} \def \friG {}
    \def \monH {} \def \tueH {} \def \wedH {} \def \thuH {} \def \friH {}
    \def \monI {} \def \tueI {} \def \wedI {} \def \thuI {} \def \friI {}

    \def \monJ {\monA\monG}     \def \tueJ {\tueA\tueG}     \def \wedJ {\wedA\wedG} 
				\def \thuJ {\thuA\thuG}     \def \friJ {\friA\friG}

					       \def \thuL {}
					       \def \thuM {}	% Morning
					       \def \thuN {}
		  \def \tueS {}  	       \def \thuS {}	% nighT
		  \def \tueT {}  	       \def \thuT {}	

    \def\f{} \def\fe{} \def\fl{} \def\w{} \def\we{} \def\wl{}  	% f = footer


%                 A      B     C      D    E     F    G   |  H     I    J
% First sectn:  early  early  mid    mid  late            | late  mid  early
% Secnd sectn:         early  early  mid  mid   mid  late |            late

%		  L      M     N		      S      T
%  Thurs AM:	early 	mid   late 	Thurs 2PM:   late
%					Thurs 6PM:   early   mid+late

\test{\InUse} {

    \test{\Early} {
	\def\monA{\monI} \def\tueA{\tueI} \def\wedA{\wedI} \def\thuA{\thuI} \def\friA{\friI}
	\def\monB{\monD} \def\tueB{\tueD} \def\wedB{\wedD} \def\thuB{\thuD} \def\friB{\friD}
	\def\monC{\monD} \def\tueC{\tueD} \def\wedC{\wedD} \def\thuC{\thuD} \def\friC{\friD}
	\def\fe  {e }					   \def\thuL{\thuM}
			 \def\tueS{\tueT}		   \def\thuS{\thuT}
    }

    \test{\Late} {
	\def\monE{\monI} \def\tueE{\tueI} \def\wedE{\wedI} \def\thuE{\thuI} \def\friE{\friI}
	\def\monH{\monI} \def\tueH{\tueI} \def\wedH{\wedI} \def\thuH{\thuI} \def\friH{\friI}
	\def\monG{\monF} \def\tueG{\tueF} \def\wedG{\wedF} \def\thuG{\thuF} \def\friG{\friF}
	\def\fl  {l }					   \def\thuN{\thuM}
			 \def\tueS{\tueF}     		   \def\thuS{\thuF}
    }
	

    \test{\MonFirst}	{ \def\monC{\shaded} \def\monD{\shaded} \def\monI{\shaded} }
    \test{\MonSecond}	{ \def\monD{\shaded} \def\monE{\shaded} \def\monF{\shaded} }
    \test{\TueFirst}	{ \def\tueC{\shaded} \def\tueD{\shaded} \def\tueI{\shaded} }
    \test{\TueSecond}	{ \def\tueD{\shaded} \def\tueE{\shaded} \def\tueF{\shaded} }
    \test{\WedFirst}	{ \def\wedC{\shaded} \def\wedD{\shaded} \def\wedI{\shaded} }
    \test{\WedSecond}	{ \def\wedD{\shaded} \def\wedE{\shaded} \def\wedF{\shaded} }
    \test{\ThuFirst}	{ \def\thuC{\shaded} \def\thuD{\shaded} \def\thuI{\shaded} }
    \test{\ThuSecond}	{ \def\thuD{\shaded} \def\thuE{\shaded} \def\thuF{\shaded} }
    \test{\FriFirst}	{ \def\friC{\shaded} \def\friD{\shaded} \def\friI{\shaded} }
    \test{\FriSecond}	{ \def\friD{\shaded} \def\friE{\shaded} \def\friF{\shaded} }

    					    \test{\TueNight} { \def\tueT{\shaded} }
    \test{\ThuAM} { \def\thuM{\shaded} }    \test{\ThuNight} { \def\thuT{\shaded} }

    \def \f {Use:}

}


\test{\NMRcourse} {\def\friA{\shaded}} 


\test{\SpecialUsed}{

	\def\xxxA{} \def\xxxB{} \def\xxxC{} \def\xxxD{} \def\xxxE{}
	\def\xxxF{} \def\xxxG{} \def\xxxH{} \def\xxxI{} \def\xxxJ{}


	\test{\SpecialFirst}  { \def\xxxC{\shaded} \def\xxxD{\shaded} \def\xxxI{\shaded} }
	\test{\SpecialSecond} { \def\xxxD{\shaded} \def\xxxE{\shaded} \def\xxxF{\shaded} }
	\def\w {sp: }


	\test{\SpecialEarly} {
	    \def\xxxA{\xxxI} \def\xxxB{\xxxD} \def\xxxC{\xxxD} \def\we{e }
	    }
	\test{\SpecialLate} {
	    \def\xxxE{\xxxD} \def\xxxH{\xxxI} \def\xxxG{\xxxF} \def\wl{l}
	}


    \test{\SpecialMon} {
	\def\monA{\xxxA} \def\monB{\xxxB} \def\monC{\xxxC} \def\monD{\xxxD} \def\monE{\xxxE} 
	\def\monF{\xxxF} \def\monG{\xxxG} \def\monH{\xxxH} \def\monI{\xxxI} \def\monJ{\xxxJ} 
    } 
    \test{\SpecialTue} {
	\def\tueA{\xxxA} \def\tueB{\xxxB} \def\tueC{\xxxC} \def\tueD{\xxxD} \def\tueE{\xxxE} 
	\def\tueF{\xxxF} \def\tueG{\xxxG} \def\tueH{\xxxH} \def\tueI{\xxxI} \def\tueJ{\xxxJ} 
    } 
    \test{\SpecialWed} {
	\def\wedA{\xxxA} \def\wedB{\xxxB} \def\wedC{\xxxC} \def\wedD{\xxxD} \def\wedE{\xxxE} 
	\def\wedF{\xxxF} \def\wedG{\xxxG} \def\wedH{\xxxH} \def\wedI{\xxxI} \def\wedJ{\xxxJ} 
    } 
    \test{\SpecialThu} {
	\def\thuA{\xxxA} \def\thuB{\xxxB} \def\thuC{\xxxC} \def\thuD{\xxxD} \def\thuE{\xxxE} 
	\def\thuF{\xxxF} \def\thuG{\xxxG} \def\thuH{\xxxH} \def\thuI{\xxxI} \def\thuJ{\xxxJ} 
    } 
    \test{\SpecialFri} {
	\def\friA{\xxxA} \def\friB{\xxxB} \def\friC{\xxxC} \def\friD{\xxxD} \def\friE{\xxxE} 
	\def\friF{\xxxF} \def\friG{\xxxG} \def\friH{\xxxH} \def\friI{\xxxI} \def\friJ{\xxxJ} 
    }
}


%%%%%%%%%%%%%%%%%%%%%%%% >>>

\begin{document} 

%%%%%%%%%%%%  the big grid %%%%%%%%%%%%<<<
{\centering \large \bfseries NMR Sign-Up Sheet \par}

\bigskip
Week of: \blank{2 in} 20\blank{0.25 in}
\bigskip

\begin{tabularx}{0.95\textwidth}{r|*{5}{X|}|X|X|}
& Monday & Tuesday & Wednesday & Thursday & Friday & Saturday & Sunday \NewBlock

%	           m       t       w      th       f      sat      sun
	8:00   &       &       &       & \thuL &       &        &      \nl
	8:30   &       &       &       & \thuL &       &        &      \NewBlock
	
	9:00   &       &       &       & \thuL &       &        &      \nl
	9:15   &       &       &       & \thuL &       &        &      \nl
	9:30   &       &       &       & \thuM &       &        &      \nl
	9:45   &       &       &       & \thuM &       &        &      \NewBlock

	10:00  &       &       &       & \thuM &       &        &      \nl
	10:15  &       &       &       & \thuM &       &        &      \nl
	10:30  &       &       &       & \thuM &       &        &      \nl
	10:45  &       &       &       & \thuM &       &        &      \NewBlock

	11:00  &       &       &       & \thuN &       &        &      \nl
	11:15  &       &       &       & \thuN &       &        &      \nl
	11:30  &       &       &       & \thuN &       &        &      \nl
	11:45  &       &       &       & \thuN &       &        &      \NewBlock

	12:00  &       &       &       &       &       &        &      \nl
	12:15  &       &       &       &       &       &        &      \nl
	12:30  &       &       &       &       &       &        &      \nl
	12:45  &       &       &       &       &       &        &      \NewBlock

	1:00   & \monA & \tueA & \wedA & \thuA & \friA &        &      \nl
	1:15   & \monA & \tueA & \wedA & \thuA & \friA &        &      \nl
	1:30   & \monA & \tueA & \wedA & \thuA & \friA &        &      \nl
	1:45   & \monA & \tueA & \wedA & \thuA & \friA &        &      \NewBlock

	2:00   & \monB & \tueI & \wedB & \thuI & \friB &        &      \nl
	2:15   & \monB & \tueC & \wedB & \thuC & \friB &        &      \nl
	2:30   & \monC & \tueC & \wedC & \thuC & \friC &        &      \nl
	2:45   & \monC & \tueC & \wedC & \thuC & \friC &        &      \NewBlock

	3:00   & \monC & \tueC & \wedC & \thuD & \friC &        &      \nl
	3:15   & \monD & \tueC & \wedD & \thuD & \friD &        &      \nl
	3:30   & \monD & \tueD & \wedD & \thuD & \friD &        &      \nl
	3:45   & \monD & \tueD & \wedD & \thuD & \friD &        &      \NewBlock

	4:00   & \monE & \tueE & \wedE & \thuE & \friE &        &      \nl
	4:15   & \monE & \tueE & \wedE & \thuE & \friE &        &      \nl
	4:30   & \monE & \tueE & \wedE & \thuE & \friE &        &      \nl
	4:45   & \monE & \tueE & \wedE & \thuE & \friE &        &      \NewBlock

	5:00   & \monG & \tueF & \wedG & \thuF & \friG &        &      \nl
	5:15   & \monG & \tueG & \wedG & \thuG & \friG &        &      \nl
	5:30   & \monG & \tueG & \wedG & \thuG & \friG &        &      \nl
	5:45   & \monG & \tueG & \wedG & \thuG & \friG &        &      \NewBlock

	6:00   &       & \tueS &       & \thuS &       &        &      \nl
	6:15   &       & \tueS &       & \thuS &       &        &      \nl
	6:30   &       & \tueS &       & \thuS &       &        &      \nl
	6:45   &       & \tueS &       & \thuS &       &        &      \NewBlock

	7:00   &       & \tueT &       & \thuT &       &        &      \nl
   overnight   &       & \tueT &       & \thuT &       &        &      \NewBlock

\end{tabularx}
%>>>

\end{document} 

%			vim: tw=0 ft=texNoPlugin nowrap ve=insert fdm=marker fmr=<<<,>>>
