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?

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

1 Answer 1

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .