Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to hyphenate at the slash as well in \texttt?

47 views
Skip to first unread message

Ton 't Lam

unread,
Mar 26, 2003, 3:40:26 AM3/26/03
to
I have many \texttt{/very/long/path/} that I want to have hyphenated
at the slash. By default \texttt is not hyphenated, and the package
'hyphenat' seems to be a candidate. The issue is that I need to use
\fshyp{}very\fshyp{} etc. Another way is to split in \texttt{/very/long/}
\texttt{path/}. Not a joy if you have many path names.

What are the alternatives to have hyphenations in \texttt and PATHs.
Ideally the hyphanation should be

bla bla bla /very/long/
path/

and not

bla bla bla /very/long/- % dash
path/

--
Best Regards,
Ton 't Lam

David Kastrup

unread,
Mar 26, 2003, 4:08:47 AM3/26/03
to

The FAQ (see signature) would have pointed you to url.sty.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>

Maurizio Loreti

unread,
Mar 26, 2003, 4:03:09 AM3/26/03
to
Ton 't Lam <ton-...@hp.com> writes:

> I have many \texttt{/very/long/path/}

> [snip]

FAQ. Check http://www.tex.ac.uk/cgi-bin/texfaq2html?label=setURL and
use url.sty .

--
Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html
Dept. of Physics, Univ. of Padova, Italy ROT13: ybe...@cq.vasa.vg

Ton 't Lam

unread,
Mar 26, 2003, 6:31:03 AM3/26/03
to
Thank you both, Maurizio and David.

url{} does what I want.

$ more try.tex
\documentclass{minimal}
\usepackage[obeyspaces,spaces]{url}
\begin{document}
bla bla bla % much more
\url{/abc/abc/abc}
bla bla bla
\url{abc abc abc}
\end{document}

--
Best Regards,
Ton 't Lam

Ton 't Lam

unread,
Mar 28, 2003, 9:30:06 AM3/28/03
to
> $ more try.tex
> \documentclass{minimal}
> \usepackage[obeyspaces,spaces]{url}
> \begin{document}
> bla bla bla % much more
> \url{/abc/abc/abc}
> bla bla bla
> \url{abc abc abc}
> \end{document}

P.S.

If you use the hyperref package then \url{/var/adm} will get referenced as well.
The solution is to use the path.sty. E.g. \path|/var/adm|

Robin Fairbairns

unread,
Mar 28, 2003, 3:54:40 PM3/28/03
to
Ton 't Lam <ton-...@hp.com> writes (quoting who knows who?):

>> $ more try.tex
>> \documentclass{minimal}
>> \usepackage[obeyspaces,spaces]{url}
>> \begin{document}
>> bla bla bla % much more
>> \url{/abc/abc/abc}
>> bla bla bla
>> \url{abc abc abc}
>> \end{document}
>
>P.S.
>
>If you use the hyperref package then \url{/var/adm} will get
>referenced as well.

itym "made into an anchor".

>The solution is to use the path.sty. E.g. \path|/var/adm|

why? at the time it was released i found path.sty deeply pleasing,
but as a latex package it's pretty hopeless. among other things, it's
irremediably "fragile": back in 1994 i tried to use it as a basis for
the first printed edition of the faq, and had to give up. the faq
went on for ages with a weird set of macros for urls and paths and
things for ages until i finally got around to switching to \urldef
from of the url package.

i'ld say, use \path from url, and consign path.sty to its honourable
retirement.
--
Robin Fairbairns, Cambridge

Ton 't Lam

unread,
Apr 1, 2003, 8:34:31 AM4/1/03
to

Robin Fairbairns wrote:

>
> itym "made into an anchor".
>
> >The solution is to use the path.sty. E.g. \path|/var/adm|
>
> why? at the time it was released i found path.sty deeply pleasing,
> but as a latex package it's pretty hopeless. among other things, it's
> irremediably "fragile": back in 1994 i tried to use it as a basis for
> the first printed edition of the faq, and had to give up. the faq
> went on for ages with a weird set of macros for urls and paths and
> things for ages until i finally got around to switching to \urldef
> from of the url package.
>
> i'ld say, use \path from url, and consign path.sty to its honourable
> retirement.
> --
> Robin Fairbairns, Cambridge

But then you need to load url in advance

\usepackage[obeyspaces,spaces]{url}
\usepackage[pdftex,colorlinks,breaklinks=true]{hyperref}
...
\path{/my/very/log/path}

At least I don't know how to set obeyspaces,spaces afterwards.
I need this to prevent overfilled lines.

With regards to path.sty, I propose to obsolete that package,
or have a warning somewhere. The FAQ 151 is a bit to advertizing
for path.sty

0 new messages