[comp.text.tex] Feynman slash -- question

spit@ruunsa.fys.ruu.nl (Werenfried Spit) (03/04/91)

I know it has been asked before,but is there
someone having a good solution for the so
called Feynman slash: a '/' put through a symbol.


Thanks





Werenfried Spit                            
   R.J. v.d. Graafflaboratorium            +31-(0)30-53-2330                   
   Postbus 80.000                          
   3508 TA  Utrecht                        spit@fys.ruu.nl      
   The Netherlands                         spit@hutruu51.bitnet    

h75@nikhefh.nikhef.nl (Henk Uijterwaal) (03/04/91)

In article <1960@ruunsa.fys.ruu.nl> spit@ruunsa.fys.ruu.nl (Werenfried Spit) writes:
>
>I know it has been asked before,but is there someone having a good solution 
>for the so called Feynman slash: a '/' put through a symbol.
>
>Thanks
>
>Werenfried Spit                            

I always use:

      $h\!\!\!\!/$

(the letter, a few negative spaces and the slash).

There are probably better ways to do this, but it works!

Henk.

myers@ut-emx.uucp (Eric Myers) (03/05/91)

In article <1960@ruunsa.fys.ruu.nl> spit@ruunsa.fys.ruu.nl (Werenfried
Spit) writes: 
>
>I know it has been asked before,but is there
>someone having a good solution for the so
>called Feynman slash: a '/' put through a symbol.

To do it right you really should define each symbol with a slash
through it separately to make it look correct.  In place of all
that work though here is \slashchar from TeXsis:


%  \slashchar puts a slash through a character to represent contraction
%  with Dirac matrices. Use \not instead for negation of relations, and use
%  \hbar for hbar.

\def\slashchar#1{\setbox0=\hbox{$#1$}           % set a box for #1 
   \dimen0=\wd0                                 % and get its size
   \setbox1=\hbox{/} \dimen1=\wd1               % get size of /
   \ifdim\dimen0>\dimen1                        % #1 is bigger
      \rlap{\hbox to \dimen0{\hfil/\hfil}}      % so center / in box
      #1                                        % and print #1
   \else                                        % / is bigger
      \rlap{\hbox to \dimen1{\hfil$#1$\hfil}}   % so center #1
      /                                         % and print /
   \fi}                                         %

-- 
Eric Myers		"Frankie say '\relax'"

Center for Relativity, Department of Physics, University of Texas at Austin
myers@emx.utexas.edu  |   myers@utaphy.bitnet   |   myers@ut-emx.UUCP

ogawa@orion.arc.nasa.gov (Arthur Ogawa) (03/05/91)

In article <45048@ut-emx.uucp> myers@ut-emx.uucp (Eric Myers) writes:
|In article <1960@ruunsa.fys.ruu.nl> spit@ruunsa.fys.ruu.nl (Werenfried
|Spit) writes: 
|>
|>I know it has been asked before,but is there
|>someone having a good solution for the so
|>called Feynman slash: a '/' put through a symbol.
|
|To do it right you really should define each symbol with a slash
|through it separately to make it look correct.  In place of all
|that work though here is \slashchar from TeXsis:
|
|
|%  \slashchar puts a slash through a character to represent contraction
|%  with Dirac matrices. Use \not instead for negation of relations, and use
|%  \hbar for hbar.
|
|\def\slashchar#1{\setbox0=\hbox{$#1$}           % set a box for #1 
|   \dimen0=\wd0                                 % and get its size
|   \setbox1=\hbox{/} \dimen1=\wd1               % get size of /
|   \ifdim\dimen0>\dimen1                        % #1 is bigger
|      \rlap{\hbox to \dimen0{\hfil/\hfil}}      % so center / in box
|      #1                                        % and print #1
|   \else                                        % / is bigger
|      \rlap{\hbox to \dimen1{\hfil$#1$\hfil}}   % so center #1
|      /                                         % and print /
|   \fi}                                         %
|

Eric's implementation won't work well within super or supersuperscripts;
a no-fuss implementation is to type, eg,

\not\gamma

This uses the cmsy character "34, the zero-width slash. It was invented 
for precisely this application. It works with Computer Modern math fonts,
but not necessarily other math fonts, so be careful if you've pulled
PostScript fonts into your macro package. It does work with script
and scriptscript typesetting.

phys59@jetson.uh.edu (03/05/91)

In article <1167@nikhefh.nikhef.nl>, h75@nikhefh.nikhef.nl (Henk Uijterwaal) writes:
> 
> In article <1960@ruunsa.fys.ruu.nl> spit@ruunsa.fys.ruu.nl (Werenfried Spit) writes:
>>
>>I know it has been asked before,but is there someone having a good solution 
>>for the so called Feynman slash: a '/' put through a symbol.
>>
>>Thanks
>>
>>Werenfried Spit                            
> 
> I always use:
> 
>       $h\!\!\!\!/$
> 
> (the letter, a few negative spaces and the slash).
> 
> There are probably better ways to do this, but it works!

What about the \not operator in plain TeX?  Or does that just work with 
equivalence operators?
Ron Parker

myers@ut-emx.uucp (Eric Myers) (03/05/91)

In article <1991Mar4.231207.25665@news.arc.nasa.gov>
ogawa@orion.arc.nasa.gov (Arthur Ogawa) writes: 
>Eric's implementation won't work well within super or supersuperscripts;
>a no-fuss implementation is to type, eg,
>
>	\not\gamma


The problem with this is that the slash doesn't really appear where it
should.  Try it on the letter A, which is, I think, the most common
letter to receive the Feynman slash (it is at least when I'm doing the
minimally coupled Dirac equation):

	$\not A$ 

My \slashchar works only a little better.  Try it.

	$\slashchar{A}$

But I remind you what I said in the first place:

>In article <45048@ut-emx.uucp> myers@ut-emx.uucp (Eric Myers) writes:
>|To do it right you really should define each symbol with a slash
>|through it separately to make it look correct.  

Each character should get the slash through it in a slightly different
place.  \slashchar punts and puts it through the center.

Note also: luckily one never needs to put a Feynman slash in sub or
superscript, so that is not an issue.

-- 
Eric Myers		"Frankie say '\relax'"

Center for Relativity, Department of Physics, University of Texas at Austin
myers@emx.utexas.edu  |   myers@utaphy.bitnet   |   myers@ut-emx.UUCP