文章目录
前言
如题,给出解决方案。
解决方案
没自动换行之前的效果:
自动换行之后的效果:(以及相应代码)
\documentclass[]{article}
%for long table
\usepackage{longtable}
%for table toprule line
\usepackage{booktabs}
\begin{document}
% \begin{center}
\begin{longtable}{ccp{6cm}p{6cm}}
\caption{A list of all tool urls}
\label{tab:all_tool_urls} \\
\toprule
Name & Year & Targeted Area & Url \\
\midrule
EvoMaster & \citep{arcuri2021evomaster} & Test case generation for REST APIs
Test case generation for REST APIsTest case generation for REST APIsTest case generation for REST APIsTest case generation for REST APIsTest case generation for REST APIsTest case generation for REST APIs
& \url{https://github.com/EMResearch/EvoMaster https://github.com/EMResearch/EvoMaster https://github.com/EMResearch/EvoMaster} \\
\bottomrule
\end{longtable}
% \end{center}
\end{document}
关键的改动:
把 \begin{longtable}{cccc}
改成 \begin{longtable}{ccp{6cm}p{6cm}}
就行啦。
参考《Latex 入门》 (刘海洋著):
参考文献
- 《Latex 入门》 (刘海洋著)第288页
- How to make automatically line break when use longtable?