\section{ELABORATE ON: \hfill $\text{\thetenMarksQ\times10}=\text{\10}$}
\DTLforeach{Q}{\Marks=Marks, \Question=Question,
    \question \Question
            \part \Subquestion

the above code is working great for 3 marks, 5 marks but when it comes to 10 marks the number of question(here,4) multiplied with 10 gives 400, but I anticipated to get 40. enter image description here

  • 2
    You can't use \10. Legal control sequences have either letters only or a single nonletter.
    – egreg
    Feb 12, 2023 at 14:47

1 Answer 1


The problem is in using \10. A shortened version showing the same problem is as follows:






which produces


Why? Because you cannot define a macro \10. Macro names can be of two flavors: either letters only or a single nonletter.

In your case, the result of the operation is stored in \1 and the 0 is lost for reasons of how \FPeval is implemented.

Next, when you do \10, the value stored in \1 is printed and it is 40; then TeX typesets the 0.

Use something like \byten or whatever.

Well, you might use 10 as a command name, but only inside the \csname...\endcsname construct. This would work:

\expandafter\FPeval\csname 10\endcsname{clip(10*4)}

\csname 10\endcsname

but are you wanting to do that just for the sake of having a macro with that name?

By the way, you shouldn't use \thetenMarksQ, but \arabic{tenMarksQ}.







This will print 40.

  • Thanks a lot it worked, you guys are always better than AIs. Feb 13, 2023 at 3:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .