2011-01-20 9 views
1

設定しています。タイプライターフォントのディレクトリ名。これらの名前は長くなることがあります。ハイフネーションパッケージでは、ハイフネーションを有効にしました。 今、欠けているのは、ハイフネーション文字が置き換えられていることです。後方に向いた矢印によって。 このように、私は何をしたいしかし、\ ensuremath {\ hookleftarrow}が、この場合にラテックス:ハイフネーション文字を下矢印で置き換えます。

\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} 

のようなものを動作しません - それは、単一の文字ではありません。

誰かが私に解決策を教えてもらえますか?どうもありがとう!

+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

クール - ありがとう! –