4

Has someone idea how I can align the sentences? For instance:

Step 2. Find the best sequence of these two jobs by calculating the makespan of         
        two alternative.

I want to begin the word two horizontally in the same position as Find.

I tried \tab but did not solve my problem.

2

You probably want something along these lines:

\documentclass{article}

\newcommand{\step}[1]{%
  \sbox0{\bfseries Step #1. }%
  \noindent\hangindent=\wd0\box0\ignorespaces
}

\begin{document}

\step{1}
Find the best sequence of these two jobs by calculating the makespan of two alternative.

\step{2}
Find the best sequence of these two jobs by calculating the makespan of two alternative.

Now normal text resumes, we have found the best sequence of these two jobs by calculating
the makespan of two alternative.
Now normal text resumes, we have found the best sequence of these two jobs by calculating
the makespan of two alternative.

\end{document}

enter image description here

  • this is exactly the answer of my question. – limonik Apr 11 '16 at 16:42
2

Something like this?

enter image description here

Aside: What is a makespan?

\documentclass{article}
\begin{document}
\noindent
\begin{tabular}{@{}l@{\ }l}
Step 2. & Find the best sequence of these \\ 
        & two jobs by calculating the makespan of two alternative. \\
\end{tabular}
\end{document}
2

Use of tabbing is one of the many ways.

\begin{tabbing}
  Step 2.\quad\= Find the best sequence of these two jobs by calculating the makespan of\\
  \>two alternative.
\end{tabbing}

However, for situations like this, I prefer to use the description environment.

...........
\usepackage{enumitem}

\begin{document}

\begin{description}[font=\normalfont]
\item [Step 2.] Find the best sequence of these two jobs by
  calculating the makespan of two alternative.
\end{description}

\end{document}
1

A solution using linguex with some advantages over make custom boxes:

mwe

\documentclass[a5paper]{article}
\usepackage{linguex}

\begin{document}

\renewcommand{\ExLBr}{\bfseries Step }
\renewcommand{\ExRBr}{.}
\setlength{\parskip}{.2em}  % optional
\setlength{\Extopsep}{.5em} % optional

\section{Steps example}

Now a non indented paragraph of text because is after the nice title of of the section.

The start of this paragraph is highlighted by using the default indentation.

\ex. Find the best sequence of these two jobs by calculating the makespan of two alternative.

\ex. Note that vertical space among steps could be configured. 

This paragraph is not indented because is after the last step.  
But the next paragraph will be indented again.

Note that the step list might be continued at any some point of the text:

\ex. We return to the step list here. Note that some vertical space among steps could be optionally added. 

\ex. This is the last step. The list stop here.

\end{document}
0

I add the answer which is exactly the same as egreg's answer but without LaTeX dependencies:

\def\step#1{\setbox0=\hbox{\bf Step #1. }%
   \noindent \hangindent=\wd0 \box0 \ignorespaces
}

The point is that this code is usable in all TeX formats (including LaTeX). I don't understand why people prefer the code with LaTeX dependencies which is a mix of LaTeX macros and primitives.

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.