11

Since 2005, I have generally used this model to create multiple-choice tests for my students. I kindly ask you if there are packages or macros, or particular strategies to have squares with the letters A, B, C, D inside. I created the letter E with the underline (tabular) if, for pure typing error or distraction, I had not put the correct answer.

As you can see with the red arrows I do not have perfect squares and I think that all this depends on the letter used. But is it possible to find a solution to not use tabular? There is also another problem. Should I use aligned or other strategies to get a perfect alignment in mathematical mode? In which way could I have an optimal result? enter image description here

Here there is my MWE:

\documentclass[leqno,11pt,landscape,a3paper]{extarticle}
\usepackage{graphicx,multicol,mathtools}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}



\begin{multicols}{1}
\begin{enumerate}


\item La velocità di 1,00$\cdot 10^2$ m/s espressa in km/h è:

$\fbox{A}$  36 km/h.\\
$\fbox{B}$    360 km/h.\\
$\fbox{C}$  27,8 km/h.\\
$\fbox{D}$    $3,\!60\cdot 10^{8}$ km/h.\\
$\fbox{E}$ \begin{tabular}{lllllllllllll}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{6}{c}{} \\
\hline
\end{tabular}

\item In fisica nucleare si usa l'angstrom (simbolo: 1\AA=$10^{-10}$ m) e il fermi o femtometro (1 fm= $10^{-15}$ m). Qual è la relazione tra queste due unità di misura?

$\fbox{A}$  1 \AA = $10^5$ fm.\\
$\fbox{B}$    1 \AA = $10^{-5}$ fm.\\
$\fbox{C}$    1 \AA = $10^{-15}$ fm.\\
$\fbox{D}$    1 \AA = $10^{3}$ fm.\\
$\fbox{E}$ \begin{tabular}{lllllllllllll}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{6}{c}{} \\
\hline
\end{tabular}

\end{enumerate}
\end{multicols}

\clearpage
\end{document}
15
  • 4
    unrelated but Underfull \hbox (badness 10000) in paragraph at lines 54--55 Underfull \hbox (badness 10000) in paragraph at lines 54--55 is warning you about the misuse of \\ Commented Nov 25, 2018 at 20:20
  • 5
    never use \\ at the end of a paragraph, simply delete the \\ Commented Nov 25, 2018 at 20:25
  • 4
    These are way too many choices. Just give them one choice, and you will surprised how good their scores will become. ;-) Commented Nov 25, 2018 at 20:26
  • 2
    There is a package called alterqcm that I use to do MCQs, its documentation is in French. ctan.org/pkg/alterqcm Commented Nov 25, 2018 at 20:58
  • 1
    Only 1 downvote so far... :-) Commented Nov 25, 2018 at 22:39

3 Answers 3

10

The obvious problem is that D is wider than A.

We can get a true square around capital letters by using the height as width:

\documentclass{article}

\newcommand{\squarecap}[1]{\fbox{\makebox[\height]{#1}}}

\begin{document}

\squarecap{A}\par
\squarecap{B}\par
\squarecap{C}\par
\squarecap{D}\par
\squarecap{E}\par
\squarecap{M}\par

\end{document}

enter image description here

The question about the angstrom is of a different kind: \AA=$1$ has no space; if you don't want to use siunitx (which is however recommended), type in

$1\,\textup{\AA} = 10^5\,\textup{fm}$
2
  • Egreg : what does [\height] when used as the length parameter in the makebox command? Commented Nov 26, 2018 at 5:07
  • @pzorba75 In that position it refers to the natural height of the box being built. There are also \width, \depth and \totalheight Commented Nov 26, 2018 at 8:28
9

You can use \eqmakebox[<tag>][<align>]{<stuff>} to have all <stuff> with the same <tag> be set <align>ed in a box of maximum width. Below I've played around with those so you can see what the effect is:

enter image description here

\documentclass{extarticle}

\usepackage[UTF8]{inputenc}

\usepackage{siunitx,eqparbox}

% https://tex.stackexchange.com/a/34412/5764
\makeatletter
\NewDocumentCommand{\eqmathbox}{o O{c} m}{%
  \IfValueTF{#1}
    {\def\eqmathbox@##1##2{\eqmakebox[#1][#2]{$##1##2$}}}
    {\def\eqmathbox@##1##2{\eqmakebox{$##1##2$}}}
  \mathpalette\eqmathbox@{#3}
}
\makeatother

\sisetup{
  per-mode = symbol
}

\newcommand{\makeoption}[2][default]{\fbox{\eqmakebox[#1]{#2}}}
\newcommand{\genericoption}{\rule[-.2\baselineskip]{100pt}{.4pt}}

\begin{document}

\begin{enumerate}
  \item La velocità di \SI{1e2}{\metre\per\second} espressa in \si{\kilo\metre\per\hour} è:

    \makeoption{A} \eqmakebox[first][r]{\SI{36}{km/h}}.     \\
    \makeoption{B} \eqmakebox[first][r]{\SI{360}{km/h}}.    \\
    \makeoption{C} \eqmakebox[first][r]{\SI{27.8}{km/h}}.   \\
    \makeoption{D} \eqmakebox[first][r]{\SI{3.60e8}{km/h}}. \\
    \makeoption{E} \genericoption

  \item In fisica nucleare si usa l'angstrom (simbolo: $\SI{1}{\AA} = \SI{1e-9}{m}$) e il fermi o femtometro ($\SI{1}{fm} = \SI{1e-14}{m}$). 
    Qual è la relazione tra queste due unità di misura?

    \makeoption{A} $\SI{1}{\AA} = \eqmathbox[second][r]{\SI{d5}{fm}}$.   \\
    \makeoption{B} $\SI{1}{\AA} = \eqmathbox[second][r]{\SI{d-5}{fm}}$.  \\
    \makeoption{C} $\SI{1}{\AA} = \eqmathbox[second][r]{\SI{d-15}{fm}}$. \\
    \makeoption{D} $\SI{1}{\AA} = \eqmathbox[second][r]{\SI{d{3}}{fm}}$. \\
    \makeoption{E} \genericoption

\end{enumerate}

\end{document}

I'd suggest using siunitx to set content that has units.

3
  • For your opinion and for aesthetics is not better to align after the equalities all left [l]? Commented Nov 25, 2018 at 20:57
  • 1
    @Sebastiano: Sure thing. You can adjust it to suit your needs. Commented Nov 25, 2018 at 21:20
  • 3
    Please see here what the conversion between Å and m is. Commented Nov 25, 2018 at 21:30
6

Make the content of all your boxes the same width and don't set your units incorrectly, the spacing and font types are all wrong.

\documentclass{extarticle}

\usepackage{siunitx}

\begin{document}

\fbox{\makebox[0.9em]{A}} $\SI{1}{\angstrom} = \SI{e5}{fm}$.

\fbox{\makebox[0.9em]{B}} $\SI{1}{\angstrom} = \SI{e-5}{fm}$.

\fbox{\makebox[0.9em]{C}} $\SI{1}{\angstrom} = \SI{e-5}{fm}$.

\fbox{\makebox[0.9em]{D}} $\SI{1}{\angstrom} = \SI{e-5}{fm}$.

\fbox{\makebox[0.9em]{E}} \rule{2.2cm}{0.5pt}

\end{document}

enter image description here

1
  • If you make the width \ht\strutbox, it should be a perfect square (if wide enough). Commented Nov 25, 2018 at 20:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.