6

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

逐字逐句不是我想要的,并且用 \\ 结束每个句子不尊重缩进。有没有一种简单的方法可以实现这一点,还是我必须手动调整它?

4

4 回答 4

2

我建议使用该tabularx软件包。tabular与普通环境不同,这将使 LaTeX 自动断行。

\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

更多信息:

于 2011-02-25T01:52:32.380 回答
0

好的,到目前为止我发现的最好的方法是使用 org-mode (因为这是我首先生成 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}
于 2011-02-25T01:49:09.227 回答
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}
于 2011-02-26T21:32:53.137 回答
0

也许我在之前的回答中误解了你的问题。如果您希望缩进量自动调整为最长标签,请使用 itemize:

\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}
于 2011-02-26T21:41:50.427 回答