Graphics, Figures & Tablesproblem with lines in table / How to…{longtable}

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

problem with lines in table / How to…{longtable}

Post by fja »

Hi, I'm doing some tables, but I get a problem in the output with ALL the tables (see the attached file: two vertical lines at the top of the first column). The code I'm using:

Code: Select all

\documentclass[letterpaper,12pt,oneside]{book}%memoir
\usepackage[spanish,es-lcroman]{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage{color}
\usepackage[all]{xy}
\usepackage{setspace,mathrsfs,amsfonts,amssymb}
\usepackage{anysize}
\usepackage{tocbibind}
\usepackage{lscape}
\usepackage{multirow,array,paralist,longtable}
\marginsize{4cm}{2.5cm}{4cm}{2.5cm}
\usepackage[version=3]{mhchem}
\usepackage[pagestyles]{titlesec}

\begin{document}
…
\begin{table}[h]
\begin{center}
\begin{tabular}{|l*{3}{|c}|}\\ \hline
\multirow{2}{*}{Factor Salival}&\multicolumn{3}{c|}{Riesgo}\\ \cline{2-4}
&Bajo&Moderado&Alto\\\hline
Flujo salival&$\geq$1ml/minuto&0,7 $-$ 1 ml/minuto&$\leq$0,7 ml/minuto\\ \hline
Capacidad buffer&pH 5-7&pH 4-5&pH $<$ 4\\ \hline
\end{tabular}
\caption{Factores salivales para el riesgo de caries}
\label{tab:fact_salival}
\end{center}
\end{table}
… \end{document}
In the other hand, I have a very long tables, and they are far extense than a page, so I decided to use the \longtable environment. But, the document is written with 2 spaces betwen lines, and inside the tables the text must be in simple space. If I use:

Code: Select all

…\renewcommand{\baselinestretch}{2}…
\begin{document}
\begin{table}
\begin{center}
\begin{tabular}{|p{2cm}|p{6cm}|p{6cm}|}\\\hline
…
the text'll be in a single space (that's the way I need it). But I have to cut the table in an arbitrary position to get the table in 2 pages; If I use the

Code: Select all

\begin{longtable}
I can't use the

Code: Select all

\begin{tabular}{|l*{3}{|c}|}
, and I also need it, because the table is only text, like text boxes.
So, I need help!! I need a long table, bigger than one page, with an automatic cutting-system, and with text in simple spacing between lines
Attachments
Table pic.
Table pic.
table.png (17.19 KiB) Viewed 4190 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

problem with lines in table / How to…{longtable}

Post by gmedina »

Hi,

I'm quite busy right now, but the first issue can be solved simply by replacing

Code: Select all

\begin{tabular}{|l*{3}{|c}|}\\ \hline
with

Code: Select all

\begin{tabular}{|l*{3}{|c}|} \hline
(i.e., by deleting a superfluous \\ command).

For the second issue I would suggest you to use some of the features provided by the setspace package, instead of manually changing \baselinestretch.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

problem with lines in table / How to…{longtable}

Post by php1ic »

I'm not exactly sure what you mean by "simple space", but I think you mean single spacing. If you use the setspace package you can put the table inside that environment

Code: Select all

\usepackage{setspace}
...
\begin{spacing}{1.0}
\begin{tabular}
...
\end{tabular}
\end{spacing}
fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

Re: problem with lines in table / How to…{longtable}

Post by fja »

Ok, thanks you both for yours answers!.
gmedina, thanks you (again). It works!
Post Reply