1

I need to answer my assignment in latex with a

Assignment 1a 
Assignment 1b
Assignment 1c
Assignment 2a
Assignment 2b

I have tried to use the \section*{}, but referencing then doesn't work. Is there another way of being able to have a section and subsection with numbers and letters as shown above?

  • Thank you :-) Could you give an example? Would be most appreciated! – jubibanna Apr 4 at 22:20
2

Here's a simple way to do it, with no package just using \section and an assignment environment. Since this abuses the \section command, it's not usable within a document that also requires regular sections, but the approach could be adapted use \subsection instead.

\documentclass{article}
\newcounter{assignment}
\renewcommand{\thesection}{Assignment~\arabic{assignment}\alph{section}}
\newenvironment{assignment}{\refstepcounter{assignment}}{\setcounter{section}{0}}
\begin{document}
\begin{assignment}
\section{First sub assignment}
\section{Second sub assignment}
\section{Third sub assignment}
\end{assignment}
\begin{assignment}
\section{First sub assignment}
\section{Second sub assignment}
\end{assignment}
\end{document}

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.