4

In the following screenshot, the alignment of the 2nd A) and the space between the label of the 2nd list and the fraction have been obtained empirically n: see \hspace*{1.375em} and label*={\Alph*)\,\,}. You can see some shifts in the following screenshot.

My method is not good. I would like to use one better approach based on the settings of the standard vertical list.

enter image description here

\documentclass{article}
    \usepackage[utf8]{inputenc}
    \usepackage{amsmath}
    \usepackage[inline]{enumitem}
    \usepackage{parskip}

    \makeatletter
        \newlist{@inlinechoices}{enumerate*}{1}
        \setlist[@inlinechoices]{label*={\Alph*)\,\,},itemjoin={\qquad},labelindent=5em}
        \newenvironment{inlinechoices}{\hspace*{1.375em}\begin{@inlinechoices}}{\end{@inlinechoices}}
    \makeatother

    \newlist{choices}{enumerate}{1}
    \setlist[choices]{label*={\Alph*)},leftmargin=3em}
    \newcommand{\choice}{\item}

\begin{document}

\begin{enumerate}
    \item Which fractions are reduced ?

    \begin{choices}
        \choice $\dfrac{4}{7}$
    \end{choices}

    \item Which fractions are reduced ?

    \begin{inlinechoices}
        \choice $\dfrac{4}{7}$
    \end{inlinechoices}
\end{enumerate}

\end{document}
5

List spacing parameters are quite complicated. Here at least is one that is a little less hacky, and allows you to set the value in the choices list to match the \hspace value in the inlinechoices environment. To make the labels identical, I've created a new alignment scheme called straight which simply sets the label with a following \quad.

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage[inline]{enumitem}
\usepackage{parskip} % for zero par indent the right way

\SetLabelAlign{straight}{#1\quad}
\newlist{choices}{enumerate}{1}
\setlist[choices]{label*={\Alph*)},labelindent=1.375em,leftmargin=*,align=straight}
\newcommand{\choice}{\item}

\makeatletter
        \newlist{@inlinechoices}{enumerate*}{1}
        \setlist[@inlinechoices]{label*={\Alph*)},itemjoin={\qquad},align=straight}
        \newenvironment{inlinechoices}{\hspace*{1.375em}\begin{@inlinechoices}}{\end{@inlinechoices}}
    \makeatother

\begin{document}

 Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla

\begin{choices}
    \choice $\dfrac{4}{7}$
    \choice $\dfrac{8}{24}$\label{824}
    \choice $\dfrac{44}{121}$
    \choice $\dfrac{9}{11}$
\end{choices}

 Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla As in \ref{824}
\bigskip

\begin{inlinechoices}
    \choice $\dfrac{4}{7}$
    \choice $\dfrac{8}{24}$
    \choice $\dfrac{44}{121}$\label{44}
    \choice $\dfrac{9}{11}$
\end{inlinechoices}
\bigskip

\noindent Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla As in \ref{44}

\end{document}
  • Thanks for the straight astuce ;-) , and also for labelindent=1.375em,leftmargin=*. – projetmbc Mar 5 '12 at 20:54

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.