I am starting to convert to LaTeX to do my homework for Math courses. I want to use sectioning to separate questions


and look something like this:

I tried to use titlesec to put the section labels in the margin but I can't stack them like I want. Any help?

  • 1
    If you're placing numbers as your section "title", then you're better off using an enumeration; for this you should consider the enumitem package.
    – Werner
    Feb 6, 2015 at 6:06
  • Are you interested in manually labelling content the way you're doing? Or is it that the list will not follow each other in some form of sequence (numerically/alphabetically)?
    – Werner
    Feb 6, 2015 at 6:14
  • @Werner Yes I want to be able to skip labels
    – TwiNight
    Feb 6, 2015 at 9:19
  • @TwiNight even if you like this you can always use \addtocounter{CTR}{somme value}
    – touhami
    Feb 6, 2015 at 10:29

1 Answer 1


Based on the assumption that you want total manual control over the list items, the following homework environment should suffice:

enter image description here



  {% \begin{homework}
   \addtolength{\@totalleftmargin}{#1}% Accommodate wide labels
  {\end{itemize}}% \end{homework}


  \item Solution to question 1a.

    blah blah blah \ldots


  \item Solution to question 1b.

    blah blah blah \ldots


  \item Solution to question 2a.

    blah blah blah \ldots


  \item Solution to question 2b.

    blah blah blah \ldots


The homework environment takes an optional argument that you can use to push the entire list over to the right, in case your section labels become too big and roll over into the left margin (they are right-aligned).

  • Have to do some tweaking but get me where I wanted. Thanks
    – TwiNight
    Feb 7, 2015 at 7:41

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.