1

I'm writing a list for a design brief which looks like this:

\begin{enumerate}
\item \textbf{Feasibility guarantee:} \label{req1} 
    \begin{itemize}
         \item[Specification:] The solution of the hydraulic model bla bla bla 3 lines of text
         \item[Test:] The error found when comparing bla bla bla 5 lines of text
     \end{itemize}
\item \textbf{Certifiable optimality:} \label{req2} 
     \begin{itemize}
          \item[Specification:] The optimality bla bla bla 6 lines of text
           \item[Test:] It must be possible to prove  bla bla bla 3 lines of text
     \end{itemize}
\end{enumerate}

and the result is:enter image description here

and as you can see the yellow highlighted bits are outside of the text box.

So my question is: How to move the item indent further to the right, or even better, what other latex methods are there to make such a design brief. I tried a table but it doesn't look very nice.

  • Did you try a description environment, \begin{description}\item[Label] Text \item[Another label] Text \end{description}? – gernot Dec 21 '16 at 10:16
  • No, never heard of it. Going to look into it now. – ic_fl2 Dec 21 '16 at 10:35
  • Somehow related: tex.stackexchange.com/q/241107/34551 – Clément Dec 21 '16 at 16:47
  • @gernot I've tried the description environment and also the simple paragraph one, but it doesn't look quite like what I wanted. But thanks for mentioning an environment I'd never heard of. – ic_fl2 Dec 22 '16 at 15:11
1

The problem comes from the way labels are aligned: for enumerate and itemize, by default, they're placed at the left of the list left margin and right-aligned. For the description environment, the label is placed on the text left margin, and left-aligned; the same is true for the wide option of enumitem, except the label is placed at a fixed distance of the text left margin (defaults to parindent), and thelistleft margin is thetextleft margin; this maybe changed with theleftmargin=` key.

Illustration with 3 possibilities:

        \documentclass{article}
    \usepackage[showframe]{geometry}%

     \usepackage{enumitem}

        \begin{document}

    \begin{enumerate}
    \item \textbf{Feasibility guarantee:} \label{req1}
        \begin{itemize}[wide=0pt, font=\normalfont\itshape]
             \item[Specification:] The solution of the hydraulic model bla bla bla 3 lines of text bla bla bla 3 lines of textl bla bla bla 3 lines of text bla bla bla 3 lines of text bla bla bla 3 lines of text bla bla bla 3 lines of textl bla bla bla 3 lines of text bla bla bla 3 lines of text
             \item[Test:] The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text.
             \end{itemize}
    \item \textbf{Certifiable optimality:} \label{req2}
         \begin{itemize}[wide=0pt, leftmargin=*, font=\normalfont\itshape]
              \item[Specification:] The optimality bla bla bla 6 lines of text
               \item[Test:] It must be possible to prove bla bla bla 3 lines of text
         \end{itemize}
    \end{enumerate}
    \bigskip
    \begin{enumerate}
    \item \textbf{Feasibility guarantee:} \label{req1}
        \begin{itemize}[wide=0pt, leftmargin=*, font=\normalfont\itshape]
             \item[Specification:] The solution of the hydraulic model bla bla bla 3 lines of text bla bla bla 3 lines of textl bla bla bla 3 lines of text bla bla bla 3 lines of text bla bla bla 3 lines of text bla bla bla 3 lines of textl bla bla bla 3 lines of text bla bla bla 3 lines of text
             \item[Test:] The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text.
             \end{itemize}
    \item \textbf{Certifiable optimality:} \label{req2}
         \begin{itemize}[wide=0pt, leftmargin=*, font=\normalfont\itshape]
              \item[Specification:] The optimality bla bla bla 6 lines of text
               \item[Test:] It must be possible to prove bla bla bla 3 lines of text
         \end{itemize}
    \end{enumerate}
    \bigskip
    \begin{enumerate}
    \item \textbf{Feasibility guarantee:} \label{req1}
        \begin{description}[font=\normalfont\itshape]
             \item[Specification:] The solution of the hydraulic model bla bla bla 3 lines of text bla bla bla 3 lines of textl bla bla bla 3 lines of text bla bla bla 3 lines of text bla bla bla 3 lines of text bla bla bla 3 lines of textl bla bla bla 3 lines of text bla bla bla 3 lines of text
             \item[Test:] The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text. The error found when comparing bla bla bla 5 lines of text.
             \end{description}

    \item \textbf{Certifiable optimality:} \label{req2}
         \begin{description}[font=\normalfont\itshape]
              \item[Specification:] The optimality bla bla bla 6 lines of text
               \item[Test:] It must be possible to prove bla bla bla 3 lines of text
         \end{description}
    \end{enumerate}

    \end{document} 

enter image description here

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.