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

tabular: broken vertical lines

659 views
Skip to first unread message

Matias

unread,
Feb 16, 2011, 5:14:04 PM2/16/11
to
The bug with the included code is: the vertical lines are broken
at their intersection with the horizontal lines. I read somewhere
this is fixed with the array package. But, when I used the array
package, the problem was not fixed. Could some please inform me
about the correct solution.

thx.,
matt.

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

\documentclass[10pt,dvips,twocolumn]{article}
\topmargin -0.50in
\textheight 8.5in
\textwidth 6.25in
\oddsidemargin -0.010in
%\oddsidemargin -0.10in
%\evensidemargin 0.75in
\usepackage{times}
\usepackage{courier}
\usepackage{epsfig}
\usepackage{psfig,latexsym}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{ccaption}
\usepackage{hyphenat}
%\usepackage{fancyheadings}
\usepackage{fancyhdr}
\usepackage{url}
\usepackage{array}
\usepackage{setspace}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{titling}
\usepackage{threeparttable}
%\usepackage{tabls}
\begin{document}
\begin{tabular}{ >{\centering}p{0.8in} | >{\centering}p{0.4in} |
>{\centering}p{0.4in} | >{\centering\arraybackslash}p{0.4in} }
\toprule
&\multicolumn{3}{c}{daytime} \\
&first&second&third \\ \midrule
monday&1pm&2pm&3pm\\
tuesday&2pm&3pm&4pm\\
wednesday&1pm&2pm&3pm\\\bottomrule
\end{tabular}
\end{document}

Enrico Gregorio

unread,
Feb 16, 2011, 5:47:49 PM2/16/11
to
Matias <matia...@gmail.com> wrote:

> The bug with the included code is: the vertical lines are broken
> at their intersection with the horizontal lines. I read somewhere
> this is fixed with the array package. But, when I used the array
> package, the problem was not fixed. Could some please inform me
> about the correct solution.
>
> thx.,
> matt.
>
> --------------------------------------------------------------------
>
> \documentclass[10pt,dvips,twocolumn]{article}

> ...


> \usepackage{booktabs}
> \usepackage{titling}
> \usepackage{threeparttable}
> %\usepackage{tabls}
> \begin{document}
> \begin{tabular}{ >{\centering}p{0.8in} | >{\centering}p{0.4in} |
> >{\centering}p{0.4in} | >{\centering\arraybackslash}p{0.4in} }
> \toprule
> &\multicolumn{3}{c}{daytime} \\
> &first&second&third \\ \midrule
> monday&1pm&2pm&3pm\\
> tuesday&2pm&3pm&4pm\\
> wednesday&1pm&2pm&3pm\\\bottomrule
> \end{tabular}
> \end{document}

The booktabs package, which provides \toprule, \midrule
and \bottomrule, is not compatible with vertical rules.
His author thinks that vertical rules must never be used
in tables; he's not the only one. :)

Ciao
Enrico

GL

unread,
Feb 17, 2011, 3:14:27 AM2/17/11
to
Le 16/02/2011 23:14, Matias a écrit :
> The bug with the included code is: the vertical lines are broken
> at their intersection with the horizontal lines. I read somewhere
> this is fixed with the array package. But, when I used the array
> package, the problem was not fixed. Could some please inform me
> about the correct solution.

Besides, tabls is not compatible with the array package.

Example with tabu instead: (comparison with you example)

\documentclass[10pt,twocolumn]{article}


\topmargin -0.50in
\textheight 8.5in
\textwidth 6.25in
\oddsidemargin -0.010in

\usepackage{array}
\usepackage{booktabs}
\usepackage{tabu}

% ------------------------------------------------------------
\begin{document}

{% (group to make \tabulinesep local)
\tabulinesep=1mm
\begin{tabu}spread 0pt {X[2c]|X[c]|X[c]|X[c]} \tabucline[\heavyrulewidth]-
&\multicolumn3c{daytime} \\
&first &second &third \\ \tabucline-
monday &1pm &2pm &3pm \\
tuesday &2pm &3pm &4pm \\
wednesday &1pm &2pm &3pm \\
\tabucline[\heavyrulewidth]-
\end{tabu}
}

\vskip.5cm
\hrule
\vskip.5cm

\begin{tabular}{ >{\centering}p{0.8in} | >{\centering}p{0.4in} |
>{\centering}p{0.4in} | >{\centering\arraybackslash}p{0.4in} }
\toprule
&\multicolumn{3}{c}{daytime} \\
&first&second&third \\ \midrule
monday&1pm&2pm&3pm\\
tuesday&2pm&3pm&4pm\\
wednesday&1pm&2pm&3pm\\\bottomrule
\end{tabular}
\end{document}

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


Leland Hovey

unread,
Feb 22, 2011, 3:22:25 PM2/22/11
to
Thanks for the suggestion about tabu.sty, it works pretty good.
Secondly, how do I setup footnotes with tabu?be Regular footnotes
didn't work, nor did
the threeparttable workaround.

thanks,
matias

GL

unread,
Feb 23, 2011, 3:47:11 AM2/23/11
to

??? I thought (and tested) tabu worked with footnotes, and i compiled
some examples with threeparttable successfully...

Please, first check your version against CTAN (current
version is 2.5 2011/02/19
http://dante.ctan.org/tex-archive/macros/latex/contrib/tabu/tabu.pdf)

Then please, let me see a minimal example if something doesn't work
properly.

Regards.

Donald Arseneau

unread,
Feb 23, 2011, 6:11:50 AM2/23/11
to
Leland Hovey <leland...@gmail.com> writes:

tabu claims to support regular (page) footnotes.

I think I can update threeparttable to work with tabu easily.

In your document try a quick test, where you have

\begin{threepartable}
\begin{tabu}...

try instead

\begin{threepartable}
\makeatletter
\TPT@hookin{tabu}%
\begin{tabu}...


--
Donald Arseneau as...@triumf.ca

Matias

unread,
Feb 26, 2011, 2:36:42 PM2/26/11
to
You were right, that did work for a standalone tabu. But, (I
neglected to mention) my tabu is within a subfigure.
When this is the case, it does not work correctly.

M.

GL

unread,
Feb 26, 2011, 3:15:47 PM2/26/11
to

I would be grateful to have a minimal example please.

Yours sincerely.

Matias

unread,
Feb 27, 2011, 11:10:34 AM2/27/11
to
% Footnote works as a standalone but not as part of a subfigure. See
% below.
% m.
%
%--------------------------------------------------------------------
%
\documentclass[10pt,dvips,twocolumn]{article}

\topmargin -0.50in
\textheight 8.5in
\textwidth 6.25in
\oddsidemargin -0.010in
\usepackage{times}
\usepackage{epsfig}
\usepackage{subfigure}
\usepackage{array}
\usepackage{booktabs}
\usepackage{titling}
\usepackage{threeparttable}
\usepackage{tabu}
% ------------------------------------------------------------
% ------------------------------------------------------------
\begin{document}

\begin{figure}[h]
\centering
{%\fontsize{\figcapsize}{\figcapsize}\selectfont
\tabulinesep=1mm
\centering

\subfigure[Subfigure title.]
{


{% (group to make \tabulinesep local)

\begin{threeparttable}
\makeatletter
\TPT@hookin{tabu}%


\tabulinesep=1mm
\begin{tabu}spread 0pt {X[2c]|X[c]|X[c]|X[c]}
\tabucline[\heavyrulewidth]-
&\multicolumn3c{daytime} \\
&first &second &third \\
\tabucline-
monday &1pm &2pm &3pm \\
tuesday &2pm &3pm &4pm \\

wednesday &1pm\tnote{1} &2pm &3pm \\


\tabucline[\heavyrulewidth]-
\end{tabu}

\begin{tablenotes}
\item [1] This is the footnote.
\end{tablenotes}
\end{threeparttable}
}
}
}
\end{figure}
\end{document}

GL

unread,
Feb 27, 2011, 2:32:38 PM2/27/11
to
Le 27/02/2011 17:10, Matias a écrit :
> % Footnote works as a standalone but not as part of a subfigure. See
> % below.
> % m.

This will be fixed in the next release. Coming soon: I fight against
the leaders...

I made the patch for \TPT@hookin but i'm not used to the dvips option.
I usually compile under pdfTeX. With hyperref and
[referable]{threeparttablex} support for linked table notes will be
provided for tabu and longtabu.

Ensuring compatibility with other package is a long job...

Best regards.

0 new messages