长表格中没有空格的长字符串的自动换行

长表格中没有空格的长字符串的自动换行

我有以下文本:

\documentclass{article}
\usepackage{color}
\usepackage{longtable}
\usepackage{dcolumn}
\usepackage{graphicx}
\newcolumntype{d}{D{.}{.}{2}}
\begin{document}
\centering 
{\huge \bfseries Auto Test Results \\[0.4cm] }
\begin{longtable}{| p{60pt} | p{40pt} | p{250pt} |}
\hline \hline 
Test Name & Pass/Fail & Description \\ 
\hline 
\endhead 
\hline \textbf{Testa sadklfjbaskjdf\_hkla/sjhdfl\^kjashdf\#kljhasldkjf\$hlaksdjfhlkasjdfhlkasjhdflkjashdflkjhasdlfkjhal skdjfh} & {\color{green} Pass } & This does nothing \\ 
\hline \textbf{Testb} & {\color{red} Fail } & This does home/vp680\_test \textasciitilde{} \^ \textbackslash{} * \& \$ \{ \}  \\ 
\hline \textbf{Testc askjdhaskljfhkdfasdhjfkasfsdfkasdfkasjdfhljkasdhflkajsdhflkajshdflkasjdfhlkasjdfhklajsdfhlaksjdfhskldjfh} & {\color{green} Pass } & This isnt worth your time to run it and is really really really longThis isnt worth your time to run it and is really really really longThis isnt worth your time to run it and is really really really longThis isnt worth your time to run it and is really really really longThis isnt worth your time to run it and is really really really long \\ 
\hline
\end{longtable}
\end{document}

我希望解决的问题是,对于表中的长字符串,有没有简单的方法可以解决这个问题?最好使用标准包。

我曾见过这样的情况:如何在表格中包装网址?

和这个:换行不包含空格的长行

还有其他方法吗?

谢谢斯蒂芬

我的错,seqsplit是一个标准包。

对于其他寻求此用途的人:

\seqsplit{%
\textbf{\seqsplit{Testc askjdhaskljfhkdfasdhjfkasfsdfkasdfkasjdfhljkasdhflkajsdhflkajshdflkasjdfhlkasjdfhlajsdfhlaksjdf}}}

不能将此作为答案,因为新用户……

令人厌烦的seqsplit是它会消除空格。

由于我的乳胶是自动生成的,为了解决这个问题,我做了以下事情:

\seqsplit{\textbf{\seqsplit{Testc}}}\textbf{ }\seqsplit{\textbf{\seqsplit{askjdhaskljfhkdfasdhjfkasfsdfkasdfkasjdfhljkasdhflkajsdhflkajshdflkasjdfhlkasjdfhlajsdfhlaksjdf}}}

相关内容