Forums » Using AMC (english) »
Leading zero for questions on separate answer sheet for perfect alignment
Added by Muh Kuh over 5 years ago
Can someone link me to the right place/file to search for the code where I could probably edit "Question 1" to "Question 01" with a leading zero? So they are all aligned unlike in the attached picture.
Replies (8)
RE: Leading zero for questions on separate answer sheet for perfect alignment - Added by Muh Kuh over 5 years ago
Another try to include image.
amc.PNG - Missing leading zero (9.4 kB)
RE: Leading zero for questions on separate answer sheet for perfect alignment - Added by Rafael Rodriguez over 5 years ago
You could try
\def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par\noindent\hangindent=2.5em\hbox to 5.8em{\hfill \bf Frage #1:}}
It does not add the zero but all the squares are aligned irrespective of the numbers of digits.
RE: Leading zero for questions on separate answer sheet for perfect alignment - Added by Muh Kuh over 5 years ago
Oops. I forgot to mention we are using AMC-TXT.
We did it kinda the way you mentioned back in the days we were using LaTex. I haven't yet figured out how to include this in AMC-TXT without getting tons of compiling errors.
RE: Leading zero for questions on separate answer sheet for perfect alignment - Added by Muh Kuh over 5 years ago
Woops. It works in the "LaTex-Preambule:" command. It's better overall but still looks a little messed up
I hoped for something like %d that could be changed to %0d ^^
Unbenannt.PNG (3.9 kB)
RE: Leading zero for questions on separate answer sheet for perfect alignment - Added by Alexis Bienvenüe over 5 years ago
I hoped for something like %d that could be changed to %0d
This is not a perfect solution because the strings 11 and 08 do not have the same width with proportional fonts.
If you need Frage to be left-aligned and the number to be right aligned, you can try something like
\def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par\noindent\hangindent=2.5em\hbox to 5.8em{\bf Frage \hfill #1:}}
RE: Leading zero for questions on separate answer sheet for perfect alignment - Added by Muh Kuh over 5 years ago
With hbox to 3.8em this looks perfect! Thank you! :)
RE: Leading zero for questions on separate answer sheet for perfect alignment - Added by Eric Albin about 3 years ago
Hello,
I did not succeed to make such a grid.
Could you share the source code ?
Kind regards
RE: Leading zero for questions on separate answer sheet for perfect alignment - Added by Rakesh Jana over 1 year ago
I had invested a few bits of my time to fix this alignment. Here is the source code that I used to fix this issue. Hope it also works for you.
\usepackage{xstring} \def\mythresh{1} \def\AMCformQuestion#1#2{\par\hspace{-1mm}\StrLen{#1}[\inputQlen] {\sf Frage \ifthenelse{\inputQlen>\mythresh}{}{0}#1} #2 \hspace{2mm}}
(1-8/8)