Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I started out with LaTeX today and already got my first question. I want to create a question document using enumerations. However when I give the first enumeration level a long label like "Question 1.", the a), b), c) on the next level are indented so they are behind the Question 1.

Is there a way to disable this feature so less space is wasted?

Also, the compiler directly puts "a)" behind Question 1. if I don't write something behind question 1. How can I fix that one?

Here's the code:

\documentclass[a4paper]{article}

\begin{document}

\begin{enumerate}
\renewcommand{\labelenumi}{\Large \bfseries Question \theenumi.}
\renewcommand{\labelenumii}{\Large \theenumii)}
\renewcommand{\labelenumiii}{\large (\theenumiii)}
    \item blub
    \begin{enumerate}
        \item blub
        \begin{enumerate}
            \item blub
        \end{enumerate}
    \end{enumerate}

\end{enumerate}
\end{document}
share|improve this question
    
Regarding the second part: Put ~ or \hspace{0pt} after your first \item. –  Qrrbrbirlbel Sep 29 '12 at 21:52
2  
Welcome to TeX.SX! You are probably using the wrong tool: I'd better see "Question 1" as a section title. Would you like to add a "real world" example? –  egreg Sep 29 '12 at 21:52
    
To add to egreg's comment: the next level's entries (a), b), etc.) are not indented. "Question 1." is typeset way into the margin. (Use \usepackage{showframe} to see it yourself.) –  Qrrbrbirlbel Sep 29 '12 at 21:56
    
Thanks, I started using Sections and Paragraphs at first and then i realized that it was just overcomplicating things and then threw it all away.. a hybrid probably really is the best choice. ~ also worked perfectly. I'll check out the package thx! –  Xaser Sep 29 '12 at 21:56
add comment

1 Answer

Mixing different font sizes like that may be bad for your health and the following may not be your best choice. Anyway... you can make a question list with the package enumitem and adjust the indentation manually as you see fit. For example you can go with:

\documentclass{article}

\usepackage{enumitem}
\usepackage{lipsum}

\newlist{question}{enumerate}{3}
\setlist[question, 1]{label=\Large{\textbf{Question \arabic*.}},
  leftmargin=*}       % This avoids "Question" sticking out the margin
\setlist[question, 2]{label=\Large{\alph*)},
  leftmargin=-5.3em}  % Adjust appropriately to get proper indentation
\setlist[question, 3]{label=\Large{(\roman*)}}

\begin{document}

\lipsum
\begin{question}
\item blub
  \begin{question}
  \item blub
    \begin{question}
    \item blub
    \end{question}
  \end{question}
\end{question}
\lipsum

\end{document}

Output of example

share|improve this answer
    
Is there any way to make the leftmargin for the second level dynamic based on the width of the label in the first level? E.g. -(width of longest first-level label)+1em –  Gary Mar 30 '13 at 0:15
    
@Gary I am not sure how to produce that. That would mean that lists with different first level label will have different indentation for the second level? You could post a new question and refer to this answer. –  N.N. Mar 30 '13 at 9:33
    
Right, say I have made a newenvironment that sets up the nested lists above, but with a parameter that allows the label in the first level to be specified. Depending on the width of the value passed to act as the first-level labels, the second-level leftmargin would always need to be tweaked. An ideal solution would be something where the actual left margin used for the second-level list is dynamically calculated to be a set width (e.g. 1em) from the actual left margin used for the first-level label. –  Gary Apr 1 '13 at 23:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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