强制自动断开长行并缩进断行

强制自动断开长行并缩进断行

我有许多类似下面的 tex 文档,我想用 进行翻译pdflatex。这些文件是 vim 插件的输出,该插件从 vim 的内部语法高亮生成格式化输出。问题是生成的 pdf 中的第一行没有断开,并且超出了页边距。其他行(例如第二行)断开,但在断开之后,它们没有缩进到当前级别(当然,这并不奇怪)。它应该至少缩进到 的缩进级别(准确地说是空格)description

我可以使用脚本处理文档以进行系统性更改,例如适当的缩进和换行,或者需要了解相应影响行为的全局设置。

在此处输入图片描述

\documentclass[a4paper,12pt]{article}
\usepackage[HTML]{xcolor}
\color[HTML]{000000}
\begin{document}
\ttfamily
\noindent \par
\noindent \textcolor[HTML]{000000}{\enskip{}}\textcolor[HTML]{AA5500}{jump}\textcolor[HTML]{0000AA}{:=}\textcolor[HTML]{000000}{proc}\textcolor[HTML]{0000AA}{(}\textcolor[HTML]{000000}{f}\textcolor[HTML]{0000AA}{::}\textcolor[HTML]{000000}{name}\textcolor[HTML]{0000AA}{,}\textcolor[HTML]{000000}{t0}\textcolor[HTML]{0000AA}{::}\textcolor[HTML]{000000}{numeric}\textcolor[HTML]{0000AA}{,}\textcolor[HTML]{000000}{t1}\textcolor[HTML]{0000AA}{::}\textcolor[HTML]{000000}{numeric}\textcolor[HTML]{0000AA}{,}\textcolor[HTML]{000000}{y0}\textcolor[HTML]{0000AA}{::}\textcolor[HTML]{000000}{list}\textcolor[HTML]{0000AA}{(}\textcolor[HTML]{000000}{numeric}\textcolor[HTML]{0000AA}{)}\textcolor[HTML]{0000AA}{,}\textcolor[HTML]{000000}{N}\textcolor[HTML]{0000AA}{::}\textcolor[HTML]{000000}{posint}\textcolor[HTML]{0000AA}{,}\textcolor[HTML]{000000}{method}\textcolor[HTML]{0000AA}{::}\textcolor[HTML]{000000}{procedure}\textcolor[HTML]{0000AA}{)}\par
\noindent \par
\noindent \textcolor[HTML]{000000}{\enskip{}}\textcolor[HTML]{000000}{\enskip{}}\textcolor[HTML]{000000}{description}\textcolor[HTML]{000000}{\enskip{}}\textcolor[HTML]{0000AA}{"It\enskip{}advances\enskip{}the\enskip{}solution\enskip{}y0\enskip{}at\enskip{}t0\enskip{}by\enskip{}N\enskip{}steps\enskip{}such\enskip{}that\enskip{}it\enskip{}reaches\enskip{}t1.\enskip{}The\enskip{}step-size\enskip{}h\enskip{}is\enskip{}adjusted\enskip{}correspondingly."}\textcolor[HTML]{0000AA}{;}\par
\noindent \par
\noindent \textcolor[HTML]{000000}{\enskip{}}\textcolor[HTML]{000000}{end}\textcolor[HTML]{000000}{\enskip{}}\textcolor[HTML]{000000}{proc}\textcolor[HTML]{0000AA}{;}\par
\end{document}

相关内容