我遇到了环境后多余空格的问题multicol
。我正在尝试创建一个小表单;下面是我的代码示例:
\documentclass[a4paper,14pt]{extreport}
\usepackage{fontspec} %
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{cfr-lm}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{framed, color}
\definecolor{shadecolor}{rgb}{0.64, 0.64, 0.82}
\begin{document}
\begin{multicols}{2}
\noindent
\textbf{Procurement \textnumero:} \dotfill \\
{} \\
\textbf{Procurement date:} \dotfill \\
{} \\
\textbf{Shipment type:} \dotfill \\
\vfill\null
\columnbreak
\noindent \textbf{Received by:} \dotfill \\
{} \\
\textbf{Received on date:} \dotfill \\
{} \\
\textbf{COuntry of origin:} \dotfill \\
\end{multicols} %\par
\begin{center}
\begin{shaded}
\Large \textbf{\textsc{Exemplary Specimen:}}
\end{shaded}
\end{center} \par
\lipsum[1]
\end{document}
2 列环境之后的空间太多了!它占用了宝贵的空间,因为我希望我的表单适合 1 页!我想我尝试过使用\setlength\multicolsep{0pt}
,但没有效果!欢迎任何提示!谢谢!
答案1
下面提供了一些更清晰的代码来重现输出,但可以选择调整间距:
\documentclass[a4paper,14pt]{extreport}
\usepackage{cfr-lm,lipsum,tabularx}
\usepackage[table]{xcolor}
\definecolor{shadecolor}{rgb}{0.64, 0.64, 0.82}
\begin{document}
\noindent
\begingroup\bfseries
\begin{tabularx}{\linewidth}{ @{} X X @{} }
Procurement \textnumero: \dotfill &
Received by: \dotfill \\ \\
Procurement date: \dotfill &
Received on date: \dotfill \\ \\
Shipment type: \dotfill &
Country of origin: \dotfill
\end{tabularx}
\vspace{2\baselineskip}% Adjust to suit your needs
\noindent
\renewcommand{\arraystretch}{2}%
\begin{tabularx}{\linewidth}{ X }
\cellcolor{shadecolor}\centering\Large Exemplary Specimen:
\end{tabularx}
\endgroup
\bigskip% Adjust to suit your needs
\lipsum[1]
\end{document}
您也可以只使用article
类,缩小基本字体大小,然后使用geometry
以在页面上留出更多空间。例如,
\documentclass{article}
\usepackage[margin=2in]{geometry}
答案2
您永远不应该使用\\
“留空行”。在这种情况下,您可以本地设置增加的基线跳过。
\documentclass[a4paper,14pt]{extreport}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{framed, color}
\definecolor{shadecolor}{rgb}{0.64, 0.64, 0.82}
\begin{document}
\begin{multicols}{2}
\linespread{1.5}\selectfont
\setlength{\parindent}{0pt}
\textbf{Procurement \textnumero:} \dotfill
\textbf{Procurement date:} \dotfill
\textbf{Shipment type:} \dotfill
\textbf{Received by:} \dotfill
\textbf{Received on date:} \dotfill
\textbf{Country of origin:} \dotfill
\end{multicols}
\begin{shaded}
\centering\Large\bfseries Exemplary Specimen:
\end{shaded}
\lipsum[1]
\end{document}
请注意,加载cfr-lm
时不执行任何操作。fontspec
答案3
我只是输入了如下命令
\vspace{-0.5cm}
在“\end{multicols}”之后“删除”多余的空格,我对结果很满意。