0

Trying to modify an R program that generates a PDF. Here is the output it produces, I want to get rid of the space that is marked in yellow.

Output produced - with space to be removed marked in yellos

Here is the code

\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: As the tex output is produced by a larger program (I have created a working sample out of the larger output) I have limited flexibility to modify the way the output is generated.

1

You forgot that scalebox also scales by 3 the quad inserted at the beginning of each item? Furthermore, a scale factor of 3 is too big for this paper size. I had to reduce it to 2.2 and to remove the \quads at the beginning.

I took the opportunity to slightly simplify your code. In particular, needless to load color since you load xcolor. Also note \bf has been deprecated for about 25 years. Use \bfseries instead.

\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} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.