summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ghab/ghab.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-04 23:10:56 +0000
committerKarl Berry <karl@freefriends.org>2013-04-04 23:10:56 +0000
commit7633c834a919361e3341218fb7cd5c3118fa5c3e (patch)
treed2bf664816c10dc6c078daab2bcd2d362e02a359 /Master/texmf-dist/tex/latex/ghab/ghab.sty
parent1a2b5684724961f124a0291b78b2a1f7940ceb83 (diff)
ghab (4apr13)
git-svn-id: svn://tug.org/texlive/trunk@29653 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ghab/ghab.sty')
-rwxr-xr-xMaster/texmf-dist/tex/latex/ghab/ghab.sty86
1 files changed, 86 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ghab/ghab.sty b/Master/texmf-dist/tex/latex/ghab/ghab.sty
new file mode 100755
index 00000000000..095fd48fe38
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ghab/ghab.sty
@@ -0,0 +1,86 @@
+%%
+%% This is file `ghab.sty',
+
+%%
+%% __________________________________
+%% Copyright © 2011–2013 Persian TeX Group
+%%
+%% License information appended.
+%%
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ghab}[2013/04/04 v0.5 ghab boxes in LaTeX]
+\RequirePackage{biditools}
+\font\ghalameghab=ghab
+
+\def\darghab{\@ifnextchar[{\@darghab}{\@darghab[\linewidth]}}
+
+\def\@darghab[#1]{\@ifnextchar>{\@@darghab[#1]}{\@@darghab[#1]><}}
+\bidi@AtEndPreamble{%
+\@ifpackageloaded{bidi}{%
+\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{\beginL\box\@tempboxa\endL}\fi}}%
+}{%
+\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–2013 by Persian TeX Group <persian-tex@tug.org>
+%%
+%% 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 Persian TeX Group.
+%%
+%%
+%%
+%%
+%%
+%% End of file `ghab.sty'.