comparison Doc/texinputs/python.sty @ 31845:64cc163eeaf1 legacy-trunk

add a heavy box around warning notices to make them really stand out in the PDF and PostScript versions of the docs (the CSS already does this for HTML)
author Fred Drake <fdrake@acm.org>
date Wed, 31 Mar 2004 08:08:34 +0000
parents 354129143809
children 6b743cbc4171
comparison
equal deleted inserted replaced
31844:814cc9f83faa 31845:64cc163eeaf1
977 \begin{tabular}{lcl} 977 \begin{tabular}{lcl}
978 }{% 978 }{%
979 \end{tabular} 979 \end{tabular}
980 } 980 }
981 981
982 \newlength{\py@noticelength}
983
984 \newcommand{\py@heavybox}{
985 \setlength{\fboxrule}{2pt}
986 \setlength{\fboxsep}{7pt}
987 \setlength{\py@noticelength}{\linewidth}
988 \addtolength{\py@noticelength}{-2\fboxsep}
989 \addtolength{\py@noticelength}{-2\fboxrule}
990 \setlength{\shadowsize}{3pt}
991 \Sbox
992 \minipage{\py@noticelength}
993 }
994 \newcommand{\py@endheavybox}{
995 \endminipage
996 \endSbox
997 \fbox{\TheSbox}
998 }
999
1000 % a 'note' is as plain as it gets:
982 \newcommand{\py@noticelabel@note}{Note:} 1001 \newcommand{\py@noticelabel@note}{Note:}
1002 \newcommand{\py@noticestart@note}{}
1003 \newcommand{\py@noticeend@note}{}
1004
1005 % a 'warning' gets more visible distinction:
983 \newcommand{\py@noticelabel@warning}{Warning:} 1006 \newcommand{\py@noticelabel@warning}{Warning:}
1007 \newcommand{\py@noticestart@warning}{\py@heavybox}
1008 \newcommand{\py@noticeend@warning}{\py@endheavybox}
1009
984 \newenvironment{notice}[1][note]{ 1010 \newenvironment{notice}[1][note]{
1011 \def\py@noticetype{#1}
1012 \csname py@noticestart@#1\endcsname
985 \par\strong{\csname py@noticelabel@#1\endcsname} 1013 \par\strong{\csname py@noticelabel@#1\endcsname}
986 }{} 1014 }{\csname py@noticeend@\py@noticetype\endcsname}
987 \newcommand{\note}[1]{\strong{\py@noticelabel@note} #1} 1015 \newcommand{\note}[1]{\strong{\py@noticelabel@note} #1}
988 \newcommand{\warning}[1]{\strong{\py@noticelabel@warning} #1} 1016 \newcommand{\warning}[1]{\strong{\py@noticelabel@warning} #1}
989 1017
990 % Deprecation stuff. 1018 % Deprecation stuff.
991 % Should be extended to allow an index / list of deprecated stuff. But 1019 % Should be extended to allow an index / list of deprecated stuff. But