1

Basically what I want to achieve is something like this.

enter image description here

Well i want to enumerate my questions but I want to have two boxes one for true and one for false also. So I need a third column next to the existing one for False. Also, I want the boxes to be a little smaller.(I don't think that this would be a problem to minimize the boxes). The problem is that I don't know how to achieve such a result. I have searched through TeX Stack Exchange and I have not come up with something similar and I want such a result for a book I am writing.

Any help is appreciated.

1
  • 2
    surely you don't need tikz, just something like \hfill\fbox{ } \fbox{ } ? Commented Dec 15, 2015 at 12:20

2 Answers 2

2

One could also use tabular or tabularx.

\documentclass{article} \usepackage{tabularx} \newcounter{abc} \renewcommand{\theabc}{\stepcounter{abc}\alph{abc}} \newcommand{\answerbox}{\fbox{\phantom{M}}} \begin{document} \def\arraystretch{2}% increase vertical spacing \noindent\begin{tabularx}{\textwidth}{cXcc} & & T & F\\ (\theabc) & Fungi depend on plants and animals for food & \answerbox & \answerbox\\ (\theabc) & Ferns and mold are fungi because the reproduce from spores & \answerbox & \answerbox\\ (\theabc) & Bacteria are harmful to our body & \answerbox & \answerbox\\ (\theabc) & Yeast is a tiny living thing & \answerbox & \answerbox \end{tabularx} \end{document} 

true/false

At this point you might consider a further simplification of the form

\newcommand{\tfq}[1]% #1 = question {\stepcounter{abc}(\alph{abc}) & #1 & \answerbox & \answerbox} 
3
  • I am accepting this as it is simpler than the above.Thank you! Commented Dec 15, 2015 at 20:06
  • @Tolaso: Simpler is relative -- in this solution you have to add the answer boxes manually each time ;-) Commented Dec 16, 2015 at 5:07
  • Yes, I know that, but for the purpose I want it (in the book that I write) I will have to do it manually anyway. But I upvoted your answer as well. :) Commented Dec 17, 2015 at 9:56
5

An automated approach:

Add all questions to expl3 seq variable and show them afterwards using \seq_map_inline, filling with the boxes.


\documentclass[a4paper]{article} \usepackage{enumitem} \usepackage{xparse} \ExplSyntaxOn \seq_new:N \l_tolaso_question_seq \NewDocumentCommand{\AddQuestions}{m}{% \seq_set_split:Nnn \l_tolaso_question_seq {,} {#1}% } \NewDocumentCommand{\ShowQuestions}{}{% \begin{enumerate}[label={(\alph*)}] \seq_map_inline:Nn \l_tolaso_question_seq { \item ##1 \hfill \fbox{ }\hskip20pt \fbox{ }} \end{enumerate} } \ExplSyntaxOff \begin{document} \AddQuestions{Fungi,Other Fungi are,Bacteria are harmful to our body, Virus, Brontosaurs were large} \ShowQuestions \end{document} 

enter image description here

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.