Graphics, Figures & TablesAdditional lines which are not supposed to be there

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
poeli
Posts: 19
Joined: Tue Mar 11, 2014 10:59 am

Additional lines which are not supposed to be there

Post by poeli »

screenforum.PNG
screenforum.PNG (18.12 KiB) Viewed 4488 times
Hi all,

I'm making some tables in my thesis, but have a problem (with all of them). All the lines are ok, except under the first column there is an additional two lines (see screenshot).
The code for this table is the following:

Code: Select all

\begin{center}

    \begin{tabular}{| l | l | l | l | l |}
    \hline
    Manufacterer & Diameter(inch) & Pitch (inch) & Number of blades & Weight (g) \\ \hline
    GWS & 12 & 4.5 & 2 & 12.56
     \\ \hline
    GWS & 10 & 4.5 & 2 & 7.92 \\ \hline
    GWS & 8 & 4.5 & 2 & 5.55 \\
    \hline
    APC & 10 & 4.5 & 2 & 14.25 \\
    \hline
    APC & 10 & 5.0 & 2 & 19.52   \\
    \hline
    APC & 10 & 6 & 4 & 35.58 \\
    \hline
    APC & 11 & 6 & 4 & 46.79 \\
\hline
APC & 10 & 6 & 2 & ?? \\
\hline
    \label{tabelprops}
           \end{tabular}\par
        
    \end{center}
Also, this table doesn't appear in my list of tables, none of my tables do. How can I fix these 2 problems?
Thanks,
Pieterjan

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Additional lines which are not supposed to be there

Post by Johannes_B »

There are some comments in the code. Please click on »Open in writelatex« just above the code to see the output.

Code: Select all

\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{showframe}
\begin{document}

\listoftables
\clearpage

How should the table appear in the list of tables? There is no
caption. Use a floating environment, so \LaTeX{} can decide for
itself where to best put the table. 

Remember, using vertical lines in tabular material is
discouraged, use horizontal lines economically. Please read the
documentation of package booktabs. Compare the tables, and have a
look at the spacing. Please think about what tables look like in the journals you have to read.

I also used package siunitx to align the
values in a more pleasing way.

Be careful, right now, the table is too wide, there is also a
warning in the log file.
\begin{table}[h]%JB: Do not use this in the real document, let 
	%latex do it's job
	\centering
	\caption{i am the caption of the table, sitting on top of it.}
	\begin{tabular}{lSSSS}
		\toprule
		Manufacturer & {Diameter (inch)} & {Pitch (inch)} & {Number of blades} & {Weight (g)} \\ 
		\midrule
		GWS & 12 & 4.5 & 2 & 12.56 \\
		GWS & 10 & 4.5 & 2 & 7.92 \\
		GWS & 8  & 4.5 & 2 & 5.55 \\
		APC & 10 & 4.5 & 2 & 14.25 \\
		APC & 10 & 5.0 & 2 & 19.52   \\
		APC & 10 & 6   & 4 & 35.58 \\
		APC & 11 & 6   & 4 & 46.79 \\
		APC & 10 & 6   & 2 & {??} \\
		\bottomrule
		\label{tabelprops}
	\end{tabular}
\end{table}



\begin{center}
	\begin{tabular}{| l | l | l | l | l |}
		\hline
		Manufacterer & Diameter(inch) & Pitch (inch) & Number of blades & Weight (g) \\ \hline
		GWS & 12 & 4.5 & 2 & 12.56 \\ \hline
		GWS & 10 & 4.5 & 2 & 7.92 \\ \hline
		GWS & 8 & 4.5 & 2 & 5.55 \\ \hline
		APC & 10 & 4.5 & 2 & 14.25 \\ \hline
		APC & 10 & 5.0 & 2 & 19.52   \\ \hline
		APC & 10 & 6 & 4 & 35.58 \\ \hline
		APC & 11 & 6 & 4 & 46.79 \\ \hline
		APC & 10 & 6 & 2 & ?? \\
		\label{tabelprops}
	\end{tabular}\par

\end{center}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
poeli
Posts: 19
Joined: Tue Mar 11, 2014 10:59 am

Re: Additional lines which are not supposed to be there

Post by poeli »

Thanks for the reply, as I understand, the \begin{table} is there to be able to set a caption (else the error caption must be placed in float). But when I do this (and end the table too obviously), my whole main file freezes and texmaker even shuts down automatically. I deleted the table things and now it compiles as normal again. Weird things, will look further myself first before posting on here.
Thanks for the right direction and solution!
poeli
Posts: 19
Joined: Tue Mar 11, 2014 10:59 am

Re: Additional lines which are not supposed to be there

Post by poeli »

Still am not able to add a caption. Anyone an idea why the freeze occurs?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Additional lines which are not supposed to be there

Post by Johannes_B »

Try distilling it down to a minimal working example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply