Latex:用向后箭头替换连字符
我正在以打字机字体设置例如目录名称。这些名称可能会变长。使用 hyphenat 包,我启用了连字符。 现在,缺少的是连字符被替换为例如向后箭头。 因此,我想做的是
\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} 在这种情况下不起作用 - 它不是单个字符。
有人可以指出我的解决方案吗?多谢!
I am setting e.g. directory names in a typewriter font. These names can become long. With the hyphenat package, I enabled hyphenation.
Now, what is missing, is that the hyphenation character is replaced e.g. by a backwards oriented arrow.
Thus, what I want to do is something like
\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}
however, \ensuremath{\hookleftarrow} does not work in this case - it is not a single character.
Can somebody point me towards a solution? Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法将
\hyphenchar
设置为其他字体的字符,但可以重新定义\BreakableSlash
:You cannot set the
\hyphenchar
to a character from a different font, but you can redefine\BreakableSlash
: