Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Controlling thickness of *one* \hline in tabular

12,253 views
Skip to first unread message

Martin Boyer

unread,
Mar 21, 1996, 3:00:00 AM3/21/96
to
Hi,

Does anyone know how to change the thickness (height) of *one* \hline
in a tabular environment?

I would like to have one thick horizontal line just before the last
line in a table. I tried changing \arrayrulewidth just before the
\hline, but I got LaTeX errors and the result was a missing horizontal
where the thicker one should have been.

Thanks!

----------------------------------------------------------------------
test2e.tex:

\documentclass[12pt]{article}

\begin{document}

\begin{tabular}{|l|r|} \hline

first & 1 \\ \hline
second & 2 \\
\setlength{\arrayrulewidth}{1pt}\hline
\setlength{\arrayrulewidth}{0.4pt}
total & 3 \\ \hline

\end{tabular}


\end{document}

----------------------------------------------------------------------
LaTeX output:

This is TeX, Version 3.1415 (C version 6.1)
LaTeX2e <1995/06/01> patch level 3

(test2e.tex (/depot/share/TeX/texmf/tex/latex2e/base/article.cls
Document Class: article 1995/06/26 v1.3g Standard LaTeX document class
(/depot/share/TeX/texmf/tex/latex2e/base/size12.clo)) (test2e.aux)
! Misplaced \noalign.
\hline ->\noalign
{\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.9 \setlength{\arrayrulewidth}{1pt}\hline

! You can't use `\hrule' here except with leaders.
\hline ->\noalign {\ifnum 0=`}\fi \hrule
\@height \arrayrulewidth \futurelet...
l.9 \setlength{\arrayrulewidth}{1pt}\hline

! Missing number, treated as zero.
<to be read again>
\futurelet
l.9 \setlength{\arrayrulewidth}{1pt}\hline

! Illegal unit of measure (pt inserted).
<to be read again>
\futurelet
l.9 \setlength{\arrayrulewidth}{1pt}\hline

[1] (test2e.aux) )
(see the transcript file for additional information)
Output written on test2e.dvi (1 page, 484 bytes).
Transcript written on test2e.log.

----------------------------------------------------------------------

--
Martin Boyer http://www.robot.ireq.ca/Martin.Boyer/
Division Robotique mbo...@robot.ireq.ca
Institut de recherche d'Hydro-Quebec Telephone: +1 514 652-8412
Varennes, QC, Canada Fax: +1 514 652-1316

Alain Kessi

unread,
Mar 22, 1996, 3:00:00 AM3/22/96
to mbo...@robot.ireq.ca
Martin Boyer <mbo...@robot.ireq.ca> wrote:
>Does anyone know how to change the thickness (height) of *one* \hline
>in a tabular environment?

One easy way out is to define a command \hlinewd which takes an argument:

\makeatletter
\def\hlinewd#1{%
\noalign{\ifnum0=`}\fi\hrule \@height #1 \futurelet
\reserved@a\@xhline}
\makeatother

and use it as

\begin{tabular}{|l|r|} \hline
first & 1 \\ \hline

second & 2 \\ \hlinewd{5pt}


total & 3 \\ \hline
\end{tabular}

--
Alain Kessi (alain...@psi.ch)
at Paul Scherrer Institut, Zuerich, Switzerland


0 new messages