diff options
author | Karl Berry <karl@freefriends.org> | 2011-10-26 22:57:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-10-26 22:57:18 +0000 |
commit | 06b4bf9ef5d764d27d350c8e06cf3c9712a73bc5 (patch) | |
tree | 8a8dd674b6b051cef58977c0fb029e43ff997071 | |
parent | 05c835a6040bd6fa00faa62d865285e19ee0242c (diff) |
ghab (26oct11)
git-svn-id: svn://tug.org/texlive/trunk@24412 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/tex/latex/ghab/ghab.sty | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/ghab/ghab.sty b/Master/texmf-dist/tex/latex/ghab/ghab.sty index 6338014a9d2..09e6e28180b 100644 --- a/Master/texmf-dist/tex/latex/ghab/ghab.sty +++ b/Master/texmf-dist/tex/latex/ghab/ghab.sty @@ -9,13 +9,40 @@ %% %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ghab}[2011/10/25 v0.1 ghab boxes in LaTeX] +\ProvidesPackage{ghab}[2011/10/25 v0.2 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\if@RTL\char##1\else\char##2\fi +\leaders\hrule height \fontdimen5\@ghalameghab width \fontdimen5\@ghalameghab\hfill +\if@RTL\char##2\else\char##1\fi}}% +\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}}% +}{% \def\@@darghab[#1]>#2<#3{{\def\@vasateghab{#1}\ifx\@vasateghab\@void \else \def\@vasateghab{\ifhmode \par\fi\centerline}% @@ -39,7 +66,8 @@ \@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}} +\@vasateghab{\box\@tempboxa}\fi}}% +}} \endinput %% %% Copyright © 2011 by Vafa Khalighi <vafaklg@gmail.com> |