diff options
author | Karl Berry <karl@freefriends.org> | 2015-04-25 22:54:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-04-25 22:54:38 +0000 |
commit | 2a92a6832a61207bb75fc1c5d17cd692137a11be (patch) | |
tree | 3ec6dd7382a05e7532970577f6f92607d14e3ec6 /Master/texmf-dist/tex/xelatex/bidi/bidipoem.sty | |
parent | 4689c7acddfa64375a78e6703a6c2671131e3628 (diff) |
bidi (25apr15)
git-svn-id: svn://tug.org/texlive/trunk@37050 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/bidipoem.sty')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/bidi/bidipoem.sty | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/bidipoem.sty b/Master/texmf-dist/tex/xelatex/bidi/bidipoem.sty index 55370db5242..423fb044fd4 100644 --- a/Master/texmf-dist/tex/xelatex/bidi/bidipoem.sty +++ b/Master/texmf-dist/tex/xelatex/bidi/bidipoem.sty @@ -17,7 +17,7 @@ %% by Vafa Khalighi. %% %% -%% \CheckSum{44160} +%% \CheckSum{44308} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -36,7 +36,38 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bidipoem}% -[2014/02/05 v0.7 Environments for typesetting Persian traditional and modern poems] +[2014/04/25 v0.8 Environments for typesetting Persian traditional and modern poems] +\newcommand*{\bidipoem@spreadbox}[2]{\hbox to #1{#2}} + + +\newdimen \bidipoem@hvlen \newdimen \bidipoem@hvsep +\newdimen \bidipoem@hvind \newdimen \bidipoem@@hvlen + +\newcommand*{\Setversedim}[2]{% set lengths of half-verse, [separation] +\bidipoem@hvind \textwidth +\bidipoem@hvlen #1\relax \advance \bidipoem@hvind -\bidipoem@hvlen +\ifx [#2\def \bidipoem@next {\bidipoem@set@verseI [}\else +\bidipoem@@hvlen \bidipoem@hvlen \def \bidipoem@next {\bidipoem@set@@verse {#2}}\fi \bidipoem@next } + +\def \bidipoem@set@verseI [#1]{% optional parameter +\bidipoem@@hvlen #1\relax \bidipoem@set@@verse } + +\newcommand*{\bidipoem@set@@verse}[1]{% separation +\advance \bidipoem@hvind -\bidipoem@@hvlen \bidipoem@hvsep #1\relax +\advance \bidipoem@hvind -\bidipoem@hvsep \divide \bidipoem@hvind 2 } + +\newcommand*{\traditionalconnverses}[3]{% first half-verse, connection, second half-verse +\ifdim 0pt > \bidipoem@hvind % +\bidipoem@spreadbox \bidipoem@hvlen {#1}\\ \hfill % first block +\else +\noindent \hskip \bidipoem@hvind \relax \bidipoem@spreadbox \bidipoem@hvlen {#1}\fi +\bidipoem@spreadbox \bidipoem@hvsep {#2}% separator +\bidipoem@spreadbox \bidipoem@@hvlen {#3}% second block +\par } + +\newcommand*{\traditionalhalfverses}[2]{% normal case +\traditionalconnverses {#1}{\hfill}{#2}} + {\catcode`\^^M=\active % these lines must end with % \gdef\traditionalpoem@obeylines{\catcode`\^^M\active \let^^M\traditionalpoem@par}% \global\let^^M\traditionalpoem@par} % this is in case ^^M appears in a \write |