variabele rules in tabular

Wybo Dekker <wybo-qWit8jRvyhVmR6Xm/[email protected]>
Newsgroups gmane.comp.tex.dutch
Message-ID <[email protected]>
Ik ben aan het experimenteren met een voorbeeld uit de TeX Companonion
(p.266, sectie 5.6.2) om dikkere rules in een tabular te maken:

\documentclass{article}
\usepackage{array}
\newlength\savedwidth
\newcommand{\whline}{\noalign{\global\savedwidth\arrayrulewidth
   \global\arrayrulewidth 2pt}%
   \hline
   \noalign{\global\arrayrulewidth\savedwidth}
}
\begin{document}
\begin{tabular}{|c|c|c|}\whline
A&B&C\\\hline
\end{tabular}
\end{document}

Dat gaat goed, de bovenste lijn wordt dikker, maar als ik aan de \whline
een optionele parameter mee te geven gaat het mis:

\documentclass{article}
\usepackage{array}
\newlength\savedwidth
\newcommand{\whline}[1][3pt]{\noalign{\global\savedwidth\arrayrulewidth
   \global\arrayrulewidth #1}%
   \hline
   \noalign{\global\arrayrulewidth\savedwidth}
}
\begin{document}
\begin{tabular}{|c|c|c|}\whline[2pt]
A&B&C\\\hline
\end{tabular}
\end{document}

Ik krijg:
! Misplaced \noalign.
\\whline [#1]->\noalign
                        {\global \savedwidth \arrayrulewidth \global
\arrayr...l.10 \begin{tabular}{|c|c|c|}\whline[2pt]

Weet iemand waarom, en wat ik eraan kan doen?
-- 
Wybo
_______________________________________________
NTG-leden mailing list
[email protected]
http://www.ntg.nl/mailman/listinfo/ntg-leden

_______________________________________________
TeX-NL mailing list
[email protected]
http://www.ntg.nl/cgi-bin/mailman/listinfo/tex-nl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.