3

I am trying to generate a complicated table, this table contains some links and I use also the enumerate environment within the tabular environment, I don't know if this is allowed. My code produced errors, Here is my code:

\documentclass[a4paper,11pt,english]{report}

\usepackage{longtable}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage[table,xcdraw]{xcolor}
\usepackage{hyperref}

\begin{document}

\definecolor{lightgray}{HTML}{EFEFEF}

\begin{longtable}[H]{|
>{\columncolor{lightgray}}p{0.2\linewidth} | p{0.175\linewidth} | p{0.125\linewidth} | p{0.15\linewidth} | p{0.225\linewidth} |}
\hline \hline
\textbf{Pass/Fail Judgement}                                                                                                                  
& \multicolumn{4}{p{0.7\linewidth}|}{\begin{tabular}[c]{@{}p{\linewidth}@{}} BLA \\ BLA BLA \\ 
\begin{enumerate}
\item BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA \\ \\ BLA BLA BLA BLA BLA BLA BLA BLA  \url{https://www.bing.com/search?q=bla&cvid=19b23431a8974973ab4c3cda406effae&aqs=edge..69i57j0l5j69i61.1463j0j1&pglt=43&FORM=ANNAB1&PC=U531} (BLA “BLA BLA BLA BLA BLA BLA BLA BLA”) BLA \url{https://www.bing.com/search?q=bla&cvid=19b23431a8974973ab4c3cda406effae&aqs=edge..69i57j0l5j69i61.1463j0j1&pglt=43&FORM=ANNAB1&PC=U531}) \\ \textbf{BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA} \\ \\  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA \\
\item  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA\\  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA (\href{https://www.bing.com/search?q=bla&cvid=19b23431a8974973ab4c3cda406effae&aqs=edge..69i57j0l5j69i61.1463j0j1&pglt=43&FORM=ANNAB1&PC=U531}{\textit{\textbf{\underline{BLA}}}} –  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA).
\end{enumerate} 
\end{tabular}}
\end{longtable}

\end{document}

And here are the errors all at line 23:

! Extra }, or forgotten \endgroup.\@endpbox ...\@arstrutbox \color@endgroup \egroup\the \LT@p@ftn \global \LT... \end{tabular}}
! Missing \endgroup inserted.<inserted text>\endgroup \end{tabular}}
! Missing } inserted.<inserted text>} \end{tabular}}
! LaTeX Error: Lonely \item--perhaps a missing list environment.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \end{tabular}}
! Forbidden control sequence found while scanning use of \href@split.<inserted text>\par \end{tabular}}

Any help ?

1
  • What's the purpose of al the \\ inside of your enumerate environment? Removing them should result in a compilable code.
    – leandriis
    Commented Sep 22, 2021 at 9:11

1 Answer 1

1

I converted the \\ in the enumerate to \par and also placed the enumerate in its own group {...}.

\documentclass[a4paper,11pt,english]{report}

\usepackage{longtable}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage[table,xcdraw]{xcolor}
\usepackage{hyperref}

\begin{document}

\definecolor{lightgray}{HTML}{EFEFEF}

\begin{longtable}[H]{|
>{\columncolor{lightgray}}p{0.2\linewidth} | p{0.175\linewidth} | 
  p{0.125\linewidth} | p{0.15\linewidth} | p{0.225\linewidth} |}
\hline \hline
\textbf{Pass/Fail Judgement}                                                                                                                  
& \multicolumn{4}{p{0.7\linewidth}|}
{\begin{tabular}[c]{@{}p{\linewidth}@{}}
 BLA \\ BLA BLA \\ 
{\begin{enumerate}
\item BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA \par 
BLA BLA BLA BLA BLA BLA BLA BLA  \url{https://www.bing.com/search?q=bla&cvid=19b23431a8974973ab4c3cda406effae&aqs=edge..69i57j0l5j69i61.1463j0j1&pglt=43&FORM=ANNAB1&PC=U531} 
(BLA “BLA BLA BLA BLA BLA BLA BLA BLA”) BLA 
\url{https://www.bing.com/search?q=bla&cvid=19b23431a8974973ab4c3cda406effae&aqs=edge..69i57j0l5j69i61.1463j0j1&pglt=43&FORM=ANNAB1&PC=U531}) 
\par \textbf{BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA 
BLA BLA BLA BLA BLA BLA BLA BLA} \par  
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA 
BLA BLA BLA BLA \par
\item  BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA 
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA\par  
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA 
BLA BLA BLA BLA (
\href{https://www.bing.com/search?q=bla&cvid=19b23431a8974973ab4c3cda406effae&aqs=edge..69i57j0l5j69i61.1463j0j1&pglt=43&FORM=ANNAB1&PC=U531}
{\textit{\textbf{\underline{BLA}}}} –  BLA BLA BLA BLA BLA BLA BLA 
BLA BLA BLA).
\end{enumerate} }
\end{tabular}}
\end{longtable}

\end{document}

enter image description here

You must log in to answer this question.

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