平均能量损失
\documentclass[a4paper,12pt]{book}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}
\usepackage{array}
\usepackage{longtable}
\usepackage{showframe}
\usepackage{multicol}
\usepackage{multirow}
\begin{document}
textwidth = 2.1cm + 2.8cm + 2.8cm + 2cm = 9.7cm
\begin{longtable}{|p{2.1cm}| p{2.8cm} |p{2.8cm}|p{2cm}|}
\hline
\multicolumn{4}{|c|}{\textbf{Q CODES}} \\
\hline
\textbf{Q CODE} & \multicolumn{3}{c|}{\textbf{EXPLAIN}} \\
\hline
\multirow{6}{*}{QOD} & \multicolumn{3}{l|}{Short Sentence, No Problem ( 9.7cm )}\\
& \multicolumn{3}{l|}{Long Sentence, Long Sentence, Long Sentence Problem ( greater than 9.7cm )}\\
\cline{2-4}
& 0 Holland & 1 English & 2 France\\
& 3 Germany & 4 Greece & 5 Italia\\
& 6 Japan & 7 Norvia & 8 Russia\\
& 9 Espanol & &\\
\hline
\end{longtable}
\end{document}
显示, 。
我的问题是,多行长表中的长句子不会转到下一行。也就是说,行大于\textwidth
。如果行等于,我该怎么办\textwidth
?(也许答案很简单。但我找不到。)
答案1
在多列中使用 parbox(添加 3 列得到 7.6 厘米),如下所示:
\documentclass[a4paper,12pt]{book}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}
\usepackage{array}
\usepackage{longtable}
\usepackage{showframe}
\usepackage{multicol}
\usepackage{multirow}
\begin{document}
textwidth = 2.1cm + 2.8cm + 2.8cm + 2cm = 9.7cm
\begin{longtable}{|p{2.1cm}| p{2.8cm} |p{2.8cm}|p{2cm}|}
\hline
\multicolumn{4}{|c|}{\textbf{Q CODES}} \\
\hline
\textbf{Q CODE} & \multicolumn{3}{c|}{\textbf{EXPLAIN}} \\
\hline
\multirow{6}{*}{QOD} & \multicolumn{3}{l|}{Short Sentence, No Problem ( 9.7cm )}\\
& \multicolumn{3}{l|}{\parbox{7.6cm}{Long Sentence, Long Sentence, Long Sentence Problem ( greater than 9.7cm )}}\\
\cline{2-4}
& 0 Holland & 1 English & 2 France\\
& 3 Germany & 4 Greece & 5 Italia\\
& 6 Japan & 7 Norvia & 8 Russia\\
& 9 Espanol & &\\
\hline
\end{longtable}
\end{document}