2011-02-25 54 views
5

LaTeX环境中是否有这样的环境?使乳胶荣誉换行

Feb 22 06:00AM - Wake up 
Feb 22 06:15AM - Have breakfast 
Feb 22 08:00AM - A very long sentence that I will have to break at some point 
       but maintaining indentation 
Feb 22 08:00AM - Or maybe just a list here 
       One 
       Two 
       Three 

逐字符不是我想要的,并且用\\结束每个句子不会压缩缩进。有没有简单的方法来完成这个,或者我将不得不手动调整它?

+0

您可以只使用表吗? – rlibby 2011-02-25 01:35:43

+0

@rlibby是的,我没有想到正确的方式:)距离LaTeX太多的时间了。 – user525602 2011-02-25 01:50:33

+0

顺便说一句 - 你可能会在[tex.stackexchange.com](http://tex.stackexchange.com)上得到更好的LaTeX答案(这并不是说在这里发布这个有任何问题)。 – dmckee 2011-02-25 02:30:29

回答

1

我建议使用tabularx包。这将让LaTeX自动打破长线,不像普通的tabular环境。

\documentclass{article} 
\usepackage{tabularx} 

\begin{document} 
\begin{tabularx}{\columnwidth}{rX} 
Feb 22 06:00AM -& Wake up \\ 
Feb 22 06:15AM -& Have breakfast \\ 
Feb 22 08:00AM -& A very long sentence that I will have to break at some point 
        but maintaining indentation \\ 
Feb 22 08:00AM -& Or maybe just a list here 
        One 
        Two 
        Three 
\end{tabularx} 
\end{document} 

如果你想要把手动断裂处,很简单:

Feb 22 08:00AM -& Or maybe just a list here \\ 
       & One \\ 
       & Two \\ 
       & Three 

的更多信息:

0

确定迄今为止我发现的最好方法是使用组织模式(因为这是我在第一个地方生成LaTeX的方式)并使用orgmode表。

| Feb 22 06:00AM - | Wake up                     | 
| Feb 22 06:15AM - | Have breakfast                   | 
| Feb 22 08:00AM - | A very long sentence that I will have to break at some point but maintaining indentation | 
|     | Or maybe just a list here                | 
|     | One                      | 
|     | Two                      | 
|     | Three                     | 

然后它会被导出为一个表格的环境,就像这样:

\begin{tabular}{ll} 
Feb 22 06:00AM - & Wake up                     \\ 
Feb 22 06:15AM - & Have breakfast                   \\ 
Feb 22 08:00AM - & A very long sentence that I will have to break at some point but maintaining indentation \\ 
        & Or maybe just a list here                 \\ 
        & One                      \\ 
        & Two                      \\ 
        & Three                      \\ 
\end{tabular} 
0

只需设置parindent为负值,并且让每一个项目是一个段落:

\documentclass{article} 
\parindent -4em 
\begin{document} 
Feb 22 06:00AM - Wake up 

Feb 22 06:15AM - Have breakfast 

Feb 22 08:00AM - A very long sentence that I will have to break at some point but maintaining indentation 

Feb 22 08:00AM - Or maybe just a list here\\ 
      One\\ 
      Two\\ 
      Three\\ 
\end{document} 
0

也许我误解你的问题在我以前的答案。如果要将缩进的自动调整为最长的标签,请使用分项:

\documentclass{article} 
\begin{document} 
\begin{itemize} 
\item[Feb 22 06:00AM -] Wake up 
\item[Feb 22 06:15AM -] Have breakfast 
\item[Feb 22 08:00AM -] A very long sentence that I will have to break at some point but maintaining indentation 
\item[Feb 22 08:00AM -] Or maybe just a list here\\ 
      One\\ 
      Two\\ 
      Three\\ 
\end{itemize} 
\end{document}