1

I'm using enumitem to have a custom enumeration like this :

Step 1 : first step

Step 2 : second step

I looked up this answer, and adapted it :

\begin{enumerate}[label=\bfseries Step \arabic*:]
    \item Elliptic Key Creation :
    \item Exchange of Public Elliptic keys
    \item MasterSecret Computation
\end{enumerate}

Up to now it's okay.

I now have a margin problem. The text after the \item doesn't shift to the right, and so, as the Step X : is longer than a simple -, the Step X : appears in the margin, like this : MWE result

Is there a way to shift this of the length of the \item text ?

4

Use leftmargin=*

\documentclass{article}
\usepackage{enumitem}
\usepackage{showframe}
\begin{document}
  \begin{enumerate}[label=\bfseries Step \arabic*:,leftmargin=*]
    \item Elliptic Key Creation :
    \item Exchange of Public Elliptic keys
    \item MasterSecret Computation
\end{enumerate}
\end{document}

enter image description here

Or set a proper itemindent if you want to control the indent.

\documentclass{article}
\usepackage{enumitem}
\usepackage{showframe}
\begin{document}
  \begin{enumerate}[label=\bfseries Step~\arabic*:,itemindent=3em]
    \item Elliptic Key Creation : 
    \item Exchange of Public Elliptic keys
    \item MasterSecret Computation
\end{enumerate}
\end{document}

enter image description here

| improve this answer | |
  • 1
    @EisenHeim: You are welcome. The manual can be accessed at www.texdoc.net or run texdoc enumitem from your terminal. No need of reading the entire manual but refer to it when needed. Anyway some times we won't know what key word to search for. So, it is OK to ask questions :) – user11232 Sep 25 '15 at 6:50

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.