2

I am new to LaTeX and trying to compile several questions and answers for a book. I would be using question answer after a certain section or as per choice anywhere in the document.

So, I want the questions & answer to be auto-numbered. the numbering should reset once I use another set of exercise at some other section of the document. My sample design is as provided in the image This is one option that I will use inside the chapter at various sections This option I will be using at the end of the chapter

The MWE may be as follows

%The colour and font size of the text should be customizable as an option red colour to be used for font% %The questions and answers are are grouped together for each question and there are various types of question%

%Please note I already have tcolourbox for labeling and referencing so title exercise 1.1 etc. not needed. I only this this question and answer listing so that I able to use them as where I like. No need to link to any section or chapter % as I already have the colorbox code for that inside which i will put his code.%%

\documentclass[hidelinks,11pt]{book}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{exercise}
\usepackage{xsim}
\usepackage{blindtext}
\usepackage[english]{babel}

\begin{document}



{\noindent \textbf \LARGE  This is one option of one by one question answer}\bigskip

{\noindent \textbf {Question 1.}} Which if the following is a secondary memory Devices.?\hfill \break  
    (a) keyboard    (b) Monitor (c) Hard Disk   (d) SMPS \hfill \break          
{\textbf {Answer 1.}} (c) Hard Disk.     \vspace{2\baselineskip} %used for skiping line for next question visibility

{\noindent \textbf {Question 2.}} Recently deleted files are stored in\hfill \break           
    (a) Recycle bin (b) Taskbar (c) My computer (d) desktop \hfill \break       
{\textbf {Answer 2.}} ( a) Recycle bin.      \vspace{2\baselineskip}

{ \noindent \textbf {Question 3.}} What is RAM  \hfill \break             
{\noindent \textbf {Answer 3.}} RAM is Random Acess Memory.  \vspace{2\baselineskip}

 {\noindent \textbf {Question 4.}} What is ROM  \hfill \break             
  {\noindent \textbf {Answer 4.}} ROM is Read Only Memory.  \vspace{2\baselineskip} \hfill \break

 {\noindent \textbf \LARGE This is 2nd  option of grouping question and snwer seperately } \bigskip

{\textbf \LARGE {Questions}} \par

{\noindent \textbf {\underline {A. MCQ}}}\hfill \break

{\noindent \textbf {Question 1.}} Which if the following is a secondary memory Devices.?\hfill \break  
    (a) keyboard    (b) Monitor (c) Hard Disk       (d) SMPS   \hfill \break    

{\noindent \textbf {Question 2.}} Recently deleted files are stored in\hfill \break           
    (a) Recycle bin (b) Taskbar (c) My computer (d) desktop     \hfill \break

{\noindent \textbf {\underline{B. Very Short Questions}}} \hfill \break
{\noindent \textbf {Question 3.}} What is RAM \hfill \break \par
{\noindent \textbf {\underline{C. Short Questions}}}\hfill \break
{\noindent \textbf {Question 4.}} What is ROM and its function?  \hfill \break \par
{\noindent \textbf \LARGE Answers}\par  \bigskip \par
{\noindent \textbf  {\underline{A. MCQ}}}\par
{\noindent \textbf {Answer 1.}} (c) Hard Disk.\hfill \break
{\noindent \textbf {Answer 2.}} ( a) Recycle bin.\hfill \break \par
{\noindent \textbf {\underline{ B. Very Short Questions}}}\par
{\noindent \textbf {Answer 3.}} RAM is Random Acess Memory.\hfill \break \par
{\noindent \textbf  {\underline{C. Short Questions}}}  \par
{\noindent \textbf {Answer 4.}} ROM is Read Only Memory.\hfill \break
\blindtext 

\end{document}
  • Can anyone guide me on use of package xsim. I find it very new and from the documentation, it seems to have so many customizable options. But the programming code seems to be tough for me as a beginner to design this as per my need. – Deb bijan Aug 2 '18 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.