句子对齐

句子对齐

有人知道我该如何对齐句子吗?例如:

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

我想以two与 相同的位置水平开始这个单词Find

我尝试过\tab,但没有解决我的问题。

答案1

你可能想要类似这样的东西:

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

在此处输入图片描述

答案2

像这样吗?

在此处输入图片描述

附言:什么是完工时间?

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

答案3

使用tabbing是众多方法之一。

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

不过,对于这种情况,我更喜欢使用环境description

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

答案4

linguex与定制盒子相比,使用以下解决方案具有一些优势:

姆韦

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

相关内容