PDF 上的长文件路径超出右边距

PDF 上的长文件路径超出右边距

一个简单的 LyX 文档由一个长文件路径组成,在 LyX GUI 中被包装到下一行;但是当导出为 PDF 时,它会在右边距结束后“继续”。

我希望它自动在斜线处换行。我该如何定义一些规则来实现这一点?

这是文件路径:

/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm

答案1

您可以加载网址包——我建议您在加载包时设置选项spaces、、obeyspaces和——并使用该包的宏来排版长路径名。hyphens\path

在此处输入图片描述

\documentclass{article}
\usepackage[hyphens,obeyspaces,spaces]{url}
\begin{document}
\noindent
\path{/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm/aaaa/bbbb/cccc/dddd/eeee/ffff/gggg/hhhh/iiii/jjjj/kkkk/llll/mmmm}
\end{document}

相关内容