0

I am getting extra alignment tab has been changed to \cr after I changed to ltablex package. I don't have this problem if I use tabularx package.

This is my MWE, Error is thrown at line#46:

%!TEX TS-Program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass{article}

\usepackage{graphics}
\usepackage{fancyhdr}
\usepackage{ctable}
\usepackage{array}
\usepackage{ltablex}
\usepackage[margin=2.5cm]{geometry}

\setlength\parindent{0pt}

\newcommand{\sectionheader}[1] {
\textbf{#1}

\rule{\textwidth}{6pt}
}

\newcommand\zcolumn[1]{%
{\begin{tabular}{c}#1\end{tabular}\linebreak[0]}}

\setlength{\heavyrulewidth}{0.12em}

\pagenumbering{arabic}
\pagestyle{fancy}
\lhead{Patient Name: Claire  Roberts}
\rhead{\thepage}
\cfoot{}
\keepXColumns
\begin{document}

\sectionheader{PATIENT INFORMATION}
\begin{tabularx}{\textwidth}{lX}
Birth Date: & 10/10/69 \\
 Gender: & F \\
 \end{tabularx}

\sectionheader{CONTACT INFORMATION}
\begin{tabularx}{\textwidth}{lX}
Phone: & 206.555.1212 \\
Email: & claire@patient.com \\
Address: & {\begin{tabularx}{\textwidth}{l}7000 Central Ave NE\\default location
line2\\Minneapolis MN 55432\\ \end{tabularx}}
\end{tabularx}
\bigskip
 \newpage

\sectionheader{SYMPTOMS}

\begin{tabularx}{\textwidth}{lX}
\textbf{PERCEPTION}\\
SATISFACTION &
\begin{raggedright}
\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ 2}
\zcolumn{6/6/16 \\ -}
\zcolumn{6/7/16 \\ 2}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}
\\
\hline
\textbf{VOID}\\


    AWAKE &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ 5}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ -}
\zcolumn{6/6/16 \\ 2}
\zcolumn{6/7/16 \\ 1}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\SLEEPING &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ 5}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ 1}
\zcolumn{6/6/16 \\ -}
\zcolumn{6/7/16 \\ -}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\URGENCY &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ 2}
\zcolumn{6/5/16 \\ -}
\zcolumn{6/6/16 \\ -}
\zcolumn{6/7/16 \\ -}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\
\hline
\textbf{UR}\\


    UR\_LEAK\_AMOUNT &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ -}
\zcolumn{6/6/16 \\ Moderate}
\zcolumn{6/7/16 \\ -}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\TOTAL &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ 1}
\zcolumn{6/6/16 \\ -}
\zcolumn{6/7/16 \\ -}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\
\hline
\textbf{BM}\\


    AWAKE &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ -}
\zcolumn{6/6/16 \\ -}
\zcolumn{6/7/16 \\ 3}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\SLEEPING &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ -}
\zcolumn{6/6/16 \\ 5}
\zcolumn{6/7/16 \\ -}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\SOIL\_AMOUNT &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ -}
\zcolumn{6/6/16 \\ -}
\zcolumn{6/7/16 \\ -}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\
\hline
\textbf{BOWEL}\\


    AMOUNT &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ 6}
\zcolumn{6/5/16 \\ -}
\zcolumn{6/6/16 \\ 5}
\zcolumn{6/7/16 \\ -}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\TOTAL &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ 8}
\zcolumn{6/6/16 \\ -}
\zcolumn{6/7/16 \\ 9}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\
\hline
\textbf{PADS}\\


    TOTAL &

\begin{raggedright}



\zcolumn{5/31/16 \\ -}
\zcolumn{6/1/16 \\ -}
\zcolumn{6/2/16 \\ -}
\zcolumn{6/3/16 \\ -}
\zcolumn{6/4/16 \\ -}
\zcolumn{6/5/16 \\ 9}
\zcolumn{6/6/16 \\ -}
\zcolumn{6/7/16 \\ 8}
\zcolumn{6/8/16 \\ -}
\zcolumn{6/9/16 \\ -}
\zcolumn{6/10/16 \\ -}
\zcolumn{6/11/16 \\ -}
\zcolumn{6/12/16 \\ -}
\zcolumn{6/13/16 \\ -}
\zcolumn{6/14/16 \\ -}
\zcolumn{6/15/16 \\ -}
\end{raggedright}

\\
\hline

\end{tabularx}
\newpage


\bigskip

\end{document}

below is the code around line#46:

\sectionheader{CONTACT INFORMATION}
\begin{tabularx}{\textwidth}{lX}
Phone: & 206.555.1212 \\
Email: & claire@patient.com \\
Address: & {\begin{tabularx}{\textwidth}{l}7000 Central Ave NE\\default location
line2\\Minneapolis MN 55432\\ \end{tabularx}}
\end{tabularx} % line#46
1

For some reason, the nested tabularx don't work. I replaced them with a \makecell command and re-defined the \zcolumn command, so that the second line (mostly a hyphen,that I changed to a more relevant endash) be a optional argument. This results in a simpler code. I added some padding between groups of rows, and replaced the \hlines with \midrules.

%!TEX TS-Program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass{article}

\usepackage{graphics}
\usepackage{fancyhdr}
\usepackage{ctable}
\usepackage{url}
\usepackage{array, booktabs, makecell}
\usepackage{ltablex}
\usepackage[margin=2.5cm]{geometry}

\setlength\parindent{0pt}

\newcommand{\sectionheader}[1] {
\textbf{#1}

\rule{\textwidth}{6pt}
}

%\newcommand\zcolumn[1]{%
%{\begin{tabular}{c}#1\end{tabular}\linebreak[0]}}
\newcommand\zcolumn[2][\textendash]{\makecell[tc]{#2\\#1}}
\setlength{\heavyrulewidth}{0.12em}

\pagenumbering{arabic}
\pagestyle{fancy}
\lhead{Patient Name: Claire Roberts}
\rhead{\thepage}
\cfoot{}
\keepXColumns

\begin{document}

\sectionheader{PATIENT INFORMATION}
\begin{tabularx}{\textwidth}{lX}
Birth Date: & 10/10/69 \\
 Gender: & F \\
 \end{tabularx}

\sectionheader{CONTACT INFORMATION}
\begin{tabularx}{\textwidth}{lX}
Phone: & 206.555.1212 \\
Email: & \url{claire@patient.com} \\[1ex]
Address: & \makecell[lt]{7000 Central Ave NE\\default location
line2\\Minneapolis MN 55432}
\end{tabularx}
\bigskip
 \newpage

\sectionheader{SYMPTOMS}
\setlength\tabcolsep{5pt}
\begin{tabularx}{\textwidth}{@{}l*{8}{X}}
\\\midrule
\endfoot
\\\bottomrule
\endlastfoot
\textbf{PERCEPTION} \\[1ex] 
SATISFACTION
 & \zcolumn{5/31/16}
 & \zcolumn{6/1/16}
 & \zcolumn{6/2/16}
 & \zcolumn{6/3/16}
 & \zcolumn{6/4/16}
 & \zcolumn[2]{6/5/16}
 &  \zcolumn{6/6/16}
  & \zcolumn[2]{6/7/16}\\
  \addlinespace
  &  \zcolumn{6/8/16}
 & \zcolumn{6/9/16}
 & \zcolumn{6/10/16}
 & \zcolumn{6/11/16}
 & \zcolumn{6/12/16}
 & \zcolumn{6/13/16}
& \zcolumn{6/14/16}
 & \zcolumn{6/15/16} \\
\midrule
\addlinespace
\textbf{VOID}\\[1ex]  
AWAKE
 &\zcolumn{5/31/16}
 & \zcolumn{6/1/16}
 & \zcolumn{6/2/16}
 & \zcolumn[5]{6/3/16}
 & \zcolumn{6/4/16}
 & \zcolumn{6/5/16}
 & \zcolumn[2]{6/6/16}
 & \zcolumn[1]{6/7/16}\\
 \addlinespace
 & \zcolumn{6/8/16}
 & \zcolumn{6/9/16}
 & \zcolumn{6/10/16}
 & \zcolumn{6/11/16}
 & \zcolumn{6/12/16}
 & \zcolumn{6/13/16}
 & \zcolumn{6/14/16}
 & \zcolumn{6/15/16}\\[5ex]
SLEEPING 
& \zcolumn{5/31/16}
 & \zcolumn{6/1/16}
 & \zcolumn[5]{6/2/16}
 & \zcolumn{6/3/16}
 & \zcolumn{6/4/16}
 & \zcolumn[1]{6/5/16}
 & \zcolumn{6/6/16}
 & \zcolumn{6/7/16}\\
 \addlinespace
 & \zcolumn{6/8/16}
 & \zcolumn{6/9/16}
 & \zcolumn{6/10/16}
 & \zcolumn{6/11/16}
 & \zcolumn{6/12/16}
 & \zcolumn{6/13/16}
 & \zcolumn{6/14/16}
 & \zcolumn{6/15/16}\\[5ex]
URGENCY 
& \zcolumn{5/31/16}
 & \zcolumn{6/1/16}
 & \zcolumn{6/2/16}
 & \zcolumn{6/3/16}
 & \zcolumn[2]{6/4/16}
 & \zcolumn{6/5/16}
 & \zcolumn{6/6/16}
 & \zcolumn{6/7/16} \\
 \addlinespace
 & \zcolumn{6/8/16}
 & \zcolumn{6/9/16}
 & \zcolumn{6/10/16}
 & \zcolumn{6/11/16}
 & \zcolumn{6/12/16}
 & \zcolumn{6/13/16}
 & \zcolumn{6/14/16}
 & \zcolumn{6/15/16} \\
\midrule
\addlinespace
\textbf{UR}\\[1ex]
 UR\_LEAK\_AMOUNT
 & \zcolumn{5/31/16}
 & \zcolumn{6/1/16}
 & \zcolumn{6/2/16}
 & \zcolumn{6/3/16}
 & \zcolumn{6/4/16}
 & \zcolumn{6/5/16}
 & \zcolumn[\footnotesize Moderate]{6/6/16}
 & \zcolumn{6/7/16} \\
 \addlinespace
 & \zcolumn{6/8/16}
 & \zcolumn{6/9/16}
 & \zcolumn{6/10/16}
 & \zcolumn{6/11/16}
 & \zcolumn{6/12/16}
 & \zcolumn{6/13/16}
 & \zcolumn{6/14/16}
 & \zcolumn{6/15/16}\\[5ex]
TOTAL
 & \zcolumn{5/31/16}
& \zcolumn{6/1/16}
& \zcolumn{6/2/16}
& \zcolumn{6/3/16}
& \zcolumn{6/4/16}
& \zcolumn[1]{6/5/16}
& \zcolumn{6/6/16}
& \zcolumn{6/7/16} \\
 \addlinespace
& \zcolumn{6/8/16}
& \zcolumn{6/9/16}
& \zcolumn{6/10/16}
& \zcolumn{6/11/16}
& \zcolumn{6/12/16}
& \zcolumn{6/13/16}
& \zcolumn{6/14/16}
& \zcolumn{6/15/16} \\
\midrule
\addlinespace
\textbf{BM}\\[1ex]
 AWAKE
 & \zcolumn{5/31/16}
 & \zcolumn{6/1/16}
 & \zcolumn{6/2/16}
 & \zcolumn{6/3/16}
 & \zcolumn{6/4/16}
 & \zcolumn{6/5/16}
 & \zcolumn{6/6/16}
 & \zcolumn[3]{6/7/16} \\
 \addlinespace
 & \zcolumn{6/8/16}
 & \zcolumn{6/9/16}
 & \zcolumn{6/10/16}
 & \zcolumn{6/11/16}
 & \zcolumn{6/12/16}
 & \zcolumn{6/13/16}
 & \zcolumn{6/14/16}
 & \zcolumn{6/15/16} \\[5ex]
SLEEPING
 & \zcolumn{5/31/16}
 & \zcolumn{6/1/16}
& \zcolumn{6/2/16}
& \zcolumn{6/3/16}
& \zcolumn{6/4/16}
& \zcolumn{6/5/16}
& \zcolumn[5]{6/6/16}
& \zcolumn{6/7/16} \\
\addlinespace
& \zcolumn{6/8/16}
& \zcolumn{6/9/16}
& \zcolumn{6/10/16}
& \zcolumn{6/11/16}
& \zcolumn{6/12/16}
& \zcolumn{6/13/16}
& \zcolumn{6/14/16}
& \zcolumn{6/15/16} \\[5ex]
SOIL\_AMOUNT
& \zcolumn{5/31/16}
& \zcolumn{6/1/16}
& \zcolumn{6/2/16}
& \zcolumn{6/3/16}
& \zcolumn{6/4/16}
& \zcolumn{6/5/16}
& \zcolumn{6/6/16}
& \zcolumn{6/7/16} \\
\addlinespace
& \zcolumn{6/8/16}
& \zcolumn{6/9/16}
& \zcolumn{6/10/16}
& \zcolumn{6/11/16}
& \zcolumn{6/12/16}
& \zcolumn{6/13/16}
& \zcolumn{6/14/16}
& \zcolumn{6/15/16} \\
\midrule
\addlinespace
\textbf{BOWEL}\\
 AMOUNT
& \zcolumn{5/31/16}
& \zcolumn{6/1/16}
& \zcolumn{6/2/16}
& \zcolumn{6/3/16}
& \zcolumn{6/4/16 \\ 6}
& \zcolumn{6/5/16}
& \zcolumn{6/6/16 \\ 5}
& \zcolumn{6/7/16} \\
\addlinespace
& \zcolumn{6/8/16}
& \zcolumn{6/9/16}
& \zcolumn{6/10/16}
& \zcolumn{6/11/16}
& \zcolumn{6/12/16}
& \zcolumn{6/13/16}
& \zcolumn{6/14/16}
& \zcolumn{6/15/16} \\[5ex]
TOTAL
& \zcolumn{5/31/16}
& \zcolumn{6/1/16}
& \zcolumn{6/2/16}
& \zcolumn{6/3/16}
& \zcolumn{6/4/16}
& \zcolumn[8]{6/5/16}
& \zcolumn{6/6/16}
& \zcolumn[9]{6/7/16} \\[5ex]
& \zcolumn{6/8/16}
& \zcolumn{6/9/16}
& \zcolumn{6/10/16}
& \zcolumn{6/11/16}
& \zcolumn{6/12/16}
& \zcolumn{6/13/16}
& \zcolumn{6/14/16}
& \zcolumn{6/15/16} \\
\midrule
\addlinespace
\textbf{PADS}\\
 TOTAL 
& \zcolumn{5/31/16}
& \zcolumn{6/1/16}
& \zcolumn{6/2/16}
& \zcolumn{6/3/16}
& \zcolumn{6/4/16}
& \zcolumn[9]{6/5/16}
& \zcolumn{6/6/16}
& \zcolumn[8]{6/7/16}\\
\addlinespace
& \zcolumn{6/8/16}
& \zcolumn{6/9/16}
& \zcolumn{6/10/16}
& \zcolumn{6/11/16}
& \zcolumn{6/12/16}
& \zcolumn{6/13/16}
& \zcolumn{6/14/16}
& \zcolumn{6/15/16}
\end{tabularx}
\newpage
\bigskip

\end{document} 

enter image description here

  • @Bermard, Thanks so much for the help! It works. – y.h Jun 17 '16 at 16:29

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.