如果我們總是在本地將 \sloppy 放在 \href 之前,這是一個好習慣嗎?

如果我們總是在本地將 \sloppy 放在 \href 之前,這是一個好習慣嗎?

如果我們總是在本地先進行如下操作,這是一個好習慣\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.然而,這往往並不令人滿意。一些討論可以在L2禁忌。對於你的情況,我建議你使用

\url{[email protected]}

網址範例

Hyperref 應該能夠推斷連結類型,並且它提供了更多 LaTeX 可以使用的斷點。對於一個更實際的例子,如果.電子郵件地址中有更多,這會給出相當好的結果:

If you are interested to know the details, 
please contact me at 
\url{[email protected]}.

更好的網址範例

相關內容