\href
如果我们总是在本地按照\sloppy
如下方式进行操作,这是否是一种好的做法?
if you are interested to know the details,
please contact me at {\sloppy
\href{mailto:[email protected]}
{[email protected]}}.
答案1
否。放置在那里的命令\sloppy
无效:
\documentclass{article}
\usepackage{hyperref}
\usepackage[width=7cm]{geometry}
\begin{document}
If you are interested to know the details,
please contact me at {\sloppy
\href{mailto:[email protected]}
{[email protected]}}.
If you are interested to know the details,
please contact me at
\href{mailto:[email protected]}
{[email protected]}.
\end{document}
该命令\sloppy
只适用于完整段落,因此需要编写
{\sloppy
If you are interested to know the details,
please contact me at {
\href{mailto:[email protected]}
{[email protected]}}.
\par
}
或使用sloppypar
。然而,这往往不能令人满意。一些讨论可以在禁忌。对于你的情况,我建议你使用
\url{[email protected]}
Hyperref 应该能够推断链接类型,并且它提供了更多 LaTeX 可以使用的断点。举一个更现实的例子,当.
电子邮件地址中有更多 ' 时,这会产生相当好的结果:
If you are interested to know the details,
please contact me at
\url{[email protected]}.