[texhax] special accent
Pavel Minev Penev
pavpen at berkeley.edu
Thu Jun 3 07:55:44 CEST 2004
On Wed, Jun 02, 2004 at 07:42:39AM -0500, Samuel Paolucci wrote:
> Yes, I have tried the accents package.
>
> Perhaps I should have been more clear, but I want the double accents, say
> the grave accent twice, side by side like a \ddot on top of a greek symbol
> in math mode.
OK. Try this:
[-- Begin Quotation: --------------------------------------------------]
\documentclass{article}
\usepackage{accents}
\makeatletter
%
% Code stolen from accents.sty and modified:
%
% Code for real accents which prints the accent, but not the accented
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% character:
% ~~~~~~~~~~
\def\cc at accentPhantom#1#2{%
\begingroup
\cc at code=#1\relax
\let\math at bgroup\@empty
\def\math at egroup##1{\cc at setchar##1}%
\cc at palette\cc@@accentPhantom{#2}%
\cc at nuc
\endgroup%
}
\def\cc@@accentPhantom#1#2{%
\let\cc at style=#1%
\cc at fetch{#2}%
\mathaccent\cc at code{%
\ifcc at more#2\else
\cc at phant{#2}%
\gdef\cc at nuc{}%
\fi
\kern\cc at skew%
}%
\kern-\cc at skew
\kern\cc at wd%
}
% Double grave accent (as \ddot):
% % ``
% $\dgrave a$ % Gives a
\gdef\dgrave#1{%
% We place the box to be accented, then on top of it we place
% two accented phantoms of this box. The phantoms are slightly
% displaced (4mu).
%
% Character "7012 is the grave accent:
\rlap{$\mkern-2.0mu\protect\cc at accentPhantom{"7012}{#1}$}%
\rlap{$\mkern2.0mu\protect\cc at accentPhantom{"7012}{#1}$}%
#1%
}
\makeatother
\begin{document}
$\dgrave f$
$\dgrave \alpha \dgrave a \dgrave h$
\end{document}
[-- End Quotation. ----------------------------------------------------]
It takes into account an accented character's skew, and inherits some
functionality from <accents.sty>. (Like package options "single" and
"nonscript").
Happiness,
--
Pav
http://www.againsttcpa.com/ ,., My type: Dvorak.
http://swpat.ffii.org/ ,``:'',
{o ! o}
Gain your human right of ] -+- [ My GPG/PGP key is now available at
privacy: use cryptography! \ ! / x-hkp://search.keyserver.net:11371.
`-'
`shell$ gpg --keyserver x-hkp://search.keyserver.net:11371 --recv-key 164C028F`
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://tug.org/pipermail/texhax/attachments/20040602/6ed24a14/attachment.bin
More information about the texhax
mailing list