盒子之间有个莫名的空白

2020-05-09 14:17发布

[图]\documentclass[10pt,UTF]{ctexart} \usepackage[paperwidth=21cm,paperheight=29.7cm,top=2.6cm,bottom=2....

\documentclass[10pt,UTF]{ctexart}
\usepackage[paperwidth=21cm,paperheight=29.7cm,top=2.6cm,bottom=2.533cm,right=1cm,left=1cm,headheight=24pt,footskip=41pt]{geometry}
\usepackage{ifthen}
\usepackage{amsmath} %数学公式
\usepackage{amssymb} %数学公式
\newlength{\la}
\newlength{\lb}
\newlength{\lc}
\newlength{\ld}
\newlength{\lhalf}
\newlength{\lquarter}
\newlength{\lquartert}
\newlength{\lmax}
\newlength{\surplus}
\newlength{\contentlength}
\newcommand{\choiceF}[4]{%
 \ifnewline \!\\[0pt]%
 \fi%
 \settowidth{\la}{A.#1~~~}%
 \settowidth{\lb}{B.#2~~~}%
 \settowidth{\lc}{C.#3~~~}%
 \settowidth{\ld}{D.#4~~~}%
 \ifthenelse{\lengthtest{\la > \lb}}%
 {\setlength{\lmax}{\la}}{\setlength{\lmax}{\lb}}%
  \ifthenelse{\lengthtest{\lmax < \lc}}  {\setlength{\lmax}{\lc}}  {}  \ifthenelse{\lengthtest{\lmax < \ld}}  {\setlength{\lmax}{\ld}}  {}%
 \ifthenelse{\lengthtest{\lmax > \lhalf}}%
 {\noindent{}A.#1 \\ B.#2 \\ C.#3 \\ D.#4 \\}  {  \ifthenelse{\lengthtest{\lmax > \lquarter}}%
     {\noindent
     \parbox{\lhalf}{A.#1~~~}%
     \parbox{\lhalf}{B.#2~~~}\\\makebox[0.92cm][r]{}%
     \parbox{\lhalf}{C.#3~~~}%
     \parbox{\lhalf}{D.#4~~~}\\}%
     {\noindent\framebox[\lquarter][l]{A.#1~~~}%
     \framebox[\lquarter][l]{B.#2~~~}%
     \framebox[\lquarter][l]{C.#3~~~}%
     \framebox[\lquarter][l]{D.#4~~~}\\}
    }}

\newcommand{\choiceFNoEndLine}[4]{%
 \ifnewline \!\\[0pt]%
 \fi%
 \settowidth{\la}{A.#1~~~}%
 \settowidth{\lb}{B.#2~~~}%
 \settowidth{\lc}{C.#3~~~}%
 \settowidth{\ld}{D.#4~~~}%
 \ifthenelse{\lengthtest{\la > \lb}}%
 {\setlength{\lmax}{\la}}{\setlength{\lmax}{\lb}}%
  \ifthenelse{\lengthtest{\lmax < \lc}}  {\setlength{\lmax}{\lc}}  {}  \ifthenelse{\lengthtest{\lmax < \ld}}  {\setlength{\lmax}{\ld}}  {}%
 \ifthenelse{\lengthtest{\lmax > \lhalf}}%
 {\noindent{}A.#1 \\ B.#2 \\ C.#3 \\ D.#4}  {  \ifthenelse{\lengthtest{\lmax > \lquarter}}%
     {\noindent%
     \parbox{\lhalf}{A.#1~~~}%
     \parbox{\lhalf}{B.#2~~~}\\%
     \parbox{\lhalf}{C.#3~~~}%
     \parbox{\lhalf}{D.#4~~~}}%
     {\noindent\framebox[\lquarter][l]{A.#1~~~}%
     \framebox[\lquarter][l]{B.#2~~~}%
     \framebox[\lquarter][l]{C.#3~~~}%
     \framebox[\lquarter][l]{D.#4~~~}}%
    }}



\newif\ifnewline
\newlinefalse



\newcommand{\setlinewidth}[1]{
\setlength{\linewidth}{#1}
\setlength{\lhalf}{0.5\linewidth}
\setlength{\lquarter}{0.25\linewidth}
\setlength{\lquartert}{0.75\linewidth}
}

\setlength{\parskip}{1mm}
\linespread{1.9}
\begin{document}
\par
\hangindent 0.4cm
\hangafter 1
\noindent
\makebox[0.4cm][r]{1. }我是大题题干
\\
\setlinewidth{17.6cm}
\framebox[1cm][r]{(1).}\choiceF{a}{b}{c}{d}
\framebox[1cm][r]{(2).}\choiceF{1}{2}{3}{4}
\framebox[1cm][r]{(3).}\choiceF{2}{2}{3}{4}
\framebox[1cm][r]{(4).}\choiceF{3}{2}{3}{4}
\framebox[1cm][r]{(5).}\choiceF{5}{2}{3}{4}
\framebox[1cm][r]{(6).}\choiceF{6}{2}{3}{4}
\framebox[1cm][r]{(7).}\choiceF{7}{2}{3}{4}
\framebox[1cm][r]{(8).}\choiceF{8}{2}{3}{4}
\framebox[1cm][r]{(9).}\choiceF{9}{2}{3}{4}
\framebox[1cm][r]{(10).}\choiceFNoEndLine{10}{2}{3}{4}
\par
\hangindent 0.4cm
\hangafter 1
\noindent
\makebox[0.4cm][r]{2. }我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干
\\
\newlinetrue
\setlinewidth{18.6cm}
(1).\choiceF{a}{b}{c}{d}
(2).\choiceF{1}{2}{3}{4}
(3).\choiceF{2}{2}{3}{4}
(4).\choiceF{3}{2}{3}{4}
(5).\choiceF{5}{2}{3}{4}
(6).\choiceF{6}{2}{3}{4}
(7).\choiceF{7}{2}{3}{4}
(8).\choiceF{8}{2}{3}{4}
(9).\choiceF{9}{2}{3}{4}
(10).\choiceFNoEndLine{10}{2}{3}{4}
\par
\hangindent 0.4cm
\hangafter 1
\noindent
\makebox[0.4cm][r]{3. }我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干我是大题题干
\end{document}

image.png

这个多余的空白是怎么来的,怎么去掉?