\newcommand\fkh{\nolinebreak\hfill(\quad)}
\newcommand\tk[1][3]{\nolinebreak\mbox{\underline{\hspace{#1em}}}}
\newlength\lxxmax
\newlength\lhalf
\newlength\lhalfhalf
\newsavebox\xxboxa
\newsavebox\xxboxb
\newsavebox\xxboxc
\newsavebox\xxboxd
\newcommand\getboxsandmax[4]{%存放内容并获取最大宽
\sbox\xxboxa{#1}%
\sbox\xxboxb{#2}%
\sbox\xxboxc{#3}%
\sbox\xxboxd{#4}%
\ifdim\wd\xxboxa>\wd\xxboxb
\lxxmax\wd\xxboxa\relax
\else
\lxxmax\wd\xxboxb\relax
\fi
\ifdim\lxxmax<\wd\xxboxc
\lxxmax\wd\xxboxc\relax
\fi
\ifdim\lxxmax<\wd\xxboxd
\lxxmax\wd\xxboxd\relax
\fi
}
%四选项自动排版，用法 \xx{选项}{选项}{选项}{选项}
\newcommand\xx[4]{\par
\getboxsandmax{A. #1}{B. #2}{C. #3}{D. #4}%
\addtolength\lxxmax{1em}%
\setlength\lhalf{\dimexpr(\linewidth-\parindent)/2\relax}%
\setlength\lhalfhalf{.5\lhalf}%
\ifdim\lxxmax>\lhalf
    A. #1 \par
    B. #2 \par
    C. #3 \par
    D. #4
\else
    \ifdim\lxxmax>\lhalfhalf
        \begin{minipage}{\lhalf}
        \usebox\xxboxa
        \end{minipage}%
        \begin{minipage}{\lhalf}
        \usebox\xxboxb
        \end{minipage}\par
        \begin{minipage}{\lhalf}
        \usebox\xxboxc
        \end{minipage}%
        \begin{minipage}{\lhalf}
        \usebox\xxboxd
        \end{minipage}%
    \else
        \begin{minipage}{\lhalfhalf}
        \usebox\xxboxa
        \end{minipage}%
        \begin{minipage}{\lhalfhalf}
        \usebox\xxboxb
        \end{minipage}%
        \begin{minipage}{\lhalfhalf}
        \usebox\xxboxc
        \end{minipage}%
        \begin{minipage}{\lhalfhalf}
        \usebox\xxboxd
        \end{minipage}%
    \fi
\fi
}