2011-01-20 1 views
1

예 : 타자기 글꼴의 디렉토리 이름. 이 이름들은 길어질 수 있습니다. 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가}이 경우에는 작동하지 않습니다 같은 것입니다 - 그것은 하나의 문자가 아닙니다.

누군가 나를 해결책으로 가리킬 수 있습니까? 고마워요!

+2

http://tex.stackexchange.com/ – orlp

+0

죄송합니다 - 당신은 내가 더 질문을 게시한다는 의미는 tex.stackexchange.com에서? –

답변

0

당신은 다른 글꼴의 문자에 \hyphenchar를 설정할 수 없습니다,하지만 당신은 \BreakableSlash을 다시 정의 할 수 있습니다 :

\documentclass{minimal} 
\usepackage[htt]{hyphenat} 
\newsavebox\leftarrowbox 
\sbox\leftarrowbox{$\leftarrow$} 
\makeatletter 
\renewcommand*{\BreakableSlash}{% 
    \leavevmode 
    \[email protected] 
    /% 
    \discretionary{\usebox\leftarrowbox}{}{}% 
    \[email protected] 
} 
\makeatother 
\begin{document} 
\parbox{20mm}{% 
    \texttt{/etc\fshyp really\fshyp long\fshyp directory\fshyp name/}% 
} 
\end{document} 
+0

쿨 - 정말 고마워요! –