![longTable,枚举和 URL](https://linux22.com/image/439755/longTable%EF%BC%8C%E6%9E%9A%E4%B8%BE%E5%92%8C%20URL.png)
我正在尝试生成一个复杂的表格,该表格包含一些链接,并且我还在表格环境中使用了枚举环境,我不知道这是否允许。我的代码产生了错误,这是我的代码:
\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}
以下是第 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}}
有什么帮助吗?
答案1
我将\\
中的转换enumerate
为\par
,并将 放在enumerate
它自己的组中{...}
。
\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}