无需考试课程即可创建带答案的多项选择题

无需考试课程即可创建带答案的多项选择题

在此处输入图片描述

我想按照上图所示进行排序。但结果如下。注意红框。

在此处输入图片描述

我尝试了很多方法,但还是不行。等待您的帮助,谢谢。

\documentclass[9pt,a4paper,twocolumn]{extarticle} % 10pt font size, A4 paper and two-sided margins

\usepackage[top=3.4cm,bottom=3.6cm,left=2.2cm,right=2.85cm,columnsep=0.75cm]{geometry} % Document margins and spacings

\usepackage{amsmath,amsthm,amsfonts,amssymb}

\usepackage{ifthen}

\usepackage{framed,color}

\definecolor{shadecolor}{RGB}{217,238,244}

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage[turkish]{babel}

\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}

\newcounter{choice}
\renewcommand\thechoice{\Alph{choice}}
%\renewcommand\thechoice{\alph{choice}}
\newcommand\choicelabel{\thechoice.}

\newenvironment{choices}%
{\list{\choicelabel}%
{\usecounter{choice}\def\makelabel##1{\hss\llap{##1}}%
\settowidth{\leftmargin}{W.\hskip\labelsep\hskip 2.5em}%
\def\choice{%
\item} % choice
\labelwidth\leftmargin\advance\labelwidth -\labelsep
\topsep=0pt
\partopsep=0pt}%
}%
{\endlist}

\newenvironment{oneparchoices}%
{%
\setcounter{choice}{0}%
\def\choice{%
\refstepcounter{choice}%
\ifnum\value{choice}>1\relax
\penalty -50\hskip 4em plus 4em\relax
\fi
\choicelabel
\nobreak\enskip
}% choice
% If we're continuing the paragraph containing the question,
% then leave a bit of space before the first choice:
\ifvmode\else\enskip\fi
\ignorespaces
}%
{}

\usepackage{palatino} % Use the Palatino font

\usepackage{amsfonts}

\usepackage{microtype} % Improves spacing

\usepackage[bf,sf,center]{titlesec} % Required for modifying section titles - bold, sans-serif, centered

\usepackage{fancyhdr} % Required for modifying headers and footers
\fancyhead[L]{\textsf{\rightmark}} % Top left header
\fancyhead[R]{\textsf{\leftmark}} % Top right header
\renewcommand{\headrulewidth}{1.4pt} % Rule under the header
\fancyfoot[C]{\textbf{\textsf{\thepage}}} % Bottom center footer
\renewcommand{\footrulewidth}{1.4pt} % Rule under the footer
\pagestyle{fancy} % Use the custom headers and footers throughout the document

\newcommand{\entry}[4]{\markboth{#1}{#1}\textbf{#1}\ {(#2)}\ \textit{#3}\ $\bullet$\ {#4}}  % Defines the command to print each word on the page, \markboth{}{} prints the first word on the page in the top left header and the last word in the top right
\setlength{\columnseprule}{0,5pt}
%----------------------------------------------------------------------------------------

\begin{document}

{\centering $2^a=19$

 $3^b=11$

 $5^c=9$ \\}

\noindent \textbf{olduğuna göre aşağıdaki sıralamalardan hangisi doğrudur?}

\medskip

\begin{oneparchoices}
    \choice $b<a<c$
    \choice $b<c<a$
    \choice $c<b<a$
    \choice $c<a<b$
    \choice $a<b<c$
 \end{oneparchoices}

\end{document}

答案1

这是有可能的:我只保留了 的定义oneparchoices,其余部分无关紧要。请注意,environ包是必需的。

我使用技巧https://tex.stackexchange.com/a/99365/4427将最后一行居中。

\documentclass[twocolumn]{article}
\usepackage[top=3.4cm,bottom=3.6cm,left=2.2cm,right=2.85cm,columnsep=0.75cm]{geometry}

\usepackage{environ}

\newcounter{choice}
\renewcommand\thechoice{\Alph{choice}}

\makeatletter
\def\choice#1\choice{%
  \do@choice{#1}%
  \@ifnextchar\relax{}{\choice}%
}
\newcommand{\do@choice}[1]{%
  \stepcounter{choice}%
  \makebox{\thechoice. #1\unskip}\hspace{1cm plus 2cm minus .5cm}%
}
\makeatother

\NewEnviron{oneparchoices}{%
  \setcounter{choice}{0}%
  \par\vspace{\topsep}
  \leftskip=0pt plus 0.5fil
  \rightskip=0pt plus -0.5fil
  \parfillskip=0pt plus 1fil
  \noindent\BODY\choice\relax
  \par\vspace{\topsep}
}

\begin{document}

Some text before the choices just to see how they are
aligned with respect to the margins.

\begin{oneparchoices}
  \choice $b<a<c$
  \choice $b<c<a$
  \choice $c<b<a$
  \choice $c<a<b$
  \choice $a<b<c$
\end{oneparchoices}

Some text after the choices just to see how they are
aligned with respect to the margins.

\end{document}

在此处输入图片描述

相关内容