On 29/01/2024 05:38, Aka Steve wrote:
> Hi Peter, Have you gotten a chance to review the code?
Sorry for the delay — family problems.
OK, there is a major logical disconnect here. You are trying to GENERATE
an implicit heading in the level ABOVE the one you address, eg:
% this one is fine, it's a question at level 1 so it's Q1
\question{This is a test question}{solution 1}
% This is deeply misleading because there is no Q2. But it works because
% the item for it is embedded in the environment.
\begin{subquestions}
\subquestion{testing1a}{testing answer1}
\subquestion{testing1b}{testing answer2}
\subquestion{testing1c}{testing answer3}
The same applies to the subparts environment.
Weirdly, if I duplicate the first subparts environment (so I now get an
(e) with three subparts, exactly the same as (d) has), the formatting is
fine.
But in Q3, where the code structure is identical, it puts the level 2
counter in the wrong place for the second and subsequent items. BUT most
obviously, there is a GAP between the level 3 blocks which is absent in Q2.
This is a good indicator of the problem when a list jumps from an outer
level to a deeper level without passing through the intervening level,
eg from 1 to 3 without a 2...or in your case in Q3, jumping strait to
subparts without there being a subquestion present.
This works OK
\begin{subquestions}
\subquestion{dummy}{testing dummy}
\begin{subparts}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\end{subparts}
\begin{subparts}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\end{subparts}
\begin{subparts}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\subpart{arg1}{arg2}
\end{subparts}
\end{subquestions}
You will need to create some kind of dummy command to compensate for the
fact that subquestions expects a subquestion before launching into
subparts. That is the nature of contained hierarchies.
Peter