0

Using the exam package I'm making worksheets for topics. Lets say i make one worksheet with 10 questions however i only want to see questions 2,5,7 and 10. How would i create it so only specific questions are shown on the pdf. So basically the worksheets are like a question bank rather then a whole worksheet/exam paper. Also i would like the shown questions we be numbered 1,2,3... no matter if it is actually 2,5,7...

  • Maybe the following can help you: Generate exam from a question bank? – leandriis Mar 01 '19 at 19:43
  • i have just found that but its not really helping me much. i dont really want to change my code too much i was just wondering if there was a specific package or something to like print questions 1-6 – Jettie Baker Mar 01 '19 at 19:45
  • Without changing much of the code, you could comment the questions you don't want to be included and recompile. This way only the uncommented questions appear and are consecutively numbered. – leandriis Mar 01 '19 at 19:55
  • what do u mean by comment the questions – Jettie Baker Mar 01 '19 at 20:06
  • Use a % sign in front of the question you don't want to show: `\documentclass{exam}

    \begin{document}

    \begin{questions} \question Question 1 %\question Question 2 \question Question 3 \end{questions}

    \end{document}`. will result in the following output: https://i.stack.imgur.com/vSdCe.png

    – leandriis Mar 01 '19 at 20:07
  • as i have may parts to a question and solutions and everything it just comes out wrong and its a lot of lines of code to % – Jettie Baker Mar 01 '19 at 20:16
  • 1
    \usepackage{verbatim} and then \begin{comment} and \end{comment} – koleygr Mar 01 '19 at 20:32
  • sorry what will this do – Jettie Baker Mar 01 '19 at 20:47
  • 2
    Commenting the lines from \begin{comment} to \end{comment} without need of % on each line.... Thought it was obvious by the names... You need to include in this environment questions 1, 3-4, 6 and 8-10... So, only 2,5 and 7 will remain in your active code – koleygr Mar 01 '19 at 20:50
  • thank you so much that is perfect for me thanks – Jettie Baker Mar 01 '19 at 20:53
  • Welcome... I could provide a better answer if you had a MWE in your question... We could create an environment for both questions and answers and make this environment a dummy environment for the questions you want to exclude... Happy TeXing anyway – koleygr Mar 01 '19 at 20:56

1 Answers1

2

You can use \iffalse,...,\fi for skipping the desired questions.

\documentclass[answers]{exam}


    \begin{document}

    \begin{questions}

    \question Approximate $\displaystyle \int_0^1 \sin x^2 \, dx$ within $.001$ of
    its true value.


    \question Calculate the $$\int_{(5,6)}^{(3,3)} \mathbf{F}\cdot d\mathbf{l}$$
    for $\mathbf{F}(x,y,z)=xy\mathbf{a}_x + (3x-y^2)\mathbf{a}_y$.

    \iffalse
    \question Skipped question.
    \fi

    \question Find the gradient of\\[0.5cm]
    a- $f(x,y,z)=xy^2+2z$\\
    b- $f(r,\phi,z)=2rsin\phi$\\
    c- $f(R,\theta,\phi)=2\theta+R^2$\\

    \question Last question.

    \end{questions}
    \end{document}

enter image description here