Is it possible to insert source code listings in test problems created using esami package?

I've tried using verbatim environment or listings package, but I get no output.



\date{2016/12/17}%%% THE DATE IN THE FORMAT YYYY/MM/DD
\def\Data{\longdate}%%% or \shortdate: the date in the heading







and this is prob1.tex:

\item My problem

This is
  my code
  • Can you provide a sample of code - preferably a minimal example - that we can play with? – Werner Dec 16 '16 at 19:23
  • Yes, I've edited my post – totera Dec 18 '16 at 9:54

I think that the problem is the use of the verbatim environment, which is also used by the package for many purposes. You can try to use the cprotect package and write, just after \begin{document}, \cMakeRobust{\newproblem}. I hope this helps.

  • Thanks, it works! Actually, I had to switch to alltt environment because I needed esami parameters inside the source code. Your workaround works for both verbatim and alltt. – totera Dec 24 '16 at 18:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.