forked from Ishotihadus/master-thesis-format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrike.sty
executable file
·46 lines (43 loc) · 1.62 KB
/
strike.sty
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
%
% strike out text
% by [email protected]
% modified juline.sty
%
% \strike{text} - strike out text with single line
% \Strike{text} - strike out text with double line
% \overlap{text1}{text2} - overlap text2 on text2 (or vice versa)
%
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1}\definecolor{BLACK}{rgb}{0,0,0}
\newskip\wd@uline
\def\strike#1{\color{red}\strike@one#1\endstrike@one\color{black}}
\def\strike@one#1{\ifx#1\endstrike@one\def\u@line{\hskip\kanjiskip}\else%
\hskip\kanjiskip% insert glue
\settowidth{\wd@uline}{#1}%
#1\kern-\wd@uline\lower -0.2em%0.33em
\hbox{\vrule width\wd@uline height0.05em}%
%\makebox[0mm][r]{\rule[-0.33em]{\wd@uline}{0.1em}}%
\let\u@line=\strike@one\fi\u@line}
\def\Strike#1{\strike@two#1\endstrike@two}
\def\strike@two#1{\ifx#1\endstrike@two\def\u@line{\hskip\kanjiskip}\else%
\hskip\kanjiskip% insert glue
\settowidth{\wd@uline}{#1}%
#1\kern-\wd@uline\lower -0.1em
\hbox{\vrule width\wd@uline height0.05em}%
\kern-\wd@uline\lower -0.3em
\hbox{\vrule width\wd@uline height0.05em}%
%\makebox[0mm][r]{\rule[-0.33em]{\wd@uline}{0.1em}}%
\let\u@line=\strike@two\fi\u@line}
\newskip\wd@top
\newskip\wd@btm
\def\@overlap#1#2{%
%\hskip\kanjiskip% insert glue%
\settowidth{\wd@btm}{#1}\settowidth{\wd@top}{#2}%
\addtolength{\wd@top}{-\wd@btm}%
\setlength{\wd@top}{.5\wd@top}%
\setlength{\wd@uline}{\wd@btm}\addtolength{\wd@uline}{\wd@top}%
#1\kern-\wd@uline#2\hskip-\wd@top}
\def\overlap#1#2{%
\newskip\wd@topi\newskip\wd@btmi%
\settowidth{\wd@btmi}{#1}\settowidth{\wd@topi}{#2}%
\ifnum\wd@btmi>\wd@topi{\@overlap{#1}{#2}}%
\else{\@overlap{#2}{#1}}\fi}