Hi I want to make an additional line in my document. The problem is that it tells me \hline is a "undefined control sequence"...

I tried to create a small example file but the problem is that I use a large template from our University and I cannot get the small file running. It would be something like this: (As I didn't know exactly which packages are important for this problem I just copied them all, I'm sorry)

\documentclass[11pt,a4paper,english,oneside,final]{book} %To exclude pictures - "draft", to include pictures - "final" (LUCA)
\usepackage{etex} %Because of many packages --> Extended TeX.
\usepackage[left=1in, right=1in]{geometry} %Helps to structure the paper layout.
\usepackage[Lenny]{fncychap} %Design of the thesis.
\usepackage[utf8]{inputenc} %Due to vowels.
\usepackage[british]{babel} %Define the language style.
\usepackage{dsfont} %Nice style for the indicator function.
\usepackage{fancyhdr} %To customize the headers and footers.
\usepackage{booktabs} %In case you need \cmidrule or \addlinespace in tables.
\usepackage[hang,bottom,stable,multiple]{footmisc} %Style of footnotes.
\usepackage{appendix} %For the \appendixpage command.
%Load some mathematical packages.

\usepackage{etoolbox} %To remove the page number on \appendixpage.
\usepackage{amsthm} %For theorems, definitions etc.
\usepackage{thmtools} %For theorems, definitions etc.
\usepackage{setspace} %Use double spacing.
\usepackage{lipsum} %For the \lipsum command to generate a text.
\usepackage{datetime} %For the specification of the date.
%\usepackage{tocloft} %The ToC, LoF and LoT each appear not necessarily on a new page.
\usepackage{graphicx,listings,xcolor,textcomp} %For the graphics, listings etc.
\usepackage{mcode} %To implement a Matlab code.
\usepackage[margin=10pt, font=small, labelfont=bf, labelsep=endash]{caption} %Customize the captions.
\usepackage{chngcntr} %To use counterwithout.
\usepackage{epstopdf} %For inserting .eps files into the document.
\usepackage{pdfpages} %For inserting .pdf files as a whole page (LUCA)
\usepackage{hyperref} %Must be loaded at the end.
\usepackage{xparse} %Load for \NewDocumentCommand command.
\usepackage{cleveref} %For the command \cref, load after hyperref.
\usepackage{arydshln} %Due to the capability to draw horizontal/vertical dash-lines.
\usepackage{array,hhline} %To create tables and matrices.
\usepackage{rotating} %To rotate a table.
\usepackage{tabularx} %An extended version of tabular.

\usepackage{amssymb,amsmath} %Um Mathematische Formeln schreiben zu können
%\usepackage{apacite} %Um APA Style zu verwenden --> Funktioniert nicht. Man muss dann zuerst natbib rauskommentieren aber wohl auch noch viel in der .bib Datei anpassen...!
\usepackage[sort,round]{natbib} %For the bibliography.

%Setup of the reference links.

%Define some reasonable margins.

\bibliographystyle{abbrvnat} %Reference style.
\allowdisplaybreaks[1] %Page breaks of equations are allowed, but avoided if possible. 2-4 more relaxed.

%New command for the UZH logo.

%New command for the differential d to have an ordinary d.

%Remove page number on \appendixpage. Use the package 'etoolbox'.

%Declare Definitions, Theorems etc.
\declaretheorem[style=definition,qed=$\blacktriangleleft$, numberwithin=chapter]{remark} %additional options; numberwithin=,..., see 'Thmtools' Users’ Guide

%Readjust the numbering.

  \caption{Add caption}
    Time  & Returns & Value \\
    \multicolumn{1}{l}{0} &       & \multicolumn{1}{l}{100} \\
    \multicolumn{1}{l}{1} & 60\%  & \multicolumn{1}{l}{160} \\
    \multicolumn{1}{l}{2} & -30\% & \multicolumn{1}{l}{112} \\ 
    \multicolumn{2}{l}{arithmetic mean return} & 15.00\% \\
    \multicolumn{2}{l}{geometric mean return} & 5.83\% \\
    \multicolumn{2}{l}{variance of the returns} & 20.25\% \\

When I drop the "\hline" it works perfectly fine in my actual tex file. But when I add \hline I get the error.

I think \usepackage{tabularx} is important.

Could someone help me?


  • The exact error message is: (line 12 in the original tex file) ! Undefined control sequence. \adl@hline ...mpcnta \xdef \adl@rowsL {\adl@rowsL (#1/\number \@tempcnta );}... l.12 \hline – Luca Lengwiler Jun 22 '15 at 12:21
  • 1
    Welcome to TeX.SE! Please provide a full MWE, narrowing it down to the relevant bit to reproduce the problem. As is, it's very long. Also, you can properly format it by clicking on edit, then selecting the whole code in your question and then clicking on the {} icon. – Alenanno Jun 22 '15 at 12:24
  • Please, add to your question the precise error message, with the same line breaks. – egreg Jun 22 '15 at 12:51

You should load tabularx before arydshln.

Also load hyperref and cleveref last.

  • A rare bird indeed -- an egreg answer without a single upvote for an entire month after it's been posted! No longer... :-) – Mico Jul 22 '15 at 13:53

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.