I've been looking into this, and I have encountered two main "solutions":
\usepackage{arydshln}
As decribed here.
And this one:
\usepackage{dashrule}
As described in this other post.
However, since I'm loading these packages:
\usepackage{array}
\usepaclage{tabularx}
\usepackage{longtable}
\usepackage{tabu}
It seems I can't use neither arydshln
nor dashline
.
Any idea why this is happening? How can I get a dashed horizontal line inside my tabularx
which is at the same time- inside a table
environment?
This is what I have:
\documentclass{article}
\usepackage{multirow}
\usepackage{array}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{tabu}
\begin{document}
Hello.
\begin{longtabu}{l p{0.8\linewidth}}
WHO & \hspace{5mm} World Health Organization\\[1mm]
GDP & \hspace{5mm} Gross Domestic Product\\[1mm]
PPP & \hspace{5mm} Purchasing Power Parities\\[1mm]
\end{longtabu}
\begin{table}\tiny
\caption{Muscles of the thigh}
\newcolumntype{Y}{>{\raggedright\arraybackslash}X}
\begin{tabularx}{\textwidth}{YYYYY}
Muscle & Origin & Insertion& Nerve & Action \\
\firsthline\\
\textbf{Anterior Compartment} & & & & \\[3mm]
Quadriceps femoris &
Rectus Femoris: anterior inferior iliac spine. Vastus Lateralis: greater trochanter and linea aspera of femur. Vastus Intermedius: body of femur. Vastus Medialis: linea aspera of femur &
Patella and onto tibial tuberosity through patellar ligament &
Femoral &
Extends knee; rectus femoris also flexes hip\\\\
Sartorius &
Anterior superiro iliac spine &
Medial side of tibial tuberosity &
Femoral &
Flexes hip and knee; rotates thigh laterally and leg medially\\\\
\hline\\% I want this line to be dashed
\textbf{Medial Compartment} & & & & \\[3mm]
Adductor brevis &
Pubis &
Pectineal line and linea aspera of femur &
Obturator &
Adducts, laterally rotates thigh; flexes hip\\\\
Adductor longus &
Pubis &
Linea aspera of femur &
Obturator &
Adducts, laterally rotates thigh; flexes hip\\\\
\lasthline\\
\end{tabularx}
\label{tab:ThighMuscles2}
\end{table}
\end{document}
Now, if I use \dashrule
where the \hline
is (after loading the dashrule
package, of course), I get an Undefined control sequence error.
If I use the \hdashline
(of the arydshln
package) I get 101 errors which point me to other tables in my document, so I'm guessing it has something to do with incompatibility with the other packages I loaded.
\documentclass
and end with\end{document}
so that other people can run it, and shows which packages you have loaded. – David Carlisle Apr 2 '13 at 10:50article
class that includes that table and that uses no packages that are not relevant to the question. So you should make one. – David Carlisle Apr 2 '13 at 10:57