%if False %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % colorcode.fmt % % code in a colored box for poly style in lhs2TeX; % very experimental % % Permission is granted to include this file (or parts of this file) % literally into other documents, regardless of the conditions or % license applying to these documents. % % Andres Loeh, November 2005, ver 1.6 % % TODO: fix spacing behaviour for other environments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %endif %if not lhs2tex_colorcode_fmt_read %let lhs2tex_colorcode_fmt_read = True %include polycode.fmt % %if style /= newcode \ReadOnlyOnce{colorcode.fmt}% \RequirePackage{colortbl} \RequirePackage{calc} % The color environment displays each code block in a colored box. \makeatletter \newenvironment{colorhscode}% {{\parskip=0pt\parindent=0pt\par\vskip\abovedisplayskip\noindent}% \hscodestyle \tabular{@@{}>{\columncolor{codecolor}}p{\linewidth}@@{}}% \let\\=\@@normalcr \(\pboxed}% {\endpboxed\)% \endtabular {\parskip=0pt\parindent=0pt\par\vskip\belowdisplayskip\noindent}% \ignorespacesafterend} \newenvironment{barhscode}% {\hsnewpar\abovedisplayskip \hscodestyle \arrayrulecolor{codecolor}% \arrayrulewidth=\coderulewidth \tabular{||p{\linewidth-\arrayrulewidth-\tabcolsep}@@{}}% \let\\=\@@normalcr \(\pboxed}% {\endpboxed\)% \endtabular \hsnewpar\belowdisplayskip \ignorespacesafterend} \makeatother \def\colorcode{\columncolor{codecolor}} \definecolor{codecolor}{rgb}{1,1,.667} \newlength{\coderulewidth} \setlength{\coderulewidth}{3pt} \newcommand{\colorhs}{\sethscode{colorhscode}} \newcommand{\barhs}{\sethscode{barhscode}} \EndFmtInput %endif %endif