Issue with Custom Conversion Code in Latest Version of ConTeXt
Dear ConTeXt Support Team, I hope this message finds you well. In the latest version of ConTeXt, the following piece of code no longer works as expected. I use it to define a custom legal numbering format for itemized lists: \def\legalconversion#1{ \dorecurse{\numexpr\currentitemlevel-1}{% \namedstructurecounter{itemgroup}{\currentparentitemgroup}{\recurselevel}.}% #1% } \defineconversion[legal][\legalconversion] Could you kindly advise on how to modify or fix this code to be compatible with the current version of ConTeXt? Thank you very much for your assistance and support! Best regards, Jorge
Jorge Manuel schrieb am 06.10.2024 um 17:44:
Dear ConTeXt Support Team,
I hope this message finds you well. In the latest version of ConTeXt, the following piece of code no longer works as expected. I use it to define a custom legal numbering format for itemized lists:
\def\legalconversion#1{ \dorecurse{\numexpr\currentitemlevel-1}{% \namedstructurecounter{itemgroup}{\currentparentitemgroup}{\recurselevel}.}% #1% }
\defineconversion[legal][\legalconversion]
Could you kindly advise on how to modify or fix this code to be compatible with the current version of ConTeXt? Thank you very much for your assistance and support
Can you show a complete (non) working example. Wolfgang
Jorge Manuel schrieb am 06.10.2024 um 17:44:
Dear ConTeXt Support Team,
I hope this message finds you well. In the latest version of ConTeXt, the following piece of code no longer works as expected. I use it to define a custom legal numbering format for itemized lists:
\def\legalconversion#1{ \dorecurse{\numexpr\currentitemlevel-1}{% \namedstructurecounter{itemgroup}{\currentparentitemgroup}{\recurselevel}.}% #1% }
\defineconversion[legal][\legalconversion]
Could you kindly advise on how to modify or fix this code to be compatible with the current version of ConTeXt?
Do you want this kind of numbering for itemize? \starttext \startitemize[n,repeat][stopper=,width=\widthofstring{0},distance=.5em] \item 1 \startitemize[n,repeat][stopper=,width=\widthofstring{0.0},distance=.5em] \item 1.1 \startitemize[n][stopper=,width=\widthofstring{0.0.0},distance=.5em] \item 1.1.1 \stopitemize \stopitemize \stopitemize \stoptext Wolfgang
Yes, that's exactly what I'm looking for. However, regarding multiple-choice questions, I would like the options to appear simply as A) rather than 1.1.1.A). Additionally, Is it possible to display each digit of the item numbering in boxes, similar to the style used in Pearson exams? Example: |1|.|1|." Like this: https://filestore.aqa.org.uk/sample-papers-and-mark-schemes/2023/june/AQA-74... Have a nice day Thanks in advance. Jorge
desdechaves@gmail.com schrieb am 11.10.2024 um 13:41:
Yes, that's exactly what I'm looking for. However, regarding multiple-choice questions, I would like the options to appear simply as A) rather than 1.1.1.A).
Don't use the "repeat" option when you don't want repeated counter values.
Additionally, Is it possible to display each digit of the item numbering in boxes, similar to the style used in Pearson exams? Example: |1|.|1|."
This requires a custom number conversion, the following example works only for single digits only. %%%% begin example \define[1]\BoxedNumber {\inframed[width=3ex]{\convertnumber{n}{#1}}} \defineconversion [BoxedNumber] [\BoxedNumber] \starttext \startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount] \item xxx \startitemize[BoxedNumber,fit][stopper=,distance=\spaceamount] \item xxx \stopitemize \stopitemize \stoptext %%%% end example
Like this: https://filestore.aqa.org.uk/sample-papers-and-mark-schemes/2023/june/AQA-74...
For question blocks like here you want to use an enumeration environment rather than itemize. Wolfgang
Good morning to all, Thank you for the code to insert numbers into boxes. However, I can't prevent the multiple-choice questions from repeating labels like 1.1.A). It looks very bad. How can I control this behavior? Thank you. %%% sample code \define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}} \defineconversion [BoxedNumber] [\BoxedNumber] \starttext \startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount] \item xxx \startitemize[BoxedNumber,fit][stopper=,distance=\spaceamount] \item multiple choice \startitemize[A, columns, two, random][stopper={)},style=bold] \item choice 1 \item choice 2 \item choice 3 \item choice 4 \stopitemize \stopitemize \stopitemize \stoptext
Jorge Manuel schrieb am 12.10.2024 um 11:40:
Good morning to all,
Thank you for the code to insert numbers into boxes. However, I can't prevent the multiple-choice questions from repeating labels like 1.1.A). It looks very bad. How can I control this behavior? Thank you.
%%% sample code \define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}}
\defineconversion [BoxedNumber] [\BoxedNumber]
\starttext
\startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount] \item xxx \startitemize[BoxedNumber,fit][stopper=,distance=\spaceamount]
Add norepeat: \startitemize[BoxedNumber,norepeat,fit][stopper=,distance=\spaceamount]
\item multiple choice \startitemize[A, columns, two, random][stopper={)},style=bold] \item choice 1
You have to replace \item with \startitem ... \stopitem to make use of the random option, i.e. \startitem choice 1 \stopitem Wolfgang
To achieve a norepeat in a specific itemize block, I need to introduce the norepeat at a higher level. This affects all the children of that itemize. See the example below, please. In the multiple-choice block, I want to avoid repetition, but afterward, I want to restore the default behavior. \define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}} \defineconversion [BoxedNumber] [\BoxedNumber] \starttext \startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount] \item xxx \startitemize[BoxedNumber,fit, norepeat][stopper=,distance=\spaceamount] \item multiple choice \startitemize[A, columns, two, random, fit][stopper={)},style=bold] %% \item choice 1 \item choice 2 \item choice 3 \item choice 4 \stopitemize \item normal question 1 \startitemize[BoxedNumber, repeat] %% \item question 1 \par\thinrules[n=2] \item question2 \par\thinrules[n=2] \stopitemize \stopitemize \stopitemize \stoptext
I applied a trick: I created a phantom itemize. \define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}} \defineconversion [BoxedNumber] [\BoxedNumber] \starttext \startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount] \item xxx \startitemize[BoxedNumber,fit, repeat][stopper=,distance=\spaceamount] \item multiple choice \startitemize[norepeat] \item Your choice: \_\_\_\_ \startitemize[A, columns, two, random, fit][stopper={)},style=bold] %% \item choice 1 \item choice 2 \item choice 3 \item choice 4 \stopitemize \stopitemize \item normal question 1 \startitemize[BoxedNumber, repeat] %% \item question 1 \par\thinrules[n=2] \item question2 \par\thinrules[n=2] \stopitemize \stopitemize \stopitemize \stoptext
Jorge Manuel schrieb am 12.10.2024 um 13:24:
I applied a trick: I created a phantom itemize.
\define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}}
\defineconversion [BoxedNumber] [\BoxedNumber]
\starttext
\startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount] \item xxx \startitemize[BoxedNumber,fit, repeat][stopper=,distance=\spaceamount] \item multiple choice * \startitemize[norepeat]* * \item Your choice: \_\_\_\_* \startitemize[A, columns, two, random, fit][stopper={)},style=bold] %% \item choice 1 \item choice 2 \item choice 3 \item choice 4 \stopitemize * \stopitemize*
\item normal question 1 \startitemize[BoxedNumber, repeat] %% \item question 1 \par\thinrules[n=2] \item question2 \par\thinrules[n=2] \stopitemize \stopitemize \stopitemize
\stoptext
You can use an enumeration to have more control about the numbering and spacing/width of the counter. %%%% begin example \define[1]\BoxedNumber {\inframed[width=3ex]{\convertnumber{n}{#1}}} \defineconversion [BoxedNumber] [\BoxedNumber] \defineenumeration [Question] [text=, alternative=hang, width=broad, numberconversion=BoxedNumber] \starttext \startQuestion xxx \startsubQuestion multiple choice \startitemize[A,columns,tworandom][stopper={)},style=bold] \startitem choice 1 \stopitem \startitem choice 2 \stopitem \startitem choice 3 \stopitem \startitem choice 4 \stopitem \stopitemize \stopsubQuestion \startsubQuestion normal question 1 \startsubsubQuestion question 1 \par\thinrules[n=2] \stopsubsubQuestion \startsubsubQuestion question2 \par\thinrules[n=2] \stopsubsubQuestion \stopsubQuestion \stopQuestion \stoptext %%%% end example Wolfgang
participants (3)
-
desdechaves@gmail.com
-
Jorge Manuel
-
Wolfgang Schuster