我正在以打字机字体设置例如目录名称。这些名称可能会变长。使用连字符包,我启用了连字符。现在,缺少的是连字符被替换为例如向后的箭头。因此,我想做的是
\usepackage[htt]{hyphenat}
\newcommand{\origttfamily}{}%
\let\origttfamily=\ttfamily%
\renewcommand{\ttfamily}{\origttfamily \hyphenchar\font=\ensuremath{\hookleftarrow}}
\begin{document}
\texttt{/etc/really/long{\fshyp}directory{\fshyp}name/}
\end{document}
但是,\ensuremath{\hookleftarrow} 在这种情况下不起作用 - 它不是单个字符。
有人可以指出我的解决方案吗?非常感谢!