7
\documentclass{article}
\begin{document}
\begin{center}
Exercise-1
\end{center}

\begin{enumerate}
  \item 1st question.
  \item 2nd question.
  \begin{enumerate}
    \item sub numbering of 2nd question.
    \item sub numbering of 2nd question.
  \end{enumerate}
\end{enumerate}

\end{document}

Here the output is:

Exercise-1 
1. 1st question. 
2. 2nd question. 
  (a) sub numbering of 2nd question. 
  (b) sub numbering of 2nd question 

But I want to get the following outputs:

Exercise-1 
(a) 1st question. 
(b) 2nd question. 
  (i) sub numbering of 2nd question. 
  (ii) sub numbering of 2nd question. 

OR

Exercise-1 
(i) 1st question. 
(ii) 2nd question.
  (a) sub numbering of 2nd question.
  (b) sub numbering of 2nd question.
6
  • Here the output is : Exercise-1 1. 1st question. 2. 2nd question. (a) sub numbering of 2nd question. (b) sub numbering of 2nd question But I want to get the following outputs : Exercise-1 (a) 1st question. (b) 2nd question. (i) sub numbering of 2nd question. (ii) sub numbering of 2nd question. OR Exercise-1 (i) 1st question. (ii) 2nd question. (a) sub numbering of 2nd question. (b) sub numbering of 2nd question. Mar 20, 2013 at 15:02
  • If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it).
    – Anke
    Mar 20, 2013 at 15:11
  • 3
    Please always put the question into the actual post, not into a comment below it.
    – Jake
    Mar 20, 2013 at 15:11
  • 4
    Please don't post your question in a comment. In its current form, your question might not receive many answers. Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. This may require you to show some effort on your part in terms of attempting a solution. If you have questions about what to do or if you don't quite understand what this means, please ask for clarification using the add comment function.
    – Anke
    Mar 20, 2013 at 15:12
  • 3
    @MdKutubuddinSardar: Even though this question did receive quite a large number of answers, I think your future questions would be even better if you put a bit more work in. It's generally appreciated if you show that you've done some research: Show what you've tried, link to questions that cover similar problems and explain why the answers don't work in your case.
    – Jake
    Mar 20, 2013 at 15:31

4 Answers 4

10

The enumerate package provides a simple mechanism to change the labels.

Sample output

\documentclass{article}

\usepackage{enumerate}

\begin{document}

\begin{center}
Exercise~1
\end{center}

\begin{enumerate}[1.]
  \item 1st question.
  \item 2nd question.
  \begin{enumerate}[(a)]
    \item sub numbering of 2nd question.
    \item sub numbering of 2nd question.
  \end{enumerate}
\end{enumerate}

\begin{center}
  Excerise~2
\end{center}

\begin{enumerate}[(a)]
  \item 1st question.
  \item 2nd question.
  \begin{enumerate}[(i)]
    \item sub numbering of 2nd question.
    \item sub numbering of 2nd question.
  \end{enumerate}
\end{enumerate}

\end{document}

For more control over lists, including setting default labels, the enumitem package can be recommended.

8

This is easily done by the enumitem package. Here it is for your first case.

Here, the first level enumerate environment gets (\roman) labels through the \setlist[enumerate,1]{label=(\roman*)} setting and the second level gets (\alph) labels through \setlist[enumerate,2]{label=(\alph*)}. The syntax for \setlist is \setlist[<listname>,<level>]{<format>}.

\documentclass{article}

\usepackage{enumitem}
\setlist[enumerate,1]{label=(\roman*)}
\setlist[enumerate,2]{label=(\alph*)}

\begin{document}
\begin{center}
Exercise-1
\end{center}

\begin{enumerate}
  \item 1st question.
  \item 2nd question.
  \begin{enumerate}
    \item sub numbering of 2nd question.
    \item sub numbering of 2nd question.
  \end{enumerate}
\end{enumerate}

\end{document}

enter image description here

Edit

I failed to mention that you can use enumerate-like syntax with the shortlabels options.

\documentclass{article}

\usepackage[shortlabels]{enumitem}

\begin{document}

\begin{center}
Exercise-1
\end{center}

\begin{enumerate}[(a)]
  \item 1st question.
  \item 2nd question.
  \begin{enumerate}[(i)]
    \item sub numbering of 2nd question.
    \item sub numbering of 2nd question.
  \end{enumerate}
\end{enumerate}

\begin{center}
Exercise-2
\end{center}

\begin{enumerate}[(i)]
  \item 1st question.
  \item 2nd question.
  \begin{enumerate}[(a)]
    \item sub numbering of 2nd question.
    \item sub numbering of 2nd question.
  \end{enumerate}
\end{enumerate}

\end{document}

enter image description here

6

You can pass the "numbering" of your choice an an optional argument to the \item command:

\documentclass{article}
\begin{document}
\begin{center}
Exercise-1
\end{center}

\begin{enumerate}
 \item[(a)] 1st question.
 \item[(b)] 2nd question.
 \begin{enumerate}
  \item[(i)] sub numbering of 2nd question.
  \item[(ii)] sub numbering of 2nd question.
 \end{enumerate}
\end{enumerate}

\end{document}

This is a manual change, however. To change it automatically, you have to define \renewcommand{\labelenumi}{\roman{enumi})} - at least for the top level. You can probably change the lower levels too. For even more flexibility, you can use the enumitem package.

4

You need to redefine the markers that are used for the enumerate. These are controlled by the command \theenumi (for top level of enumerate list \theenumii for second level etc.). The marker options are then set to one of arabic,alph,Alph,Roman or roman. Here's a MWE

\documentclass{article}

%Redefine the first level
\renewcommand{\theenumi}{\roman{enumi}}
\renewcommand{\labelenumi}{(\theenumi)}

%Redefine the second level
\renewcommand{\theenumii}{\alph{enumii}}
\renewcommand{\labelenumii}{(\theenumii)}

\begin{document}
\begin{center}
Exercise-1
\end{center}

\begin{enumerate}
  \item 1st question.
  \item 2nd question.
  \begin{enumerate}
    \item sub numbering of 2nd question.
    \item sub numbering of 2nd question.
  \end{enumerate}
\end{enumerate}


\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.