summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ghab/ghab.sty
blob: 6338014a9d2dac92e38894a22eea962b9b2b0da4 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
%%
%% This is file `ghab.sty',

%% 
%%   __________________________________
%%   Copyright © 2011 Vafa Khalighi
%% 
%%   License information appended.
%% 
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ghab}[2011/10/25 v0.1 ghab boxes in LaTeX]
\font\ghalameghab=ghab

\def\darghab{\@ifnextchar[{\@darghab}{\@darghab[\linewidth]}}

\def\@darghab[#1]{\@ifnextchar>{\@@darghab[#1]}{\@@darghab[#1]><}}

\def\@@darghab[#1]>#2<#3{{\def\@vasateghab{#1}\ifx\@vasateghab\@void
\else
\def\@vasateghab{\ifhmode \par\fi\centerline}%
\fi
{\ghalameghab#2\relax\global\expandafter\let\expandafter\@ghalameghab\the\font}
\def\@kagh##1##2{\hbox to \@tempdima{\ghalameghab#2\relax\char##2
\leaders\hrule height \fontdimen5\@ghalameghab width \fontdimen5\@ghalameghab\hfill
\char##1}}%
\setbox\@tempboxa\vbox{\ifx\@vasateghab\@void \hbox{#3}\else
\@tempdima=-\fontdimen6\@ghalameghab
\advance\@tempdima-\fontdimen5\@ghalameghab
\advance\@tempdima-2\fboxsep
\advance\@tempdima#1\relax
\hsize=\@tempdima  \linewidth\hsize #3\fi}%
\setbox\@tempboxa\hbox{\kern\fboxsep\box\@tempboxa
\kern\fboxsep}%
\setbox\@tempboxa\vbox{\@tempdima=\fontdimen6\@ghalameghab \@tempdimb\@tempdima
\advance\@tempdima\wd\@tempboxa \let\@hss\hss
\advance\@tempdimb-\fontdimen5\@ghalameghab \divide\@tempdimb by \tw@
\def\@koo{\vrule width \fontdimen5\@ghalameghab\relax}\offinterlineskip
\@kagh{1}{2}\hbox to \@tempdima{\kern\@tempdimb\@koo\@hss
\box\@tempboxa \@hss\@koo\kern\@tempdimb}\@kagh{3}{4}}%
\ifx\@vasateghab\@void $\vcenter{\box\@tempboxa}$\else
\@vasateghab{\box\@tempboxa}\fi}}
\endinput
%% 
%% Copyright © 2011      by Vafa Khalighi     <vafaklg@gmail.com>
%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status)
%% by Vafa Khalighi.
%% 
%% 
%% 
%% 
%%
%% End of file `ghab.sty'.