| 1 |
%% |
| 2 |
%% This is file `bidishadowtext.sty'. |
| 3 |
%% |
| 4 |
%% __________________________________________________ |
| 5 |
%% Copyright © 2014 Vafa Khalighi <[email protected]> |
| 6 |
%% |
| 7 |
%% It may be distributed and/or modified under the LaTeX Project Public License, |
| 8 |
%% version 1.3c or higher (your choice). The latest version of |
| 9 |
%% this license is at: http://www.latex-project.org/lppl.txt |
| 10 |
%% |
| 11 |
%% This work is “author-maintained” (as per LPPL maintenance status) |
| 12 |
%% by Vafa Khalighi. |
| 13 |
%% |
| 14 |
%% |
| 15 |
\NeedsTeXFormat{LaTeX2e} |
| 16 |
\ProvidesPackage{bidishadowtext} |
| 17 |
[2014/07/16 v0.1 Bidi-aware shadow text] |
| 18 |
|
| 19 |
\RequirePackage{color} |
| 20 |
|
| 21 |
\newlength\bidist@shadowoffsetx |
| 22 |
\newlength\bidist@shadowoffsety |
| 23 |
|
| 24 |
\bidist@shadowoffsetx=1pt |
| 25 |
\bidist@shadowoffsety=1pt |
| 26 |
|
| 27 |
\newcommand\bidishadowoffset[1]{\setlength\bidist@shadowoffsetx{#1}\setlength\bidist@shadowoffsety{#1}} |
| 28 |
\newcommand\bidishadowoffsetx[1]{\setlength\bidist@shadowoffsetx{#1}} |
| 29 |
\newcommand\bidishadowoffsety[1]{\setlength\bidist@shadowoffsety{#1}} |
| 30 |
\newcommand\bidishadowcolor[1]{\def\bidist@shadowcolor{#1}} |
| 31 |
\newcommand\bidishadowrgb[1]{\definecolor{bidist@shadowcolorrgb}{rgb}{#1}\bidishadowcolor{bidist@shadowcolorrgb}} |
| 32 |
|
| 33 |
\bidishadowrgb{0.66,0.66,0.66} |
| 34 |
|
| 35 |
\newlength\bidist@temp@width |
| 36 |
\newlength\bidist@temp@height |
| 37 |
\newlength\bidist@pic@width |
| 38 |
\newlength\bidist@pic@height |
| 39 |
|
| 40 |
\newcommand\bidishadowtext[1]% |
| 41 |
{% |
| 42 |
\begingroup% |
| 43 |
\settowidth{\bidist@temp@width}{#1}% |
| 44 |
\settoheight{\bidist@temp@height}{#1}% |
| 45 |
\setlength{\bidist@pic@width}{\bidist@temp@width}% |
| 46 |
\setlength{\bidist@pic@height}{\bidist@temp@height}% |
| 47 |
\addtolength{\bidist@pic@width}{\bidist@shadowoffsetx}% |
| 48 |
\addtolength{\bidist@pic@height}{\bidist@shadowoffsety}% |
| 49 |
% |
| 50 |
\edef\num@tw{\strip@pt\bidist@temp@width}% |
| 51 |
\edef\num@th{\strip@pt\bidist@temp@height}% |
| 52 |
\edef\num@pw{\strip@pt\bidist@pic@width}% |
| 53 |
\edef\num@ph{\strip@pt\bidist@pic@height}% |
| 54 |
\edef\num@offsetx{\strip@pt\bidist@shadowoffsetx}% |
| 55 |
\edef\num@offsety{\strip@pt\bidist@shadowoffsety}% |
| 56 |
\raisebox{-\bidist@shadowoffsety}{ |
| 57 |
\begin{picture}(\num@pw,\num@ph)(0,0) |
| 58 |
\if@RTL\put(0,\num@offsety){\makebox(\num@tw,\num@th)[tl]{\ignorespaces #1}}\fi |
| 59 |
\put(\num@offsetx,0){\makebox(\num@tw,\num@th)[tl]{{\color{\bidist@shadowcolor}\def\color##1{}\ignorespaces #1}}} |
| 60 |
\if@RTL\else\put(0,\num@offsety){\makebox(\num@tw,\num@th)[tl]{\ignorespaces #1}}\fi |
| 61 |
\end{picture}}% |
| 62 |
\endgroup% |
| 63 |
\ignorespaces% |
| 64 |
} |
| 65 |
\endinput |
| 66 |
%% |
| 67 |
%% End of file `bidishadowtext.sty'. |