有人知道我该如何对齐句子吗?例如:
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
答案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}