0

I'm learning how to do nice looking tables and I'm wondering why the below code produces an error "! Undefined control sequence. \adl@@cr ...tempdima \xdef \adl@rowsL {\adl@rowsL (\adl@colsL /\number \adl@... l.187 \end{xltabular}" and midrule etc stop working:

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage[margin=1in]{geometry}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{arydshln}
%\setlength\dashlinedash{0.5pt}
%\setlength\dashlinegap{1.5pt}
\usepackage{lscape}
\setlist{nolistsep}
\definecolor{blue}{HTML}{008ED7}
\definecolor{mygray}{gray}{0.75}
\definecolor{lightBlue}{HTML}{e5f7ff}
\renewcommand{\familydefault}{\sfdefault}
%\renewcommand{\arraystretch}{1.5}



\usepackage{xltabular}
\usepackage{booktabs}
\usepackage{adjustbox}
\newcolumntype{L}[1]{>{\hsize=#1\hsize\linewidth=\hsize}>{\raggedright\arraybackslash}X}
\newcolumntype{R}[1]{>{\hsize=#1\hsize\linewidth=\hsize}>{\raggedleft\arraybackslash}X}
\newcolumntype{C}[1]{>{\hsize=#1\hsize\linewidth=\hsize}>{\centering\arraybackslash}X}




\begin{document}

% Table with minipage, header colors, dashline
\begin{center}
\begin{tabularx}{\textwidth}[t]{XX}
\arrayrulecolor{blue}\hline
\rowcolor{lightBlue} \textbf{\textcolor{blue}{Goal 1 Eradicate Extreme Poverty}} & \\
\hline
Target 1.A Halve, between 1990 and 2015, the proportion of the people whose income is less than \$1 a day. & 
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[1.1] Proportion of population below \$1 purchasing power parity (PPP) a day$^a$
\item[1.2] Poverty Gap ratio [incidence x depth of poverty]
\item[1.3] Share of the poorest quintile in national consumption
\end{itemize} 
\end{minipage}\\

\arrayrulecolor{mygray}\hline

Target 1.B Achieve full and productive employment and decent work for all, including women and young people &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[1.4] Growth of GDP per person employed 
\item[1.5] Employment to population ratio
\item[1.6] Proportion of employed people living below \$1 (PP) a day
\item[1.7] Proportion of own-account and contribution family workers in total employment
\end{itemize} 
\end{minipage}\\

\hline

Target 1.C Halve, between 1990 and 2015, the proportion of people who suffer from hunger &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[1.8] Prevalence of underweight children under five years of age
\item[1.9] Proportion of population below minimum level of dietary energy consumption
\end{itemize}
\end{minipage}\\

\arrayrulecolor{blue}\hline
\rowcolor{lightBlue} \textbf{\textcolor{blue}{Goal 2 Achieve universal primary education}} & \\
\hline

Target 2.A Ensure that by 2015 children everywhere, boy and girls alike, will be able to complete a full course of primary schooling. &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[2.1] Net enrollment ratio in primary education
\item[2.2] Proportion of pupils starting grade 1 who reach last grade of primary education
\item[2.3] Literacy rate of 15- to 24-year-olds, women and men
\end{itemize}
\end{minipage}\\
\rowcolor{lightBlue} \multicolumn{2}{l}{%
\textbf{\textcolor{blue}{Goal 3 Promote gender equality and empower women}}} \\ \hdashline

Target 3.A Eliminate gender disparity in primary and secondary education, preferably by 2005, and in all levels of education no later than 2015 &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[3.1] Ratios of girls to boys in primary, secondary and tertiary education
\item[3.2] Share of women in wage employment in the non-agricultural sector.
\end{itemize} 
\end{minipage}
\end{tabularx}
\end{center}
%\end{landscape}


\newpage

% tabularx and longtable
\begin{xltabular}{\textwidth}{C{0.2}|C{0.4}|C{0.4}}
\caption{A sample long table.} \label{tab:long} \\
\toprule
\multicolumn{3}{c}{\textbf{Table}} \\
\multicolumn{1}{c}{\textbf{First column}} & \multicolumn{1}{c}{\textbf{Second column}} & \multicolumn{1}{c}{\textbf{Third column}} \\ 
\midrule 
%\endhead

One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
\end{xltabular}

\end{document}

1 Answer 1

2

To find out which packages are really in conflict with each other, let's start by making your code more minimal. Here's a version of your example code in which I removed everything (packages and contents) that are unrelated to the error message you get:

\documentclass{article}

\usepackage[table]{xcolor}
\usepackage{booktabs}
\usepackage{arydshln}

\usepackage{xltabular}


\begin{document}

\begin{xltabular}{\textwidth}{X|X|X}
\toprule 
One & abcdef ghjijklmn & 123.456778 \\
\end{xltabular}

\end{document}

If you now change the load order of the first three packages from

\usepackage[table]{xcolor}
\usepackage{booktabs}
\usepackage{arydshln}

to

\usepackage{booktabs}
\usepackage{arydshln}
\usepackage[table]{xcolor}

The above example compiles without any errors. Applying this change to your example code also results in a code that compiles without error messages.


Since you mention "I'm learning how to do nice looking tables": Here's a version of your first table that just makes use of the booktabs package in order to visually separate the individual goals and targets. I also used counters in order to get rid of manual numbering:

\documentclass{article}

\usepackage[margin=1in]{geometry}
\renewcommand{\familydefault}{\sfdefault}

\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{xltabular}

\newcolumntype{L}[1]{>{\hsize=#1\hsize\linewidth=\hsize}>{\raggedright\arraybackslash}X}

\newcounter{goal}
\setcounter{goal}{0}

\newlist{tabenum}{enumerate}{1}
\setlist[tabenum]{label*=\thegoal.\arabic*.,
                  leftmargin=*, 
                  nosep,
                  before=\begin{minipage}[t]{\hsize}, 
                  after=\end{minipage}}

\newcommand{\mygoalline}[1]{\multicolumn{2}{l}{Goal \refstepcounter{goal}\thegoal\enspace #1}}




\begin{document}


\noindent
\begin{tabularx}{\textwidth}{>{\hangindent=12pt}L{0.35}L{0.65}}
\toprule
%\multicolumn{2}{@{}l}{Goal \refstepcounter{goal}\thegoal\enspace Eradicate Extreme Poverty} \\
\mygoalline{Eradicate Extreme Poverty}\\
\midrule
Target \thegoal.A Halve, between 1990 and 2015, the proportion of the people whose income is less than \$1 a day. & 
\begin{tabenum}[series=goal1]
\item Proportion of population below \$1 purchasing power parity (PPP) a day$^a$
\item Poverty Gap ratio [incidence x depth of poverty]
\item Share of the poorest quintile in national consumption
\end{tabenum} 
\\
\addlinespace

Target \thegoal.B Achieve full and productive employment and decent work for all, including women and young people &

\begin{tabenum}[resume=goal1]
\item Growth of GDP per person employed 
\item Employment to population ratio
\item Proportion of employed people living below \$1 (PP) a day
\item Proportion of own-account and contribution family workers in total employment
\end{tabenum} 
\\
\addlinespace

Target \thegoal.C Halve, between 1990 and 2015, the proportion of people who suffer from hunger &
\begin{tabenum}[resume=goal1]
\item Prevalence of underweight children under five years of age
\item Proportion of population below minimum level of dietary energy consumption
\end{tabenum}\\

\midrule
\mygoalline{Achieve universal primary education}  \\
\midrule

Target \thegoal.A Ensure that by 2015 children everywhere, boy and girls alike, will be able to complete a full course of primary schooling. &

\begin{tabenum}
\item Net enrollment ratio in primary education
\item Proportion of pupils starting grade 1 who reach last grade of primary education
\item Literacy rate of 15- to 24-year-olds, women and men
\end{tabenum}
\\

\midrule
\mygoalline{Promote gender equality and empower women} \\ 
\midrule

Target \thegoal.A Eliminate gender disparity in primary and secondary education, preferably by 2005, and in all levels of education no later than 2015 &

\begin{tabenum}
\item Ratios of girls to boys in primary, secondary and tertiary education
\item Share of women in wage employment in the non-agricultural sector.
\end{tabenum}\\ 
\bottomrule
\end{tabularx}

\end{document}
1
  • Thanks a lot!!!
    – Math122
    May 28, 2022 at 10:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .