4

Hi I am creating a table but am having trouble inserting a horizontal line at the base of my line. My code is:

\documentclass[11pt, oneside, a4paper]{book}

\usepackage{color}
\usepackage{graphicx}
\usepackage{float}
\usepackage{fixltx2e}
\usepackage{amsmath} 
\usepackage[top=2cm, bottom=2cm, left=1.5in, right=2cm]{geometry}
\usepackage{setspace}
\usepackage{rotating} 
\usepackage{longtable}
\usepackage{lscape}
\usepackage[justification=centering]{caption}
\usepackage{arydshln}
\usepackage[]{natbib}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{array}
\pagestyle{fancy}
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyhead[R]{\thepage}
\fancyfoot{}
\linespread{1.3}

\begin{document}

\begin{table}[h]
\small
\centering
\begin{tabular} { >{\centering\arraybackslash} m{4cm} | >{\centering\arraybackslash} m{4cm} | >{\centering\arraybackslash} m{2cm} | >{\centering\arraybackslash} m{2cm} }
\bfseries{Model} & \bfseries{Description} & \bfseries{x} & \bfseries{x} \\ \hline
x & x & x& x\\ 
\end{tabular}
\caption{x}
\label{x}
\end{table}

\end{document}

when I take the \hline command out it works and appears to be the problem, how do I get the horizontal line to be drawn?

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – karlkoeller Sep 16 '13 at 15:53
  • Just a remark: use \textbf{Model} instead of \bfseries{Model}. \bfseries is a switch and has to be used like {\bfseries Model} – karlkoeller Sep 16 '13 at 16:26
8

There is no error in your code.

You just have to load the arydshln package after array and longtable, as stated in its manual:

Only one caution given to users of array (v2.3m or later) and longtable (v4.10 or later) packages, included in Standard LaTeX Tools Bundle, and colortab and colortbl package is that arydshln has to be loaded after array, longtable, colortab and/or colortbl done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.