2

Follow-up question to For the inline enumerate: controlling the item spacing. I am having a problem with something using Exsheets and XeLaTeX to compile.

\documentclass[11pt, twoside]{article}
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}
\setlength{\parindent}{0.375in}
\setlength{\headheight}{0.5in}

%%exam stuff
\usepackage[load-headings]{exsheets} %need to have exsheets.cfg in the same folder
\SetupExSheets{
  headings = runin-nr ,
  headings-format = \normalsize,
  %solution/print = true %get solutions printed after questions
  counter-format = 1-qu. %1-question number. is the counter format. 
}

\usepackage[inline]{enumitem}
\newlist{choices}{enumerate*}{1}
\setlist[choices]{itemjoin = \hspace{0.75in}, label=(\Alph*)}
%%exam stuff

%Times New Roman Font
\renewcommand\rmdefault{ptm}
%Times New Roman Font

\begin{document}
\begin{question}[type = exam]\hspace{0.2cm}%do hspace{0.2cm} for every question
Here's a question.
\end{question}
\begin{choices}
\item Test
\item Test
\item Test
\item Test
\item Test
\end{choices}
\end{document}

Output:

enter image description here

I am wondering if there is a way to guarantee that the leftmost part of "Here's a question" and "Line 2" align with the leftmost part of bullet (A). My \hspace{0.2cm} is merely an estimate.

Furthermore, is there a way to insert this \hspace{0.2cm} without having to put it in every time I type \begin{question}[type=exam]?

2

You can take shelter under \before key and do some math:

\usepackage{calc}
\newlength{\mylen}
\setlength{\mylen}{\widthof{1.1.~}}

\usepackage[inline]{enumitem}
\newlist{choices}{enumerate*}{1}
\setlist[choices]{itemjoin = \hspace{0.75in},before=\noindent\hspace{\mylen},label=(\Alph*)}

Code:

\documentclass[11pt, twoside]{article}
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}
\setlength{\parindent}{0.375in}
\setlength{\headheight}{0.5in}

%%exam stuff
\usepackage[load-headings]{exsheets} %need to have exsheets.cfg in the same folder
\SetupExSheets{
  headings = runin-nr ,
  headings-format = \normalsize,
  %solution/print = true %get solutions printed after questions
  counter-format = 1-qu. %1-question number. is the counter format.
}

\usepackage{calc}
\newlength{\mylen}
\setlength{\mylen}{\widthof{1.1.~}}

\usepackage[inline]{enumitem}
\newlist{choices}{enumerate*}{1}
\setlist[choices]{itemjoin = \hspace{0.75in},before=\noindent\hspace{\mylen},label=(\Alph*)}
%%exam stuff

%Times New Roman Font
\renewcommand\rmdefault{ptm}
%Times New Roman Font
\usepackage{showframe}    %% for demo
\begin{document}
\begin{question}[type = exam]
Here's a question.
\end{question}
\noindent
\begin{choices}
\item Test
\item Test
\item Test
\item Test
\item Test
\end{choices}
\end{document}

enter image description here

With tasks

\documentclass[11pt, twoside]{article}
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}
\setlength{\parindent}{0.375in}
\setlength{\headheight}{0.5in}
\usepackage{calc}
%%exam stuff
\usepackage[load-headings]{exsheets} %need to have exsheets.cfg in the same folder
\SetupExSheets{
  headings = runin-nr ,
  headings-format = \normalsize,
  %solution/print = true %get solutions printed after questions
  counter-format = 1-qu. %1-question number. is the counter format.
}

\newlength{\mylen}
\setlength{\mylen}{\widthof{1.1.~}}

\settasks{label-width=1.5em,label-align=right,label-offset = 0.5em,item-indent=\dimexpr0.5em+\mylen+1.5em\relax,before-skip =-\baselineskip}%


%\usepackage[inline]{enumitem}
%\newlist{choices}{enumerate*}{1}
%\setlist[choices]{itemjoin = \hspace{0.75in},before=\hspace{-0.2cm},align=left, label=(\Alph*)}
%%exam stuff

%Times New Roman Font
\renewcommand\rmdefault{ptm}
%Times New Roman Font

\begin{document}
\begin{question}[type = exam]%\hspace{0.2cm}%do hspace{0.2cm} for every question
Here's a question.
\end{question}
\begin{tasks}[counter-format={(tsk[A])}](5)
\task Test
\task Test
\task Test
\task Test
\task Test
\end{tasks}
\end{document}

enter image description here

  • Can you elaborate on tasks? I'm still very new to exsheets. Also, as noted above, 0.2cm for the hspace was a guess. Is there perhaps a way to find the exact amount needed to align the line before with the choices? – Clarinetist Nov 8 '14 at 4:25
  • No rush. I appreciate it! – Clarinetist Nov 8 '14 at 4:26
  • Since this won't match the next question (1.2~) it might be a good idea to define a new headings instance for questions where the number part takes a fixed width and use said width with enumitem. – clemens Nov 8 '14 at 9:27
  • @cgnieder I agree. But since my knowledge of expl3 sucks, please feel free to correct this answer/post a new answer. – user11232 Nov 8 '14 at 9:50
  • 1
    @Clarinetist while trying to construct an answer I started working on some long time open issues in tasks. This appears to be more work than I thought. Once it's finished and the new version is online I'll post an answer :) – clemens Nov 8 '14 at 18:28

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.