\documentclass[a4paper,svgnames,11pt]{article}
\textheight = 220mm
\textwidth = 150mm
\topmargin = 10mm
\oddsidemargin = 5.0mm
\evensidemargin = 5.0mm
\unitlength = 1mm
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\pagenumbering{Roman}
\usepackage[margin=2cm]{geometry}
\usepackage[final]{pdfpages}
\begin{document}
\begin{flushleft}
\begin{tabular}{l l}
\textbf{Value} & \\
\textbf{Keywords} & \textit{Artificial intelligence, machine learning, humans, decentralization} \\
\textbf{Paper type} & Hybrid research paper. \\
\end{tabular}
\end{flushleft}
\end{document}
欲望: 在它们之间添加更多空间并进行修复,以便如果添加更多关键字,它不会溢出。
答案1
要增加线之间的距离,请使用
\renewcommand\arraystretch{1.3}
最好将其与表格一起放在一组中,以限制
\renewcommand
该包
tabularx
贡献了列说明符X
,它将其他类型的列留下的所有空间分配到X
列之间。此外,X
列以段落模式排版文本,以使行不会溢出右边界。如果没有tabularx
,您可以使用p{width}
列。该
@{}
说明符删除表格左侧和右侧的多余空间,以使其左侧(和右侧)与边框齐平。
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\noindent
{\renewcommand\arraystretch{1.3}%
\begin{tabularx}{\textwidth}{@{}lX@{}}
\textbf{Value} & \\
\textbf{Keywords} & \textit{Artificial intelligence, machine learning, humans, decentralization, machines, and more, and more, and more} \\
\textbf{Paper type} & Hybrid research paper. \\
\end{tabularx}%
}
\end{document}
答案2
另一个解决方案是使用新tabularray
包(加拿大运输安全局)。
\documentclass[a4paper,svgnames,11pt]{article}
\textheight = 220mm
\textwidth = 150mm
\topmargin = 10mm
\oddsidemargin = 5.0mm
\evensidemargin = 5.0mm
\unitlength = 1mm
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\pagenumbering{Roman}
\usepackage[margin=2cm]{geometry}
\usepackage[final]{pdfpages}
\usepackage{tabularray}
\begin{document}
\begin{flushleft}
\begin{tblr}{
colspec={lX}, % X column type uses all available space
column{1}={font=\bfseries}, % first column bold
}
Value & \\
Keywords & \textit{Artificial intelligence, machine learning, humans, decentralization} \\
Long Text & This is some really long text which doesn't fit on a single line. It will automatically flow over several lines. \\
Paper type & Hybrid research paper. \\
\end{tblr}
\end{flushleft}
\end{document}
默认情况下,垂直间距更大。如果想进一步增加间距,可以使用该rowsep
键。您还可\bfseries
以为整个列指定间距,这样就不必\textbf
为每个单元格都写间距。