1

When I gave my code in the exam class like

\begin{parts}
\part \begin{lstlisting} 
echo The date is $date 
\end{lstlisting}
\part \begin{lstlisting} 
echo The date is $(date) 
\end{lstlisting}
\end{parts}

I want is the line starting with echo in (a) and (b) respectively. Instead that only \part displays only (a)

  • Add a blank line or a \par between \end{lstlisting} and \part. – cgnieder Mar 6 '13 at 8:20
1

Putting it in \lstinline solved my problem

\begin{parts}
\part \lstinline{echo The date is $date}
\part \lstinline{echo The date is $(date)}
\end{parts}

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.