| 1 |
|
| 2 |
% dotlessj package |
| 3 |
%%%%%%%%%%%%%%%%% |
| 4 |
% dotless j (\j) for them that wants one. |
| 5 |
|
| 6 |
% Copyright 1997 1998 David Carlisle |
| 7 |
% |
| 8 |
% This file may be distributed under the terms of the LPPL. |
| 9 |
% See 00readme.txt for details. |
| 10 |
% |
| 11 |
% David Carlisle [email protected] |
| 12 |
|
| 13 |
\NeedsTeXFormat{LaTeX2e} |
| 14 |
\ProvidesPackage{dotlessj}[1998/12/09 v0.03 dotless j package (DPC)] |
| 15 |
|
| 16 |
% 1997/09/10 v0.01 posted to c.t.t |
| 17 |
% 1997/09/11 v0.02 added \jmath support |
| 18 |
% 1998/12/09 v0.03 added \v\j for Christoph Eyrich |
| 19 |
|
| 20 |
\RequirePackage{color} |
| 21 |
|
| 22 |
% use a coloured rule rather than clipping as it is more portable |
| 23 |
% eg the Y&Y dviwindo previewer, and the OzTeX previewer support |
| 24 |
% colour package (and dviwindo can print on colour to non PS devices |
| 25 |
% such as ink jet printers). |
| 26 |
% Disadvantages of using colour are: |
| 27 |
% a) it shows up if the background is not white. |
| 28 |
% b) You have to arrange that the accent is printed after the colour. |
| 29 |
% (Easy to arrange for text accents with LaTeX's |
| 30 |
% \DeclareTextCompositeCommand, but a bit more dangerous for math |
| 31 |
% accents.) |
| 32 |
\def\j@internal{% |
| 33 |
\setbox\tw@\hbox{\copy\z@ |
| 34 |
\kern-.8\wd\z@ |
| 35 |
{\color{white}% |
| 36 |
\vrule \@height1.1\ht\z@ \@depth -1.1\ht4 \@width \wd\z@}% |
| 37 |
\kern-.2\wd\z@}% |
| 38 |
\ht\tw@\ht4 } |
| 39 |
|
| 40 |
% |
| 41 |
|
| 42 |
% The \jmath definition, set up to be passed to \mathpalette |
| 43 |
\def\jmath@#1#2{% |
| 44 |
{\m@th\sbox\z@{$#1j$}\sbox4{$#1\imath$}% |
| 45 |
\j@internal |
| 46 |
\box\tw@}}% |
| 47 |
|
| 48 |
% The \jmathaccent definition, set up to be passed to \mathpalette |
| 49 |
\def\jmath@x#1#2{% |
| 50 |
{\m@th\sbox\z@{$#1j$}\sbox4{$#1\imath$}% |
| 51 |
\j@internal |
| 52 |
\copy\tw@\kern-\wd\tw@#2{\kern\wd\tw@}}}% |
| 53 |
|
| 54 |
\DeclareRobustCommand\jmathaccent[1]{{\mathpalette\jmath@x{#1}}} |
| 55 |
|
| 56 |
|
| 57 |
\DeclareRobustCommand\jaccent[1]{% |
| 58 |
{\leavevmode\sbox\z@{j}% |
| 59 |
\hb@xt@\wd\z@{\hss\clap\j\clap{#1{}}\hss}}}% |
| 60 |
|
| 61 |
% centered version of \rlap \llap. |
| 62 |
\def\clap#1{\hb@xt@\z@{\hss#1\hss}}% |
| 63 |
|
| 64 |
|
| 65 |
% If \jmath is passed to a math accent, need to intercept it and |
| 66 |
% instead pass the accent to \jmathaccent. |
| 67 |
|
| 68 |
\let\j@mathaccent\mathaccent |
| 69 |
|
| 70 |
\def\mathaccent{\afterassignment\j@mathacc@\count@} |
| 71 |
|
| 72 |
\def\j@mathacc@#1#2{% |
| 73 |
\ifx\jmath#2% |
| 74 |
\jmathaccent{\j@mathaccent\count@}% |
| 75 |
\else |
| 76 |
% #1 should be \relax, but put it back, just in case. |
| 77 |
\j@mathaccent\count@#1{#2}% |
| 78 |
\fi} |
| 79 |
|
| 80 |
|
| 81 |
% delay everything as \j and friends get defined by encoding files |
| 82 |
% read in by, eg fontenc package. |
| 83 |
|
| 84 |
\AtBeginDocument{% |
| 85 |
% |
| 86 |
\DeclareRobustCommand\j{% |
| 87 |
{\sbox\z@{j}\sbox4{\i}% |
| 88 |
\j@internal |
| 89 |
\leavevmode\box\tw@}}% |
| 90 |
% |
| 91 |
\DeclareRobustCommand\jmath{{\mathpalette\jmath@\relax}}% |
| 92 |
% |
| 93 |
% Could do this for all known encodings, but just do it |
| 94 |
% for the default encoding at begin document, to avoid wasting |
| 95 |
% too much space. |
| 96 |
\DeclareTextCompositeCommand\'{\encodingdefault}{\j}{\jaccent\'}% |
| 97 |
\DeclareTextCompositeCommand\`{\encodingdefault}{\j}{\jaccent\`}% |
| 98 |
\DeclareTextCompositeCommand\"{\encodingdefault}{\j}{\jaccent\"}% |
| 99 |
\DeclareTextCompositeCommand\^{\encodingdefault}{\j}{\jaccent\^}% |
| 100 |
\DeclareTextCompositeCommand\~{\encodingdefault}{\j}{\jaccent\~}% |
| 101 |
\DeclareTextCompositeCommand\.{\encodingdefault}{\j}{j}% |
| 102 |
\DeclareTextCompositeCommand\={\encodingdefault}{\j}{\jaccent\=}% |
| 103 |
\DeclareTextCompositeCommand\v{\encodingdefault}{\j}{\jaccent\v}} |
| 104 |
|
| 105 |
|
| 106 |
|