I am producing an answersheet using LaTeX. I want to control the number of columns and I use the multicol
package for that. To force columnbreak I also use \columnbreak
command.
I face these problems
- The first line in each column always indents bad.
- The spacing between the first line and second line of each column is bad.
- There is too much vertical space below each column.
- I would also like to align the numbers
[1]
,[2]
, etc as right justified.
Any help would be appreciated.
This is my MWE.
\documentclass{article}
\usepackage{multicol,pgf,pgffor,calculator,ifthen}
\setlength{\columnseprule}{0.4pt}
\newcommand{\AuxAnswerspace}[2]{
\DIVIDE{#2}{#1}{\Auxlinesx}
\FLOOR{\Auxlinesx}{\Auxlinesx}
\foreach\x in {1,...,#2} {
\MODULO{\x}{\Auxlinesx}{\Auxstartx}
\ifthenelse{\equal{\Auxstartx}{1}}{}{\vspace{.07cm}}
\noindent[\textbf{\x}] \hfill\newline
\ifthenelse{\equal{\Auxstartx}{0}}{\vfill\null\columnbreak}{\vspace{.07cm}}
}
}
\newcommand{\answerspace}[2]{
\hrule
\begin{multicols}{#1}
\noindent\AuxAnswerspace{#1}{#2}
\end{multicols}
\hrule
}
\begin{document}
\section*{Part-I}
\answerspace{3}{15}
\vspace{.3cm}
Correct = \hfill Wrong = \hfill Marks = \hspace{3cm}
\vspace{.3cm}
\hrule
\end{document}