减少枚举和项目之间的空间

减少枚举和项目之间的空间

尝试修改生成 PDF 的 R 程序。这是它生成的输出,我想删除标记为黄色的空间。

生成的输出 - 需要移除的空间以黄色标记

以下是代码

\documentclass[20pt,fleqn,leqno]{extarticle}\usepackage[]{graphicx}\usepackage[]{color}
\usepackage{framed}

\usepackage{alltt}
\usepackage[a5paper,top=1in,bottom=0.75in,left=0.75in,right=0.25in]{geometry}
\usepackage{enumitem}
\usepackage{changepage}
\usepackage{enumitem}
\usepackage{multicol,xparse,bm}
\usepackage{setspace}
\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{xlop}% http://ctan.org/pkg/xlop

\setlength\headsep{40pt}
%\usepackage{showframe} % just to show the margins

% multicols - fix for single column
\let\multicolmulticols\multicols
\let\endmulticolmulticols\endmulticols

\RenewDocumentEnvironment{multicols}{mO{}}
 {%
  \ifnum#1=1
    #2%
  \else % More than 1 column
    \multicolmulticols{#1}[#2]
  \fi
 }
 {%
  \ifnum#1=1
  \else % More than 1 column
    \endmulticolmulticols
  \fi
 }

% - end multicols fix
\begin{document}
\fontsize{ 40}{48}\begin{multicols}{1}
\begin{enumerate}[label={\arabic*)},before*=\small,leftmargin=*,itemsep=1.0cm, labelsep=0.5cm]
\item \scalebox{3}{  \quad \bf \opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {3}{2} \quad}
\item \scalebox{3}{  \quad \bf \opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {2}{1} \quad}
\item \scalebox{3}{  \quad \bf \opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {4}{1} \quad}
\item \scalebox{3}{  \quad \bf \opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {6}{1} \quad}
\item \scalebox{3}{  \quad \bf \opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {7}{1} \quad}
\item \scalebox{3}{  \quad \bf \opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {8}{1} \quad}
\end{enumerate}
\end{multicols}

\end{document}

ps:由于 tex 输出是由更大的程序生成的(我已经根据更大的输出创建了一个工作样本),因此我对修改输出生成方式的灵活性有限。

答案1

您忘记了在每个项目开头插入scalebox时也会缩放吗?此外,缩放因子 3 对于此纸张尺寸来说太大了。我不得不将其缩小到并删除开头的 s。3quad2.2\quad

我借此机会稍微简化了您的代码。特别是,color由于您加载了,因此无需加载xcolor。另外请注意,该选项\bf已被弃用约 25 年。请\bfseries改用。

\documentclass[20pt,fleqn,leqno]{extarticle}
\usepackage[]{graphicx}
\usepackage{framed}

\usepackage{alltt}
\usepackage[a5paper,top=1in, bottom=0.75in, left=0.75in, right=0.25in, showframe]{geometry}% option showframe just to show the margins

\usepackage{enumitem}
\usepackage{changepage}
\usepackage{enumitem}
\usepackage{multicol,xparse,bm}
\usepackage{setspace}
\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{xlop}% http://ctan.org/pkg/xlop

\setlength\headsep{40pt}

% multicols - fix for single column
\let\multicolmulticols\multicols
\let\endmulticolmulticols\endmulticols

\RenewDocumentEnvironment{multicols}{mO{}}
 {%
  \ifnum#1=1
    #2%
  \else % More than 1 column
    \multicolmulticols{#1}[#2]
  \fi
 }
 {%
  \ifnum#1=1
  \else % More than 1 column
    \endmulticolmulticols
  \fi
 }
% - end multicols fix

\begin{document}

\fontsize{ 40}{48}\begin{multicols}{1}
\begin{enumerate}[label={\arabic*)},font=\normalfont\small, leftmargin=*,itemsep=1.0cm, labelsep=0.4cm, before = \bfseries]
\item \scalebox{2.2}{\opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {3}{2} \quad}
\item \scalebox{2.2}{\opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {2}{1} \quad}
\item \scalebox{2.2}{\opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {4}{1} \quad}
\item \scalebox{2.2}{\opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {6}{1} \quad}
\item \scalebox{2.2}{\opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {7}{1} \quad}
\item \scalebox{2.2}{\opadd[style=text, voperation=center,resultstyle=\gobble,intermediarystyle=\hole,carryadd=false] {8}{1} \quad}
\end{enumerate}
\end{multicols}

\end{document} 

在此处输入图片描述

相关内容