繁体   English   中英

制作乳胶荣誉新品

[英]make latex honor newlines

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

逐字不是我想要的,用\\\\完成每一句话并不尊重缩进。 有没有一种简单的方法可以实现这一目标,还是我必须手动调整它?

我建议使用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

更多信息:

好的,到目前为止我找到的最好的方法是使用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}

只需将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}

也许我在之前的回答中误解了你的问题。 如果您希望缩进的amont自动调整为最长的标签,请使用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}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM