Longtable Long 自动换行问题

Longtable Long 自动换行问题

我试图将长单词包装在一个长表中,但效果不太好。有些单词溢出到下一个单元格。任何帮助都将非常感谢!

\documentclass{report}
\usepackage[left=65pt,top=28pt,right=65pt,bottom=65pt]{geometry}% http://ctan.org/pkg/geometry
\usepackage{longtable}% http://ctan.org/pkg/longtable
\usepackage{seqsplit}% http://ctan.org/pkg/seqsplit
\usepackage{array}

\begin{document}
\begin{longtable}{m{50pt} | m{360pt} | m{50pt}}
  & \seqsplit{thisisareallylongexamplethisisareallylongexamplethisisareallylongexamplethisisareallylongexample with a space} & test1 \\
  & \seqsplit{thisisareallylongexamplethisisareallylongexamplethisisareallylongexamplethisisareallylongexample\ with\ a\ space} & test2 \\
  & \seqsplit{thisisareallylongexamplethisisareallylongexamplethisisareallylongexamplethisisareallylongexample~with~a~space} & test3 \\
  \hline
  klhd ldgdddddddksjd fkldjs fldjs fkldjs lfkj sdlkf jlksjdf lkdsj fkldsj fkldsj fkldsj fklj sfkljds fdfdfdfdgddddddhghgghghdflkj & kjshfd ksj fdkjshf kjds hfkdjs hfkjds h &
    jsdh kkjhdskkjsfhhdsfhjdsfh dskj dkjshf dskjjkhs hjsd kjfkdshf kjdsh  
  \\
\end{longtable}
\end{document}

在此处输入图片描述

答案1

英语的连字模式在这里不起作用。这就是seqsplit要解决的问题,但您并未在所有单元格中使用它。

在此处输入图片描述

longtable请注意,这与您在主页上的段落中获得的相同行为无关。

\documentclass{report}
\usepackage[left=65pt,top=28pt,right=65pt,bottom=65pt]{geometry}% http://ctan.org/pkg/geometry
\usepackage{longtable}% http://ctan.org/pkg/longtable
\usepackage{seqsplit}% http://ctan.org/pkg/seqsplit
\usepackage{array}

\begin{document}
\begin{longtable}{m{50pt} | m{360pt} | m{50pt}}
  & \seqsplit{thisisareallylongexamplethisisareallylongexamplethisisareallylongexamplethisisareallylongexample with a space} & test1 \\
  & \seqsplit{thisisareallylongexamplethisisareallylongexamplethisisareallylongexamplethisisareallylongexample\ with\ a\ space} & test2 \\
  & \seqsplit{thisisareallylongexamplethisisareallylongexamplethisisareallylongexamplethisisareallylongexample~with~a~space} & test3 \\
  \hline\obeyspaces\seqsplit{klhd ldgdddddddksjd fkldjs fldjs fkldjs lfkj sdlkf jlksjdf lkdsj fkldsj fkldsj fkldsj fklj sfkljds fdfdfdfdgddddddhghgghghdflkj} & 
\obeyspaces\seqsplit{kjshfd ksj fdkjshf kjds hfkdjs hfkjds h}&
\obeyspaces\seqsplit{jsdh kkjhdskkjsfhhdsfhjdsfh dskj dkjshf dskjjkhs hjsd kjfkdshf kjdsh}\\
\end{longtable}
\end{document}

如果需要连字符,请添加

 \def\seqinsert{\-}

桌子前

相关内容