summaryrefslogtreecommitdiff
path: root/dviware/driv-standard/papers/special-beebe-1.02/pathname.tex
blob: 73a392290cf4b0a21209a3d104e97ad733e52283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
%/u/sy/beebe/tex/pathname.tex, Sat Oct 15 14:07:20 1988
%Edit by Nelson H.F. Beebe (beebe at plot79.utah.edu)
%
% Computer filenames, host names, and mail addresses tend to be long
% strings that cause line breaking problems for TeX.  This file
% defines a macro that automatically inserts discretionary hyphens in
% its argument at potential breakpoints, and sets the text in the
% typewriter font.  It is invoked simply by enclosing the string in
% vertical bars (chosen because they do not appear in mail addresses,
% and are rare in filenames):
%
% |Friesland\%rz.informatik.uni-hamburg.dbp.de\%germany.csnet@relay.cs.net|
% |MIGHTY-MOUSE-GW.SCRC.SYMBOLICS.COM| (longest name in Arpanet host table)
%
% Note that the characters $%_#^\{}| in the string still have to be
% protected against other interpretation by prefixed backslashes.
%
% Discretionary hyphens are inserted BEFORE the characters @!%/.
%
% This code was inspired by the reversing macro in Donald E. Knuth and
% Pierre MacKay, ``Mixing right-to-left texts with left-to-right texts'',
% TUGboat 8(1)14-25 (1987) and the LaTeX \verb macro.
%
\catcode`\|=\active%	
\def|#1|{\catcode`\@=11\catcode`\%=12 {\tt \pathname#1\empty\emanhtap}%
         \catcode`\@=12\catcode`\%=14}%
%\def|#1|{{\tt \pathname#1\empty\emanhtap}}%
%
\def\pathname#1#2\emanhtap{%
   \ifx#1\empty%
   \else%
      \ifx#1.%
        \-#1%
      \else%
        \ifx#1/%
          \-#1%
         \else%
           \ifx#1@%
             \-#1%
           \else%
             \ifx#1!%
               \-#1%
             \else%
               \ifx#1\%%
                 \-#1%
               \else%
                 #1%
               \fi%
             \fi%
           \fi%
         \fi%
       \fi%
     \pathname#2\emanhtap%
   \fi}%