summaryrefslogtreecommitdiff
path: root/language/hebrew/hebtex/macros/tex_macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /language/hebrew/hebtex/macros/tex_macros
Initial commit
Diffstat (limited to 'language/hebrew/hebtex/macros/tex_macros')
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/dots.tex90
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/epsf.tex194
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/fonttable.tex58
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/hclassic.tex21
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/heb_cs_guide.tex96
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/heb_macros.tex268
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/heb_macros_newcode.tex273
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/heb_pc.tex273
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/hebcal.tex908
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/hebcal_newcode.tex908
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/hebcal_p.tex908
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/hletter1.tex92
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/null.tex2
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/rotate.tex44
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/rotsample.tex33
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/testfont.tex208
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/verbatim.tex42
-rw-r--r--language/hebrew/hebtex/macros/tex_macros/vowels.tex71
18 files changed, 4489 insertions, 0 deletions
diff --git a/language/hebrew/hebtex/macros/tex_macros/dots.tex b/language/hebrew/hebtex/macros/tex_macros/dots.tex
new file mode 100644
index 0000000000..84d9fc07d9
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/dots.tex
@@ -0,0 +1,90 @@
+%(c) 1990,91 by Joel M. Hoffman belongs to hcaption, hclassic.
+%dots.tex. Version 1.0.
+%updated 5/15/91 by JMH
+
+
+%Use of this material in a commercial venture of any sort requires
+%permission from me. Otherwise, you are free to use this for any
+%legal, non-destructive purpose. If you find this useful, a
+%contribution to charity will be most appreciated.
+
+%This file provides the following commands:
+% \dagesh{ let } % put a _dagesh_ in the letter _let_.
+% \shindot{ let } % put a dot in the upper-right corner of letter _let_.
+% \sindot { let } % put a dot in the upper-left corder of letter _let_.
+% \shinwithdot % A \shin with a dot.
+% \sinwithdot % A \sin with a dot.
+% \Shinwithdot % A \Shin (i.e., \shin with a _dagesh_) with a dot.
+% \Sinwithdot % A \Sin (i.e., \sin with a _dagesh_) with a dot.
+% \odot % _Cholem Chaseir_
+% \vavdot % A dot for use over a vav (to create a _cholem male_)
+% \vavwithdot % _Cholem male_
+% \Vavwithdot % _Cholem male_ with a _dagesh_ (!?!)
+
+%Send comments or complaints to:
+%
+%BITNET: hoffman@nyuacf.BITNET <-- this will change soon
+%CompuServe: 72700,402 -or- 72700.402@compuserve.com
+%SNAIL: Joel M. Hoffman
+% 19 Hillcrest Lane
+% Rye, NY 10580
+% U.S.A.
+
+
+\def\dagesh#1{{\setbox0=\hbox{#1}%
+\let\l=#1%
+\def\vadj{.5}\def\hadj{0}%
+\if\l\shin\def\hadj{.1}\fi
+\if\l\vav\def\hadj{-.4}\fi
+\if\l\pe\def\hadj{.1}\fi
+\if\l\gimel\def\hadj{-.2}\fi
+\if\l\nun\def\hadj{-.2}\fi
+\if\l\zion\def\hadj{-.4}\fi
+\if\l\tet\def\hadj{.1}\fi
+\if\l\tzadi\def\hadj{.1}\fi
+\if\l\yud\def\hadj{-.5}\fi
+\if\l\lamed\def\vadj{.3}\fi
+\if\l\yud\def\vadj{.7}\fi
+\hbox to 0pt{%
+\kern \hadj\wd0%
+\kern .5\wd0%
+\raise \vadj\ht0%
+\hbox{\char000}%
+\kern -\hadj\wd0%
+\kern -.5\wd0}%
+\box0%
+}}
+
+\def\shindot#1{{\setbox0=\hbox{#1}%
+\hbox to 0pt{%
+\kern.78\wd0%;
+\raise1.2\ht0%
+\hbox{\char000}%
+\kern-.78\wd0}%
+\box0%
+}}
+
+\def\sindot#1{{\setbox0=\hbox{#1}%
+\hbox to 0pt{%
+\kern.20\wd0%
+\raise1.2\ht0%
+\hbox{\char000}%
+\kern-.20\wd0}%
+\box0%
+}}
+\def\shinwithdot{\shindot{\shin}}
+\def\Shinwithdot{\shindot{\Shin}}
+\def\sinwithdot{\sindot{\sin}}
+\def\Sinwithdot{\sindot{\Sin}}
+
+\def\odot{\setbox0=\hbox{\vav}%
+\kern.1\wd0\raise1.2\ht0\hbox{\char000}\kern.1\wd0}
+
+\def\vavdot#1{{\setbox0=\hbox{#1}%
+\hbox to 0pt{%
+\kern.5\wd0\raise1.2\ht0\hbox{\char000}\kern-.5\wd0}%
+\box0%
+}}
+
+\def\vavwithdot{\vavdot{\vav}}
+\def\Vavwithdot{\vavdot{\Vav}}
diff --git a/language/hebrew/hebtex/macros/tex_macros/epsf.tex b/language/hebrew/hebtex/macros/tex_macros/epsf.tex
new file mode 100644
index 0000000000..63300f102f
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/epsf.tex
@@ -0,0 +1,194 @@
+% EPSF.TEX macro file:
+% Written by Tomas Rokicki of Radical Eye Software, 29 Mar 1989.
+% Revised by Don Knuth, 3 Jan 1990.
+% Revised by Tomas Rokicki to accept bounding boxes with no
+% space after the colon, 18 Jul 1990.
+%
+% TeX macros to include an Encapsulated PostScript graphic.
+% Works by finding the bounding box comment,
+% calculating the correct scale values, and inserting a vbox
+% of the appropriate size at the current position in the TeX document.
+%
+% To use with the center environment of LaTeX, preface the \epsffile
+% call with a \leavevmode. (LaTeX should probably supply this itself
+% for the center environment.)
+%
+% To use, simply say
+% \input epsf % somewhere early on in your TeX file
+% \epsfbox{filename.ps} % where you want to insert a vbox for a figure
+%
+% Alternatively, you can type
+%
+% \epsfbox[0 0 30 50]{filename.ps} % to supply your own BB
+%
+% which will not read in the file, and will instead use the bounding
+% box you specify.
+%
+% The effect will be to typeset the figure as a TeX box, at the
+% point of your \epsfbox command. By default, the graphic will have its
+% `natural' width (namely the width of its bounding box, as described
+% in filename.ps). The TeX box will have depth zero.
+%
+% You can enlarge or reduce the figure by saying
+% \epsfxsize=<dimen> \epsfbox{filename.ps}
+% (or
+% \epsfysize=<dimen> \epsfbox{filename.ps})
+% instead. Then the width of the TeX box will be \epsfxsize and its
+% height will be scaled proportionately (or the height will be
+% \epsfysize and its width will be scaled proportiontally). The
+% width (and height) is restored to zero after each use.
+%
+% A more general facility for sizing is available by defining the
+% \epsfsize macro. Normally you can redefine this macro
+% to do almost anything. The first parameter is the natural x size of
+% the PostScript graphic, the second parameter is the natural y size
+% of the PostScript graphic. It must return the xsize to use, or 0 if
+% natural scaling is to be used. Common uses include:
+%
+% \epsfxsize % just leave the old value alone
+% 0pt % use the natural sizes
+% #1 % use the natural sizes
+% \hsize % scale to full width
+% 0.5#1 % scale to 50% of natural size
+% \ifnum#1>\hsize\hsize\else#1\fi % smaller of natural, hsize
+%
+% If you want TeX to report the size of the figure (as a message
+% on your terminal when it processes each figure), say `\epsfverbosetrue'.
+%
+\newread\epsffilein % file to \read
+\newif\ifepsffileok % continue looking for the bounding box?
+\newif\ifepsfbbfound % success?
+\newif\ifepsfverbose % report what you're making?
+\newdimen\epsfxsize % horizontal size after scaling
+\newdimen\epsfysize % vertical size after scaling
+\newdimen\epsftsize % horizontal size before scaling
+\newdimen\epsfrsize % vertical size before scaling
+\newdimen\epsftmp % register for arithmetic manipulation
+\newdimen\pspoints % conversion factor
+%
+\pspoints=1bp % Adobe points are `big'
+\epsfxsize=0pt % Default value, means `use natural size'
+\epsfysize=0pt % ditto
+%
+\def\epsfbox#1{\global\def\epsfllx{72}\global\def\epsflly{72}%
+ \global\def\epsfurx{540}\global\def\epsfury{720}%
+ \def\lbracket{[}\def\testit{#1}\ifx\testit\lbracket
+ \let\next=\epsfgetlitbb\else\let\next=\epsfnormal\fi\next{#1}}%
+%
+\def\epsfgetlitbb#1#2 #3 #4 #5]#6{\epsfgrab #2 #3 #4 #5 .\\%
+ \epsfsetgraph{#6}}%
+%
+\def\epsfnormal#1{\epsfgetbb{#1}\epsfsetgraph{#1}}%
+%
+\def\epsfgetbb#1{%
+%
+% The first thing we need to do is to open the
+% PostScript file, if possible.
+%
+\openin\epsffilein=#1
+\ifeof\epsffilein\errmessage{I couldn't open #1, will ignore it}\else
+%
+% Okay, we got it. Now we'll scan lines until we find one that doesn't
+% start with %. We're looking for the bounding box comment.
+%
+ {\epsffileoktrue \chardef\other=12
+ \def\do##1{\catcode`##1=\other}\dospecials \catcode`\ =10
+ \loop
+ \read\epsffilein to \epsffileline
+ \ifeof\epsffilein\epsffileokfalse\else
+%
+% We check to see if the first character is a % sign;
+% if not, we stop reading (unless the line was entirely blank);
+% if so, we look further and stop only if the line begins with
+% `%%BoundingBox:'.
+%
+ \expandafter\epsfaux\epsffileline:. \\%
+ \fi
+ \ifepsffileok\repeat
+ \ifepsfbbfound\else
+ \ifepsfverbose\message{No bounding box comment in #1; using defaults}\fi\fi
+ }\closein\epsffilein\fi}%
+%
+% Now we have to calculate the scale and offset values to use.
+% First we compute the natural sizes.
+%
+\def\epsfsetgraph#1{%
+ \epsfrsize=\epsfury\pspoints
+ \advance\epsfrsize by-\epsflly\pspoints
+ \epsftsize=\epsfurx\pspoints
+ \advance\epsftsize by-\epsfllx\pspoints
+%
+% If `epsfxsize' is 0, we default to the natural size of the picture.
+% Otherwise we scale the graph to be \epsfxsize wide.
+%
+ \epsfxsize\epsfsize\epsftsize\epsfrsize
+ \ifnum\epsfxsize=0 \ifnum\epsfysize=0
+ \epsfxsize=\epsftsize \epsfysize=\epsfrsize
+%
+% We have a sticky problem here: TeX doesn't do floating point arithmetic!
+% Our goal is to compute y = rx/t. The following loop does this reasonably
+% fast, with an error of at most about 16 sp (about 1/4000 pt).
+%
+ \else\epsftmp=\epsftsize \divide\epsftmp\epsfrsize
+ \epsfxsize=\epsfysize \multiply\epsfxsize\epsftmp
+ \multiply\epsftmp\epsfrsize \advance\epsftsize-\epsftmp
+ \epsftmp=\epsfysize
+ \loop \advance\epsftsize\epsftsize \divide\epsftmp 2
+ \ifnum\epsftmp>0
+ \ifnum\epsftsize<\epsfrsize\else
+ \advance\epsftsize-\epsfrsize \advance\epsfxsize\epsftmp \fi
+ \repeat
+ \fi
+ \else\epsftmp=\epsfrsize \divide\epsftmp\epsftsize
+ \epsfysize=\epsfxsize \multiply\epsfysize\epsftmp
+ \multiply\epsftmp\epsftsize \advance\epsfrsize-\epsftmp
+ \epsftmp=\epsfxsize
+ \loop \advance\epsfrsize\epsfrsize \divide\epsftmp 2
+ \ifnum\epsftmp>0
+ \ifnum\epsfrsize<\epsftsize\else
+ \advance\epsfrsize-\epsftsize \advance\epsfysize\epsftmp \fi
+ \repeat
+ \fi
+%
+% Finally, we make the vbox and stick in a \special that dvips can parse.
+%
+ \ifepsfverbose\message{#1: width=\the\epsfxsize, height=\the\epsfysize}\fi
+ \epsftmp=10\epsfxsize \divide\epsftmp\pspoints
+ \vbox to\epsfysize{\vfil\hbox to\epsfxsize{%
+ \special{PSfile=#1 llx=\epsfllx\space lly=\epsflly\space
+ urx=\epsfurx\space ury=\epsfury\space rwi=\number\epsftmp}%
+ \hfil}}%
+\epsfxsize=0pt\epsfysize=0pt}%
+
+%
+% We still need to define the tricky \epsfaux macro. This requires
+% a couple of magic constants for comparison purposes.
+%
+{\catcode`\%=12 \global\let\epsfpercent=%\global\def\epsfbblit{%BoundingBox}}%
+%
+% So we're ready to check for `%BoundingBox:' and to grab the
+% values if they are found.
+%
+\long\def\epsfaux#1#2:#3\\{\ifx#1\epsfpercent
+ \def\testit{#2}\ifx\testit\epsfbblit
+ \epsfgrab #3 . . . \\%
+ \epsffileokfalse
+ \global\epsfbbfoundtrue
+ \fi\else\ifx#1\par\else\epsffileokfalse\fi\fi}%
+%
+% Here we grab the values and stuff them in the appropriate definitions.
+%
+\def\epsfgrab #1 #2 #3 #4 #5\\{%
+ \global\def\epsfllx{#1}\ifx\epsfllx\empty
+ \epsfgrab #2 #3 #4 #5 .\\\else
+ \global\def\epsflly{#2}%
+ \global\def\epsfurx{#3}\global\def\epsfury{#4}\fi}%
+%
+% We default the epsfsize macro.
+%
+\def\epsfsize#1#2{\epsfxsize}
+%
+% Finally, another definition for compatibility with older macros.
+%
+\let\epsffile=\epsfbox
+ \ No newline at end of file
diff --git a/language/hebrew/hebtex/macros/tex_macros/fonttable.tex b/language/hebrew/hebtex/macros/tex_macros/fonttable.tex
new file mode 100644
index 0000000000..5d908ec664
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/fonttable.tex
@@ -0,0 +1,58 @@
+% Following are macros intended to display a font table.
+% Those are macros taken from /usr/lib/tex/inputs/manmac.tex.
+% The file is used by font_guide.tex.
+
+\newcount\counter % rama -- changed 'count@' to 'counter'.
+
+\def\hex#1{\hbox{\rm\H{}\tt#1}} % hexadecimal constant
+\def\oct#1{\hbox{\rm\'{}\kern-.2em\it#1\/\kern.05em}} % octal constant
+
+\def\oddline#1{\cr
+ \noalign{\nointerlineskip}
+ \multispan{19}\hrulefill&
+ \setbox0=\hbox{\lower 2.3pt\hbox{\hex{#1x}}}\smash{\box0}\cr
+ \noalign{\nointerlineskip}}
+\def\evenline{\cr\noalign{\hrule}}
+\def\chartstrut{\lower4.5pt\vbox to14pt{}}
+\def\beginchart#1{$$\postdisplaypenalty=-10000 \global\counter=0 #1
+ \halign to\hsize\bgroup
+ \chartstrut##\tabskip0pt plus10pt&
+ &\hfil##\hfil&\vrule##\cr
+ \lower6.5pt\null
+ &&&\oct0&&\oct1&&\oct2&&\oct3&&\oct4&&\oct5&&\oct6&&\oct7&\evenline}
+\def\endchart{\raise11.5pt\null&&&\hex 8&&\hex 9&&\hex A&&\hex B&
+ &\hex C&&\hex D&&\hex E&&\hex F&\cr\egroup$$}
+\def\:{\setbox0=\hbox{\char\counter}%
+ \ifdim\ht0>7.5pt\reposition
+ \else\ifdim\dp0>2.5pt\reposition\fi\fi
+ \box0\global\advance\counter by1 }
+\def\reposition{\setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}
+\def\normalchart{%
+ &\oct{00x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline0
+ &\oct{01x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
+ &\oct{02x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline1
+ &\oct{03x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
+ &\oct{04x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline2
+ &\oct{05x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
+ &\oct{06x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline3
+ &\oct{07x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
+ &\oct{10x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline4
+ &\oct{11x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
+ &\oct{12x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline5
+ &\oct{13x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
+ &\oct{14x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline6
+ &\oct{15x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
+ &\oct{16x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline7
+ &\oct{17x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline}
+
+\def\table#1{
+ \filbreak
+ \nopagenumbers
+ \centerline{The font \bf #1}
+ \bigskip
+ \font\fnt= #1
+ \beginchart{\fnt}
+ \normalchart
+ \endchart
+ }
+ \ No newline at end of file
diff --git a/language/hebrew/hebtex/macros/tex_macros/hclassic.tex b/language/hebrew/hebtex/macros/tex_macros/hclassic.tex
new file mode 100644
index 0000000000..75ed2d084a
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/hclassic.tex
@@ -0,0 +1,21 @@
+\centerline{\L{Using the Hebrew font hclassic or dclassic.}}
+
+\input hletter1 \input vowels \input dots
+\input heb_pc
+
+\sethebrew
+\font\hebrew=dclassic
+%\font\hebrew=dcaption
+\hebrew
+
+\bigskip
+
+\centerline{\ftzadi\segol{\resh}\Kamatz{\aleph}\kamatz{\heh}\
+\taf\tzere{\aleph}\shva{\vav}\
+\fmem\chiriq{\yud}\patach{\mem}\kamatz{\Shinwithdot}\patach{\heh}\
+\taf\tzere{\aleph}
+\fmem\yud\chiriq{\heh}\odot\lamed\chatafsegol{\aleph}\
+\aleph\kamatz{\resh}\kamatz{\Bet}\
+\taf\yud\chiriq{\shinwithdot}\aleph\tzere{\resh}\shva{\Bet}}
+
+\end
diff --git a/language/hebrew/hebtex/macros/tex_macros/heb_cs_guide.tex b/language/hebrew/hebtex/macros/tex_macros/heb_cs_guide.tex
new file mode 100644
index 0000000000..702ffd23e9
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/heb_cs_guide.tex
@@ -0,0 +1,96 @@
+% Hebrew control sequences.
+\font\Jer=Jerusale
+\def\today{\number\day\space\ifcase\month\or
+January\or February\or March\or April\or May\or June\or
+July\or August\or September\or October\or November\or
+December\fi
+\space\number\year}
+\footline={\phantom{\rm\today}\hfil\rm\folio\hfil\rm\today}
+%
+\let\nb=\nobreak
+\let\q\quad \let\qq\qquad
+\def\bn{\bigbreak\noindent} \def\mn{\medbreak\noindent} \def\sn{\smallbreak\noindent}
+\def\bs{{\char'134}}
+\def\bs{{\char'134}} \def\ec{{\char"21}}
+\def\dol{{\char"24}} \def\ddol{{\dol\dol}}
+\def\lb{{\char"7B}} \def\rb{{\char"7D}}
+\def\sb{{\char"5F}} \def\sp{{\char"5E}}
+\def\hash{{\char"23}}
+\font\sc=cmcsc10
+\font\rmb=cmbx12
+\font\ss=cmss10 at 11pt
+
+\centerline{\rmb \hfill Hebrew control sequences of \TeX\ and LaTeX. \hfill\rm\today}
+\vskip0.8truecm
+\rm To use in tex, type~~~~~~~~~~~~~~~ \tt\bs input heb\_pc
+
+To use in latex, type~~~~~\tt\bs documentstyle[hebrew\_p,hebcal\_p...]\lb style.. \rb
+\bigskip
+\nopagenumbers
+\def\undertext#1{$\underline{\hbox{#1}}$}
+
+
+\settabs\+\indent&\tt\hskip5.5truecm&\cr
+\+&\tt\bs sethebrew&Enter hebrew mode\cr
+\+&\tt\bs unsethebrew&Go out of Hebrew mode\cr
+\+&\tt\bs hebrewpar&Starting one hebrew paragraph with indentation\cr
+\+&\tt\bs hebrewlines&Starting one hebrew paragraph without indentation\cr
+\+&\cr
+\+&\tt\bs L\lb\dots string\dots \rb&English string within a Hebrew environment\cr
+\+&\tt\bs R\lb\dots{\Jer zixciq}\dots\rb &Hebrew string within an English environment\cr
+\+&\cr
+\+&\tt\lb\dots\rb{\Jer ybcd}\tt\bs \ or \tt\bs hadgesh\lb\dots\rb&Making bold letters - Poor man's bold --- see page 386\cr
+\+&\cr
+\+&{\Jer lecbswn}\tt\bs \ or \tt\bs makafgadol&Like the regular -\thinspace - producing --~, which doesn't work in Hebrew\cr
+\+&{\Jer wprswn}\tt\bs \ or \tt\bs makafanak&Like the regular -\thinspace -\thinspace - producing ---~, which doesn't work in Hebrew\cr
+\+&\cr
+\+&{\Jer yxb}\tt\bs \ or \tt\bs geresh&Like the regular `~, which doesn't work in Hebrew\cr
+\+&{\Jer yxbgzt}\tt\bs \ or \tt\bs opengeresh&\char39\cr
+\+&{\Jer yxbxebq}\tt\bs \ or \tt\bs closegeresh&`\cr
+\+&{\Jer hehivgzt}\tt\bs \ or \tt\bs openquote&Like the regular '', which doesn't work in Hebrew\cr
+\+&{\Jer hehivxebq}\tt\bs \ or \tt\bs closequote&Like the regular ``, which doesn't work in Hebrew\cr
+\+&\cr
+\+&{\Jer dwqit}\tt\bs \ or \tt\bs piska&Like the regular \tt\bs item, \rm modified for Hebrew ~~~~~~~~~~~Not relevant to latex.\cr
+\+&{\Jer dwqitdwqit}\tt\bs \ or\ \tt\bs piskapiska&Like the regular \tt\bs itemitem, \rm modified for Hebrew~~~~~Not relevant to latex.\cr
+\+&\cr
+\+&{\Jer meid}\tt\bs \ or \tt\bs hebday&Today's regular date in Hebrew\cr
+\+&\tt\bs Hebrewtoday&Hebrew date in Hebrew~~~~~~~~~~~~~~~~~~~~~~~~Included in hebcal.sty\cr
+\+&\tt\bs Hebrewdate~~~~(*)&Converting a Georgian date to a Hebrew date~~Included in hebcal.sty\cr
+\+&\cr
+\+&{\Jer dlecbdvitw}\tt\bs &Like the regular \tt\bs bigskip\cr
+\+&{\Jer zipepiadvitw}\tt\bs &Like the regular \tt\bs medskip\cr
+\+&{\Jer dphwdvitw}\tt\bs &Like the regular \tt\bs smallskip\cr
+\+&\cr
+\+&{\Jer oinidxey}\tt\bs &Like the regular \tt\bs rightline\cr
+\+&{\Jer l`nydxey}\tt\bs &Like the regular \tt\bs leftline\cr
+\+&{\Jer fkxn}\tt\bs &Like the regular \tt\bs centerline\cr
+\+&\cr
+\+&\tt\bs undertext\lb text \Jer hqwh\rb&Produces \undertext{text \Jer hqwh}\cr
+%
+\vskip 1cm
+\hrule
+\vskip 1cm
+
+(*)
+Usage:
+\def\bs{$\backslash$}
+
+\bs newcount\bs day~~~ \bs newcount\bs month~~~ \bs newcount\bs year
+
+\bs day=12 ~~~ \bs month=10 ~~~ \bs year=1884
+
+\bs Hebrewdate$\{$\bs day$\}\{$\bs month$\}\{$\bs year$\}$
+
+~~~~Result:
+
+\newcount\d \newcount\m \newcount\y
+\d=12 \m=10 \y=1884
+{ }
+\input heb_macr \sethebrew
+\Hebrewdate{\d}{\m}{\y}
+
+
+\bye
+
+
+ \ No newline at end of file
diff --git a/language/hebrew/hebtex/macros/tex_macros/heb_macros.tex b/language/hebrew/hebtex/macros/tex_macros/heb_macros.tex
new file mode 100644
index 0000000000..1c25f089b5
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/heb_macros.tex
@@ -0,0 +1,268 @@
+\TeXXeTstate=1
+\immediate\write10{ }
+\immediate\write10{>>> heb_macros version 1.4 <<<}
+\immediate\write10{>>> New control sequences. Type tex hebrew_cs_guide <<<}
+\immediate\write10{ }
+%% Written by Rama Porrat of the Computation Center,
+%% Hebrew University of Jerusalem,
+%% based upon Knuth's wisdom and Prof. Azriel levy's contributions.
+%%
+\newif\ifheb
+\def\undertext#1{$\underline{\hbox{#1}}$}
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
+%
+% this if is used to distinguish between a tex input and
+% a latex input.
+%
+\font\Jer=jerus10
+\def\footnoterule{\kern-3pt\hrule width \hsize \kern 2.6pt}
+\newcount\hebcheck
+ % This counter used for local text being Hebrew.
+\newcount\hebtext
+ % This counter used for overall text being Hebrew.
+%
+% Each control sequence defined here has his Hebrew equivalent.
+
+% \L = ngxefzlerfiz
+% \R = ngxefzraxiz
+
+\font\hrm=redis10
+\font\hsl=rediss10
+\font\hebrew=jerus10
+
+\ifundefined{LaTeX}
+{
+\hebcheck=1
+\hebtext =1
+\def\hebR#1{\ifodd\hebcheck\beginR#1\fi}
+\baselineskip=14pt
+\hebrew
+}
+\fi
+
+\let\next=\
+
+\def\L{\afterassignment\moreL \let\next= }
+\def\moreL{\bracetext \aftergroup\endL \beginL \rm}
+\def\R{\afterassignment\moreR \let\next= }
+\def\moreR{\bracetext \aftergroup\endR \beginR \hebrew}
+\def\bracetext{\ifcat\next{\else\ifcat\next}\fi
+ \errmessage{Missing left brace has been substituted}\fi \bgroup}
+
+\let\ngxefzlerfiz=\L
+\let\ngxefzraxiz=\R
+
+% \hebrew = \raxiz
+% The font Jerusalem = \ixeylim
+% The font telav10 = \zlaia
+% The font DeadSea = \imdnlg
+% The font OldJaffa = \ite
+
+%
+% \hebrew is activated. Now the default is Jerusalem,
+% and the \R control sequence refers to \hebrew.
+% Thanx to the sequence 'ifundefined', it is possible
+% to distinguish between latex and tex.
+% Hence, for latex, hebrew is activated by
+% hebrewtext, hebrewlines etc.
+% For tex, instead of \hebrew it says \the\font, thus enabling
+% any font (e.g. one called aaa) to be used and
+% have the right indentation.
+% The problem in latex lies in that
+% \the\font in latex usually means \rm.
+% Note that, still, the sequence \R still refers only to the font
+% called \hebrew.
+
+\font\Jerfootnote=jerus10 scaled 750
+\let\who=\Jerfootnote
+
+%\font\Jerhalf=jerus10 scaled \magstephalf
+%\font\Jerone=jerus10 scaled \magstep1
+%\font\Jertwo=jerus10 scaled \magstep2
+%\font\Jerthree=jerus10 scaled \magstep3
+%\font\Jerfour=jerus10 scaled \magstep4
+%\font\Jerfive=jerus10 scaled \magstep5
+
+\font\Telfootnote=telav10 scaled 750
+
+%\font\Telhalf=telav10 scaled \magstephalf
+%\font\Telone=telav10 scaled \magstep1
+%\font\Teltwo=telav10 scaled \magstep2
+\font\Telthree=telav10 scaled \magstep3
+%\font\Telfour=telav10 scaled \magstep4
+\font\Telfive=telav10 scaled \magstep5
+
+\font\Deadfootnote=deads10 scaled 750
+
+%\font\Deadhalf=deads10 scaled \magstephalf
+%\font\Deadone=deads10 scaled \magstep1
+%\font\Deadtwo=deads10 scaled \magstep2
+\font\Deadthree=deads10 scaled \magstep3
+%\font\Deadfour=deads10 scaled \magstep4
+\font\Deadfive=deads10 scaled \magstep5
+
+\font\Jaffafootnote=oldjaf10 scaled 750
+
+%\font\Jaffahalf=oldjaf10 scaled \magstephalf
+%\font\Jaffaone=oldjaf10 scaled \magstep1
+%\font\Jaffatwo=oldjaf10 scaled \magstep2
+\font\Jaffathree=oldjaf10 scaled \magstep3
+%\font\Jaffafour=oldjaf10 scaled \magstep4
+\font\Jaffafive=oldjaf10 scaled \magstep5
+
+\def\ixeylim{\font\hebrew=jerus10 \hebrew }
+\def\zlaia{\font\hebrew=telav10 \hebrew }
+\def\imdnlg{\font\hebrew=deads10 \hebrew }
+\def\ite{\font\hebrew=oldjaf10 \hebrew }
+% \let\Jer=\ixeylim
+\let\Tel=\zlaia
+\let\Dead=\imdnlg
+\let\Jaffa=\ite
+
+\let\bigDead=\Deadthree
+\let\biggerDead=\Deadfive
+\let\bigJer=\Jerthree
+\let\biggerJer=\Jerfive
+\let\bigTel=\Telthree
+\let\biggerTel=\Telfive
+\let\bigJaffa=\Jaffathree
+\let\biggerJaffa=\Jaffafive
+
+
+%\font\biggestTel=telav10 scaled 7000
+%\font\giantTel=telav10 scaled 13000
+
+% To use enlargements of Hebrew fonts by specifying Hebrew
+% control sequences, use the Hebrew font name appended by bet or gimel
+% (or dalet or he in telav10).
+
+\let\imdnlga=\bigDead
+\let\imdnlgb=\biggerDead
+\let\itea=\bigJaffa
+\let\iteb=\biggerJaffa
+\let\ixeylima=\bigJer
+\let\ixeylimb=\biggerJer
+\let\zlaiaa=\bigTel
+\let\zlaiab=\biggerTel
+
+\def\zlaiac{\font\hebrew=telav1010 scaled 7000 \hebrew }
+\def\zlaiad{\font\hebrew=telav1020 scaled 13000 \hebrew }
+
+\ifundefined{LaTeX}
+\def\nohebrewtext{\rm\everypar{}\hebcheck=0 \hebfalse}
+\fi
+
+\ifundefined{LaTeX}
+\def\hebrewpar{\noindent\beginR\indent\the\font
+ \ifodd\hebcheck{}\else\hebrew\hebcheck=1\fi}
+\def\hebrewtext{\everypar{\leavevmode\kern-\parindent\beginR\indent\the\font}
+ \ifundefined{fmtname}{} \else \hebrew\fi
+ \ifodd\hebcheck{}
+ \else\hebrew\fi
+ \hebcheck=1 \hebtext=1 \hebtrue}
+\def\hebrewlines{\noindent\beginR\the\font
+ \ifodd\hebcheck{}\else\hebrew\hebcheck=1\fi}
+%\else
+%\def\hebrewpar{\noindent\beginR\indent
+% \ifodd\hebcheck{}\else\hebrew\hebcheck=1\fi}
+%\def\hebrewtext{
+% \ifodd\hebcheck{}
+% \else\hebrew
+% \fi
+% \everypar{\leavevmode\kern-\parindent\beginR\indent}
+% \hebcheck=1 \hebtext=1 }
+%\def\hebrewlines{\noindent\beginR
+% \ifodd\hebcheck{}\else\hebrew\hebcheck=1\fi}
+%\fi
+%% \def\hebrewtext{\everypar{\leavevmode\kern-\parindent\beginR\indent \hebrew }
+% \hebcheck=1 \hebtext=1 \hebtrue}
+% \def\hebrewlines{\noindent\beginR \hebrew }
+% \def\hebrewpar{\noindent\beginR\indent \hebrew }
+%
+\fi
+
+\let\sethebrew=\hebrewtext
+\let\unsethebrew=\nohebrewtext
+
+\let\whrraxiz=\hebrewpar
+\let\hwqhraxiz=\hebrewtext
+\let\yexezraxiz\hebrewlines
+
+\everydisplay{\aftergroup\beginR }
+\def\negspace{\hskip -3.5pt} % From Samy Zafrany
+\everydisplay{\aftergroup\negspace} % samy@techunix.technion.ac.il
+
+
+\def\diem{\L{\number\day}\ \R{a\ifcase\month\or
+ipe`x\or
+taxe`x\or nxq\or `txil
+\or n`i\or iepi\or ieli\or
+`ebeqh\or qthnax\or `ewheax
+\or peanax\or cvnax\fi}\
+\L{\number\year}}
+
+\let\hebday=\diem
+\def\wtivdwhpd{\smallskip }
+\def\wtivdaipepiz{\medskip }
+\def\wtivdbceld{\bigskip }
+
+ \def\wtivdlnhd #1{\vskip #1 }
+ \def\wtivddvicd #1{\hskip #1}
+\def\xeegaioyexez #1{\baselineskip #1 }
+
+ \def\pw{ pt }
+ \def\pwecez{ pt }
+ \def\qes{\end }
+ \def\qn{ cm }
+
+ \def\nwsbcel{\L{--}}
+ \def\nwsrpw{\L{---}}
+\let\makafgadol=\nwsbcel
+\let\makafanak=\nwsrpw
+
+\def\dcby#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\copy0\kern-\wd0
+\kern-.025em\raise.0433em\box0 }
+
+\def\dcbyy#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\copy0\kern-\wd0
+\kern-.025em\raise.0433em\box0\raise-.0433em\box0 }
+
+\def\wewe#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\box0 }
+
+\let\hadgesh=\dcby
+\def\tiqwd#1{\item{#1}\hangindent=-\hangindent}
+\def\tqwd#1{\item{#1}\hangindent=-\hangindent}
+\let\piska=\tiqwd
+
+\def\tiqwdtiqwd#1{\itemitem{#1}\hangindent=-\hangindent}
+\def\tqwdtqwd#1{\itemitem{#1}\hangindent=-\hangindent}
+\let\piskapiska=\tiqwdtiqwd
+
+\def\yexdinio#1{\line{\R{#1 \hss}}}
+\def\yexdyn`l#1{\line{\R{\hss #1}}}
+\def\nxkf#1{\line{\R{\hss #1 \hss}}}
+
+ \def\bxy{\L{`}}
+ \let\geresh=\bxy
+
+\def\qbexbxy{\L{`}}
+\let\closegeresh=\geresh
+
+\def\tzgbxy{\L{\char39}}
+\let\opengeresh=\tzgbxy
+
+\def\openquote{\L{''}}
+\def\closequote{\L{``}}
+
+\def\leftquotation{\L{''}}
+\def\rightquotation{\L{``}}
+
+\let\tzgviheh=\openquote
+\let\qbexviheh=\closequote
+
+\input hebcal.tex
diff --git a/language/hebrew/hebtex/macros/tex_macros/heb_macros_newcode.tex b/language/hebrew/hebtex/macros/tex_macros/heb_macros_newcode.tex
new file mode 100644
index 0000000000..cbb0d78fb5
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/heb_macros_newcode.tex
@@ -0,0 +1,273 @@
+\TeXXeTstate=1
+\immediate\write10{ }
+\immediate\write10{>>> heb_macros version 1.4 <<<}
+\immediate\write10{>>> New control sequences. Type tex hebrew_cs_guide <<<}
+\immediate\write10{ }
+%% Written by Rama Porrat of the Computation Center,
+%% Hebrew University of Jerusalem,
+%% based upon Knuth's wisdom and Prof. Azriel levy's contributions.
+%%
+\newif\ifheb
+\catcode`ΰ=11\catcode`α=11\catcode`β=11\catcode`γ=11
+\catcode`δ=11\catcode`ε=11\catcode`ζ=11\catcode`η=11
+\catcode`θ=11\catcode`ι=11\catcode`λ=11\catcode`μ=11
+\catcode`ξ=11\catcode`π=11\catcode`ρ=11\catcode`ς=11
+\catcode`τ=11\catcode`φ=11\catcode`χ=11\catcode`ψ=11
+\catcode`ω=11\catcode`ϊ=11\catcode`κ=11\catcode`ν=11
+\catcode`ο=11\catcode`σ=11\catcode`υ=11
+
+\lccode`ΰ=``\lccode`α=`a\lccode`β=`b\lccode`γ=`c
+\lccode`δ=`d\lccode`ε=`e\lccode`ζ=`f\lccode`η=`g
+\lccode`θ=`h\lccode`ι=`i\lccode`λ=`k\lccode`μ=`l
+\lccode`ξ=`n\lccode`π=`p\lccode`ρ=`q\lccode`ς=`r
+\lccode`τ=`t\lccode`φ=`v\lccode`χ=`w\lccode`ψ=`x
+\lccode`ω=`y\lccode`ϊ=`z\lccode`κ=`j\lccode`ν=`m
+\lccode`ο=`o\lccode`σ=`s\lccode`υ=`u
+
+\def\undertext#1{$\underline{\hbox{#1}}$}
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
+%
+% this if is used to distinguish between a tex input and
+% a latex input.
+%
+\font\Jer=Jerusalem_newcode
+\def\footnoterule{\kern-3pt\hrule width \hsize \kern 2.6pt}
+\newcount\hebcheck
+ % This counter used for local text being Hebrew.
+\newcount\hebtext
+ % This counter used for overall text being Hebrew.
+%
+% Each control sequence defined here has his Hebrew equivalent.
+
+% \L = ngxefzlerfiz
+% \R = ngxefzraxiz
+
+\font\hrm=redis10_newcode
+\font\hsl=rediss10_newcode
+
+\ifundefined{LaTeX}
+\hebcheck=1\hebtrue
+\hebtext =1
+\def\hebR#1{\ifodd\hebcheck\beginR#1\fi}
+\baselineskip=14pt
+\font\hebrew=Jerusalem_newcode
+\hebrew
+\fi
+
+\let\next=\
+
+\def\L{\afterassignment\moreL \let\next= }
+\def\moreL{\bracetext \aftergroup\endL \beginL \rm}
+\def\R{\afterassignment\moreR \let\next= }
+\def\moreR{\bracetext \aftergroup\endR \beginR \hebrew}
+\def\bracetext{\ifcat\next{\else\ifcat\next}\fi
+ \errmessage{Missing left brace has been substituted}\fi \bgroup}
+
+
+% \hebrew is activated. Now the default is Jerusalem,
+% and the \R control sequence refers to \hebrew.
+% Thanx to the sequence 'ifundefined', it is possible
+% to distinguish between latex and tex.
+% Hence, for latex, hebrew is activated by
+% hebrewtext, hebrewlines etc.
+% For tex, instead of \hebrew it says \the\font, thus enabling
+% any font (e.g. one called aaa) to be used and
+% have the right indentation.
+% The problem in latex lies in that
+% \the\font in latex usually means \rm.
+% Note that, still, the sequence \R still refers only to the font
+% called \hebrew.
+
+\font\Jerfootnote=Jerusalem_newcode scaled 750
+\let\katan=\Jerfootnote
+\let\χθο =\Jerfootnote
+%\let\who=\Jerfootnote
+
+%\font\Jerhalf=Jerusalem_newcode scaled \magstephalf
+%\font\Jerone=Jerusalem_newcode scaled \magstep1
+%\font\Jertwo=Jerusalem_newcode scaled \magstep2
+%\font\Jerthree=Jerusalem_newcode scaled \magstep3
+%\font\Jerfour=Jerusalem_newcode scaled \magstep4
+%\font\Jerfive=Jerusalem_newcode scaled \magstep5
+
+\font\Telfootnote=TelAviv_newcode scaled 750
+
+%\font\Telhalf=TelAviv_newcode scaled \magstephalf
+%\font\Telone=TelAviv_newcode scaled \magstep1
+%\font\Teltwo=TelAviv_newcode scaled \magstep2
+\font\Telthree=TelAviv_newcode scaled \magstep3
+%\font\Telfour=TelAviv_newcode scaled \magstep4
+\font\Telfive=TelAviv_newcode scaled \magstep5
+
+\font\Deadfootnote=DeadSea_newcode scaled 750
+
+%\font\Deadhalf=DeadSea_newcode scaled \magstephalf
+%\font\Deadone=DeadSea_newcode scaled \magstep1
+%\font\Deadtwo=DeadSea_newcode scaled \magstep2
+\font\Deadthree=DeadSea_newcode scaled \magstep3
+%\font\Deadfour=DeadSea_newcode scaled \magstep4
+\font\Deadfive=DeadSea_newcode scaled \magstep5
+
+\font\Jaffafootnote=OldJaffa_newcode scaled 750
+
+%\font\Jaffahalf=OldJaffa_newcode scaled \magstephalf
+%\font\Jaffaone=OldJaffa_newcode scaled \magstep1
+%\font\Jaffatwo=OldJaffa_newcode scaled \magstep2
+\font\Jaffathree=OldJaffa_newcode scaled \magstep3
+%\font\Jaffafour=OldJaffa_newcode scaled \magstep4
+\font\Jaffafive=OldJaffa_newcode scaled \magstep5
+
+\def\ιψεωμιν{\font\hebrew=Jerusalem_newcode \hebrew }
+\def\ϊμαια{\font\hebrew=TelAviv_newcode \hebrew }
+\def\ινδξμη{\font\hebrew=DeadSea_newcode \hebrew }
+\def\ιτε{\font\hebrew=OldJaffa_newcode \hebrew }
+
+\let\Jer=\ιψεωμιν
+\let\Tel=\ϊμαια
+\let\Dead=\ινδξμη
+\let\Jaffa=\ιτε
+
+\let\bigDead=\Deadthree
+\let\biggerDead=\Deadfive
+\let\bigJer=\Jerthree
+\let\biggerJer=\Jerfive
+\let\bigTel=\Telthree
+\let\biggerTel=\Telfive
+\let\bigJaffa=\Jaffathree
+\let\biggerJaffa=\Jaffafive
+
+
+
+% To use enlargements of Hebrew fonts by specifying Hebrew
+% control sequences, use the Hebrew font name appended by bet or gimel
+% (or dalet or he in TelAviv).
+
+%\let\imdnlga=\bigDead
+%\let\imdnlgb=\biggerDead
+%\let\itea=\bigJaffa
+%\let\iteb=\biggerJaffa
+%\let\ixeylima=\bigJer
+%\let\ixeylimb=\biggerJer
+%\let\zlaiaa=\bigTel
+%\let\zlaiab=\biggerTel
+
+\ifundefined{LaTeX}
+\def\nohebrewtext{\rm\everypar{}\hebcheck=0\hebfalse}
+\fi
+
+\ifundefined{LaTeX}
+\def\hebrewpar{\noindent\beginR\indent\the\font
+ \ifodd\hebcheck{}\else\hebrew\hebcheck=1\hebtrue\fi}
+\def\hebrewtext{\everypar{\leavevmode\kern-\parindent\beginR\indent\the\font}
+ \ifundefined{fmtname}{} \else \hebrew\fi
+ \ifodd\hebcheck{}
+ \else\hebrew\fi
+ \hebcheck=1 \hebtrue\hebtext=1}
+\def\hebrewlines{\noindent\beginR\the\font
+ \ifodd\hebcheck{}\else\hebrew\hebcheck=1\hebtrue\fi}
+%\else
+%\def\hebrewpar{\noindent\beginR\indent
+% \ifodd\hebcheck{}\else\hebrew\hebcheck=1\hebtrue\fi}
+%\def\hebrewtext{
+% \ifodd\hebcheck{}
+% \else\hebrew
+% \fi
+% \everypar{\leavevmode\kern-\parindent\beginR\indent}
+% \hebcheck=1\hebtrue \hebtext=1 }
+%\def\hebrewlines{\noindent\beginR
+% \ifodd\hebcheck{}\else\hebrew\hebcheck=1\hebtrue\fi}
+%\fi
+%% \def\hebrewtext{\everypar{\leavevmode\kern-\parindent\beginR\indent \hebrew }
+% \hebcheck=1 \hebtext=1\hebtrue }
+% \def\hebrewlines{\noindent\beginR \hebrew }
+% \def\hebrewpar{\noindent\beginR\indent \hebrew }
+%
+\fi
+
+\let\sethebrew=\hebrewtext
+\let\unsethebrew=\nohebrewtext
+
+%\let\whrraxiz=\hebrewpar
+%\let\hwqhraxiz=\hebrewtext
+%\let\yexezraxiz\hebrewlines
+
+\everydisplay{\aftergroup\beginR }
+
+\def\hebday{\L{\number\day}\ \R{α\ifcase\month\or
+ ιπεΰψ\or
+ ταψεΰψ\or ξψυ\or ΰτψιμ
+\or ξΰι \or ιεπι\or ιεμι\or
+ ΰεβερθ\or ρτθξαψ\or ΰεχθεαψ
+\or πεαξαψ\or γφξαψ \fi}\
+\L{\number\year}}
+
+\let\διεν=\hebday
+\def\χτιφδχθπδ{\smallskip }
+\def\χτιφδαιπεπιϊ{\medskip }
+\def\χτιφδβγεμδ{\bigskip }
+
+% \def\wtivdlnhd #1{\vskip #1 }
+% \def\wtivddvicd #1{\hskip #1}
+%\def\xeegaioyexez #1{\baselineskip #1 }
+
+ %\def\pw{ pt }
+ %\def\pwecez{ pt }
+ %\def\qes{\end }
+ %\def\qn{ cm }
+
+\def\ξχσβγεμ{\L{--}}
+\def\ξχσςπχ{\L{---}}
+
+\let\makafanak=\ξχσςπχ
+\let\makafgadol=\ξχσβγεμ
+
+\def\hadgesh#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\copy0\kern-\wd0
+\kern-.025em\raise.0433em\box0 }
+
+\let\δγβω=\hadgesh
+
+\def\δγβωω#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\copy0\kern-\wd0
+\kern-.025em\raise.0433em\box0\raise-.0433em\box0 }
+
+\def\wewe#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\box0 }
+
+\def\τιρχδ#1{\item{#1}\hangindent=-\hangindent}
+\def\τρχδ#1{\item{#1}\hangindent=-\hangindent}
+
+\def\τιρχδτιρχδ#1{\itemitem{#1}\hangindent=-\hangindent}
+\def\τρχδτρχδ#1{\itemitem{#1}\hangindent=-\hangindent}
+
+\def\piska#1{\item{#1}\hangindent=-\hangindent}
+
+\def\piskapiska#1{\itemitem{#1}\hangindent=-\hangindent}
+
+\def\ωεψδιξιο#1{\line{\R{#1 \hss}}}
+\def\ωεψδωξΰμ#1{\line{\R{\hss #1}}}
+\def\ξψλζ#1{\line{\R{\hss #1 \hss}}}
+
+ \def\βψω{\L{`}}
+ \let\geresh=\βψω
+
+\def\ρβεψβψω{\L{`}}
+\let\closegeresh=\geresh
+
+\def\τϊηβψω{\L{\char39}}
+\let\opengeresh=\τϊηβψω
+
+\def\openquote{\L{''}}
+\def\closequote{\L{``}}
+
+\def\leftquotation{\L{''}}
+\def\rightquotation{\L{``}}
+
+\let\τϊηφιθεθ=\openquote
+\let\ρβεψφιθεθ=\closequote
+
+\input hebcal_newcode.tex
+
diff --git a/language/hebrew/hebtex/macros/tex_macros/heb_pc.tex b/language/hebrew/hebtex/macros/tex_macros/heb_pc.tex
new file mode 100644
index 0000000000..b9357f6aca
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/heb_pc.tex
@@ -0,0 +1,273 @@
+\TeXXeTstate=1
+\immediate\write10{ }
+\immediate\write10{>>> heb_macros version 1.4 for PC PUBTeX <<<}
+\immediate\write10{>>> Available guides: hebtex.tex heb_cs_g <<<}
+\immediate\write10{ }
+%% Written by Rama Porrat of the Computation Center,
+%% Hebrew University of Jerusalem,
+%% based upon Knuth's wisdom and Prof. Azriel levy's contributions.
+%%
+\newif\ifheb
+\catcode`€=11\catcode`=11\catcode`‚=11\catcode`ƒ=11
+\catcode`„=11\catcode`…=11\catcode`†=11\catcode`‡=11
+\catcode`ˆ=11\catcode`‰=11\catcode`‹=11\catcode`Œ=11
+\catcode`Ž=11\catcode`=11\catcode`‘=11\catcode`’=11
+\catcode`”=11\catcode`–=11\catcode`—=11\catcode`˜=11
+\catcode`™=11\catcode`š=11\catcode`Š=11\catcode`=11
+\catcode`=11\catcode`“=11\catcode`•=11
+
+\lccode`€=``\lccode`=`a\lccode`‚=`b\lccode`ƒ=`c
+\lccode`„=`d\lccode`…=`e\lccode`†=`f\lccode`‡=`g
+\lccode`ˆ=`h\lccode`‰=`i\lccode`‹=`k\lccode`Œ=`l
+\lccode`Ž=`n\lccode`=`p\lccode`‘=`q\lccode`’=`r
+\lccode`”=`t\lccode`–=`v\lccode`—=`w\lccode`˜=`x
+\lccode`™=`y\lccode`š=`z\lccode`Š=`j\lccode`=`m
+\lccode`=`o\lccode`“=`s\lccode`•=`u
+
+\def\undertext#1{$\underline{\hbox{#1}}$}
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
+%
+% this if is used to distinguish between a tex input and
+% a latex input.
+%
+\font\Jer=Jer_pc
+\def\footnoterule{\kern-3pt\hrule width \hsize \kern 2.6pt}
+\newcount\hebcheck
+ % This counter used for local text being Hebrew.
+\newcount\hebtext
+ % This counter used for overall text being Hebrew.
+%
+% Each control sequence defined here has his Hebrew equivalent.
+
+% \L = ngxefzlerfiz
+% \R = ngxefzraxiz
+
+% \font\hrm=redis10_newcode
+% \font\hsl=rediss10_newcode
+
+\ifundefined{LaTeX}
+\hebcheck=1\hebtrue
+\hebtext =1
+\def\hebR#1{\ifodd\hebcheck\beginR#1\fi}
+\baselineskip=14pt
+\font\hebrew=jer_pc
+\hebrew
+\fi
+
+\let\next=\
+
+\def\L{\afterassignment\moreL \let\next= }
+\def\moreL{\bracetext \aftergroup\endL \beginL \rm}
+\def\R{\afterassignment\moreR \let\next= }
+\def\moreR{\bracetext \aftergroup\endR \beginR \hebrew}
+\def\bracetext{\ifcat\next{\else\ifcat\next}\fi
+ \errmessage{Missing left brace has been substituted}\fi \bgroup}
+
+
+% \hebrew is activated. Now the default is Jerusalem,
+% and the \R control sequence refers to \hebrew.
+% Thanx to the sequence 'ifundefined', it is possible
+% to distinguish between latex and tex.
+% Hence, for latex, hebrew is activated by
+% hebrewtext, hebrewlines etc.
+% For tex, instead of \hebrew it says \the\font, thus enabling
+% any font (e.g. one called aaa) to be used and
+% have the right indentation.
+% The problem in latex lies in that
+% \the\font in latex usually means \rm.
+% Note that, still, the sequence \R still refers only to the font
+% called \hebrew.
+
+\font\Jerfootnote=JER_PC scaled 750
+\let\katan=\Jerfootnote
+\let\—ˆ =\Jerfootnote
+%\let\who=\Jerfootnote
+
+%\font\Jerhalf=JER_PC scaled \magstephalf
+%\font\Jerone=JER_PC scaled \magstep1
+%\font\Jertwo=JER_PC scaled \magstep2
+%\font\Jerthree=JER_PC scaled \magstep3
+%\font\Jerfour=JER_PC scaled \magstep4
+%\font\Jerfive=JER_PC scaled \magstep5
+
+\font\Telfootnote=Tel_pc scaled 750
+
+%\font\Telhalf=Tel_pc scaled \magstephalf
+%\font\Telone=Tel_pc scaled \magstep1
+%\font\Teltwo=Tel_pc scaled \magstep2
+\font\Telthree=Tel_pc scaled \magstep3
+%\font\Telfour=Tel_pc scaled \magstep4
+\font\Telfive=Tel_pc scaled \magstep5
+
+\font\Deadfootnote=Dead_pc scaled 750
+
+%\font\Deadhalf=Dead_pc scaled \magstephalf
+%\font\Deadone=Dead_pc scaled \magstep1
+%\font\Deadtwo=Dead_pc scaled \magstep2
+\font\Deadthree=Dead_pc scaled \magstep3
+%\font\Deadfour=Dead_pc scaled \magstep4
+\font\Deadfive=Dead_pc scaled \magstep5
+
+\font\Jaffafootnote=Old_pc scaled 750
+
+%\font\Jaffahalf=Old_pc scaled \magstephalf
+%\font\Jaffaone=Old_pc scaled \magstep1
+%\font\Jaffatwo=Old_pc scaled \magstep2
+\font\Jaffathree=Old_pc scaled \magstep3
+%\font\Jaffafour=Old_pc scaled \magstep4
+\font\Jaffafive=Old_pc scaled \magstep5
+
+\def\‰˜…™Œ‰{\font\hebrew=JER_PC \hebrew }
+\def\šŒ‰{\font\hebrew=Tel_pc \hebrew }
+\def\‰„ŽŒ‡{\font\hebrew=Dead_pc \hebrew }
+\def\‰”…{\font\hebrew=Old_pc \hebrew }
+
+\let\Jer=\‰˜…™Œ‰
+\let\Tel=\šŒ‰
+\let\Dead=\‰„ŽŒ‡
+\let\Jaffa=\‰”…
+
+\let\bigDead=\Deadthree
+\let\biggerDead=\Deadfive
+\let\bigJer=\Jerthree
+\let\biggerJer=\Jerfive
+\let\bigTel=\Telthree
+\let\biggerTel=\Telfive
+\let\bigJaffa=\Jaffathree
+\let\biggerJaffa=\Jaffafive
+
+
+
+% To use enlargements of Hebrew fonts by specifying Hebrew
+% control sequences, use the Hebrew font name appended by bet or gimel
+% (or dalet or he in TelAviv).
+
+%\let\imdnlga=\bigDead
+%\let\imdnlgb=\biggerDead
+%\let\itea=\bigJaffa
+%\let\iteb=\biggerJaffa
+%\let\ixeylima=\bigJer
+%\let\ixeylimb=\biggerJer
+%\let\zlaiaa=\bigTel
+%\let\zlaiab=\biggerTel
+
+\ifundefined{LaTeX}
+\def\nohebrewtext{\rm\everypar{}\hebcheck=0\hebfalse}
+\fi
+
+\ifundefined{LaTeX}
+\def\hebrewpar{\noindent\beginR\indent\the\font
+ \ifodd\hebcheck{}\else\hebrew\hebcheck=1\hebtrue\fi}
+\def\hebrewtext{\everypar{\leavevmode\kern-\parindent\beginR\indent\the\font}
+ \ifundefined{fmtname}{} \else \hebrew\fi
+ \ifodd\hebcheck{}
+ \else\hebrew\fi
+ \hebcheck=1 \hebtrue\hebtext=1}
+\def\hebrewlines{\noindent\beginR\the\font
+ \ifodd\hebcheck{}\else\hebrew\hebcheck=1\hebtrue\fi}
+%\else
+%\def\hebrewpar{\noindent\beginR\indent
+% \ifodd\hebcheck{}\else\hebrew\hebcheck=1\hebtrue\fi}
+%\def\hebrewtext{
+% \ifodd\hebcheck{}
+% \else\hebrew
+% \fi
+% \everypar{\leavevmode\kern-\parindent\beginR\indent}
+% \hebcheck=1\hebtrue \hebtext=1 }
+%\def\hebrewlines{\noindent\beginR
+% \ifodd\hebcheck{}\else\hebrew\hebcheck=1\hebtrue\fi}
+%\fi
+%% \def\hebrewtext{\everypar{\leavevmode\kern-\parindent\beginR\indent \hebrew }
+% \hebcheck=1 \hebtext=1\hebtrue }
+% \def\hebrewlines{\noindent\beginR \hebrew }
+% \def\hebrewpar{\noindent\beginR\indent \hebrew }
+%
+\fi
+
+\let\sethebrew=\hebrewtext
+\let\unsethebrew=\nohebrewtext
+
+%\let\whrraxiz=\hebrewpar
+%\let\hwqhraxiz=\hebrewtext
+%\let\yexezraxiz\hebrewlines
+
+\everydisplay{\aftergroup\beginR }
+
+\def\hebday{\L{\number\day}\ \R{\ifcase\month\or
+ ‰…€˜\or
+ ”˜…€˜\or Ž˜•\or €”˜‰Œ
+\or Ž€‰ \or ‰…‰\or ‰…Œ‰\or
+ €…‚…‘ˆ\or ‘”ˆŽ˜\or €…—ˆ…˜
+\or …Ž˜\or ƒ–Ž˜ \fi}\
+\L{\number\year}}
+
+\let\„‰…=\hebday
+\def\—”‰–„—ˆ„{\smallskip }
+\def\—”‰–„‰…‰š{\medskip }
+\def\—”‰–„‚ƒ…Œ„{\bigskip }
+
+% \def\wtivdlnhd #1{\vskip #1 }
+% \def\wtivddvicd #1{\hskip #1}
+%\def\xeegaioyexez #1{\baselineskip #1 }
+
+ %\def\pw{ pt }
+ %\def\pwecez{ pt }
+ %\def\qes{\end }
+ %\def\qn{ cm }
+
+\def\Ž—“‚ƒ…Œ{\L{--}}
+\def\Ž—“’—{\L{---}}
+
+\let\makafanak=\Ž—“’—
+\let\makafgadol=\Ž—“‚ƒ…Œ
+
+\def\hadgesh#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\copy0\kern-\wd0
+\kern-.025em\raise.0433em\box0 }
+
+\let\„ƒ‚™=\hadgesh
+
+\def\„ƒ‚™™#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\copy0\kern-\wd0
+\kern-.025em\raise.0433em\box0\raise-.0433em\box0 }
+
+\def\wewe#1{\leavevmode\setbox0=\hbox{#1}%
+\kern-.025em\copy0\kern-\wd0
+\kern.05em\box0 }
+
+\def\”‰‘—„#1{\item{#1}\hangindent=-\hangindent}
+\def\”‘—„#1{\item{#1}\hangindent=-\hangindent}
+
+\def\”‰‘—„”‰‘—„#1{\itemitem{#1}\hangindent=-\hangindent}
+\def\”‘—„”‘—„#1{\itemitem{#1}\hangindent=-\hangindent}
+
+\def\piska#1{\item{#1}\hangindent=-\hangindent}
+
+\def\piskapiska#1{\itemitem{#1}\hangindent=-\hangindent}
+
+\def\™…˜„‰Ž‰#1{\line{\R{#1 \hss}}}
+\def\™…˜„™Ž€Œ#1{\line{\R{\hss #1}}}
+\def\Ž˜‹†#1{\line{\R{\hss #1 \hss}}}
+
+ \def\‚˜™{\L{`}}
+ \let\geresh=\‚˜™
+
+\def\‘‚…˜‚˜™{\L{`}}
+\let\closegeresh=\geresh
+
+\def\”š‡‚˜™{\L{\char39}}
+\let\opengeresh=\”š‡‚˜™
+
+\def\openquote{\L{''}}
+\def\closequote{\L{``}}
+
+\def\leftquotation{\L{''}}
+\def\rightquotation{\L{``}}
+
+\let\”š‡–‰ˆ…ˆ=\openquote
+\let\‘‚…˜–‰ˆ…ˆ=\closequote
+
+\input hebcal_p.tex
+
diff --git a/language/hebrew/hebtex/macros/tex_macros/hebcal.tex b/language/hebrew/hebtex/macros/tex_macros/hebcal.tex
new file mode 100644
index 0000000000..e69c0d28c7
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/hebcal.tex
@@ -0,0 +1,908 @@
+%
+% TeX & LaTeX MACROS FOR COMPUTING HEBREW DATE FROM GREGORIAN ONE
+%
+% by Michail Rozman, misha@iop.tartu.ew.su
+%
+% Released: Tammuz 12, 5751 -- June 24, 1991
+% Corrected: Shebat 10, 5752 -- January 15, 1992 by Rama Porrat
+% Corrected: Adar II 5, 5752 -- March 10, 1992 by Misha
+% Corrected: Tebeth, 5756 -- January 1996 Dan Haran
+% (haran@math.tau.ac.il)
+
+% Please direct any comments, bug reports, questions, etc.
+% to the address above.
+%
+% If Hebrew fonts and style macros are loaded AND you are in
+% Hebrew mode the produced date is in Hebrew.
+% Otherwise the date string looks like Shebat 10, 5752.
+%
+% Use this style as follows:
+%
+% LaTeX | TeX
+% |
+% \documentstyle[...,hebcal,...] \input hebcal.sty
+%
+% % ONLY IF \ifheb IS NOT
+% \newif\ifheb \hebtrue % DEFINED IN YOUR
+% % HEBREW STYLE !!
+%
+% \Hebrewtoday
+% or
+% {\day=10 \month=3 \year=1992 % to fool \today
+% \today == \Hebrewtoday}
+% or
+% \newcount\hd \newcount\hm \newcount\hy
+% \hd=10 \hm=3 \hy=1992 \Hebrewdate{\hd}{\hm}{\hy}
+%
+%
+% TABLE OF CONTENTS
+%
+% INTRODUCTION
+% REGISTERS, COMMANDS AND LANGUAGE-DEPENDENT INTERFACE
+% Hebrew language macros
+% English language macros
+% AUXILIARY MACROS
+% GREGORIAN PART
+% HEBREW PART
+%
+% *******************************************
+% * INTRODUCTION *
+% *******************************************
+%
+% The Hebrew calendar is inherently complicated:
+% It is lunisolar -- each year starts close to the
+% autumn equinox, but each month must strictly start
+% at a new moon. Thus Hebrew calendar must be harmonized
+% simultaneously with both lunar and solar events.
+% In addition, for reasons of the religious practice, the
+% year cannot start on Sunday, Wednesday or Friday.
+%
+% For the full description of Hebrew calendar and for
+% the list of references see:
+%
+% Nachum Dershowitz and Edward M. Reingold,
+% "Calendrical Calculations", Software--Pract.Exper.,
+% vol. 20 (9), pp.899--928 (September 1990)
+% C translation of LISP programs from the above article
+% available from Mr. Wayne Geiser, geiser%pictel@uunet.uu.net
+%
+% The 4th distribution ( July 1989 ) of hdate/hcal ( Hebrew
+% calendar programs similar to UNIX date/cal ) by
+% Mr. Amos Shapir, amos@shum.huji.ac.il , contains short
+% and very clear description of algorithms.
+%
+\catcode`@=11
+% *******************************************
+% * REGISTERS, COMMAND, FORMATTING MACROS *
+% *******************************************
+%
+% The command \Hebrewtoday produces today's date for Hebrew
+% calendar. It is similar to the \today command of the LETTER
+% style. In addition three numerical registers \Hebrewday
+% \Hebrewmonth and \Hebrewyear are set.
+% For setting this registers without producing of date string
+% command \Hebrewsetreg can be used.
+% The command \Hebrewdate{Gday}{Gmonth}{Gyear} produces Hebrew
+% calendar date corresponding to Gregorian date Gday.Gmonth.Gyear.
+% Three numerical registers \Hebrewday \Hebrewmonth and
+% \Hebrewyear are set.
+% For converting arbitrary Gregorian date Gday.Gmonth.Gyear
+% to Hebrew date Hday.Hmonth.Hyear without producing date string
+% the command:
+% \HebrewFromGregorian{Gday}{Gmonth}{Gyear}{Hday}{Hmonth}{Hyear}
+% can be used.
+%
+\newcount\Hebrewday \newcount\Hebrewmonth \newcount\Hebrewyear
+%
+% \Hebrewdate{Gday}{Gmonth}{Gyear}
+% ================================
+% Hebrew calendar date corresponding to Gregorian Gday.Gmonth.Gyear
+\def\Hebrewdate #1#2#3{%
+ \HebrewFromGregorian{#1}{#2}{#3}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \ifundefined{ifheb}% Hebrew fonts&macros are not loaded
+ \FormatForEnglish{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \else%
+ \FormatDate{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \fi%
+}%
+%
+%\Hebrewtoday
+% ============
+% Today's date in Hebrew calendar
+\def\Hebrewtoday{\Hebrewdate{\day}{\month}{\year}}
+\let\hebrewtoday=\Hebrewtoday
+%
+% \Hebrewsetreg
+% ============
+% Set registers: today's date in hebrew calendar
+\def\Hebrewsetreg{%
+ \HebrewFromGregorian{\day}{\month}{\year}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+}%
+%
+% \FormatDate{Hebrewday}{Hebrewmonth}{Hebrewyear}
+% ===============================================
+\def\FormatDate #1#2#3{%
+ \ifheb% Hebrew mode
+ \FormatForHebrew{#1}{#2}{#3}%
+ \else% English mode
+ \FormatForEnglish{#1}{#2}{#3}
+ \fi%
+}%
+%
+% TO PREPARE ANOTHER LANGUAGE VERSION CHANGE/ADD HERE !!!
+%
+% ====================== Hebrew macros ===============================
+%
+\def\HebrewYearChar{'}
+%
+%
+% \ShortHYName{year}
+% =====================
+% Hebrew year (mod 1000) as a string of Hebrew letters
+\def\ShortHYName#1{{%
+ \count2 = #1%
+ \Remainder{\count2}{1000}{#1}% E.g., for 5752: #1 = 752
+ \def\HY{}% the string of hundreds, tens and ones
+ \ifnum #1 > 799 \strcat{\HY}{zz}\advance#1 by -800 \fi%
+ \ifnum #1 > 399 \strcat{\HY}{z}\advance#1 by -400 \fi%
+ \ifnum #1 > 299 \strcat{\HY}{y}\advance#1 by -300 \fi%
+ \ifnum #1 > 199 \strcat{\HY}{x}\advance#1 by -200 \fi%
+ \ifnum #1 > 99 \strcat{\HY}{w}\advance#1 by -100 \fi%
+ \ifnum #1 > 0 %
+ %
+ % 15 and 16 are special exceptions
+ %
+ \ifnum #1 = 16 %
+ \strcat{\HY}{hf}%
+ \else%
+ \ifnum #1 = 15 %
+ \strcat{\HY}{he}%
+ \else%
+ \Remainder{#1}{10}{\count0 }%
+ \divide #1 by 10 %
+ \ifnum\count0 = 0%
+ \strcat{\HY}{\TensInHebrewEnd{#1}}%
+ \else%
+ \strcat{\HY}{\TensInHebrew{#1}}%
+ \strcat{\HY}{\DigitInHebrew{\count0 }}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \countdef\HYLength=0 % \HYLength==\count0 = strlen(\HY)
+ \HYLength =0 \expandafter\getlength\HY\end%
+ \ifnum\HYLength > 0 %
+ \ifnum\HYLength = 1 %
+ \HY\HebrewYearChar%
+ \else%
+ \expandafter\Insert\HY%
+ \fi%
+ \else%
+ \relax%
+ \fi%
+}}%
+%
+% \HebrewYearName{year}
+% =====================
+% Hebrew year as a string of Hebrew letters
+% 0 < year < 10000
+\def\HebrewYearName#1{{%
+ \count2 = #1%
+ \Remainder{\count2}{10000}{#1}% macro only for year <= 9999
+ \count2 = #1%
+ \Remainder{\count2}{1000}{#1}% E.g., for 5752: #1 = 752
+ \divide \count2 by 1000 % E.g., for 5752: \count2 = 5
+ \countdef\thousand=2 % \thousand==\count2
+ \def\Thousands{}% the string of thousands
+ \strcat{\Thousands}{\DigitInHebrew{\thousand }}% output 1000'
+ \ifnum\thousand = 5 % Change it in the next Hebrew Millennium..
+ \ifnum#1 > 0 % if 5000 < year < 6000
+ \def\Thousands{}% don't mention thousands
+ \fi%
+ \fi%
+ \countdef\ThousandsLength=0 %
+ % \ThousandsLength==\count0 = strlen(\Thousands)
+ \ThousandsLength =0 \expandafter\getlength\Thousands\end%
+ \ifnum\ThousandsLength > 0 % if the letter of thousands is not empty
+ \strcat{\Thousands}{'}% add '
+ \fi%
+ \def\HY{\ShortHYName{#1}}% the string of hundreds, tens and ones
+ \def\PratGadol{}% An additional string to date. Default: empty
+ \ifnum\thousand < 1%
+ \def\PratGadol{\ )lt"b(}%
+ \fi%
+ \ifnum#1 = 0%
+ \def\PratGadol{\ )lt"b(}%
+ \fi%
+ \Thousands\HY\PratGadol%
+}}%
+%
+% \HebrewMonthName{month}{year}
+% =============================
+% Name of month in the `year'
+\def\HebrewMonthName #1#2{%
+ \ifnum #1 = 7 %
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap `cx a`%
+ \else `cx%
+ \fi%
+ \else%
+ \ifcase #1%
+ Dummy\or%
+ zyxi\or%
+ gyeo\or%
+ kqle\or%
+ haz\or%
+ yah\or%
+ `cx `'\or%
+ `cx a'\or%
+ piqo\or%
+ `iix\or%
+ qieo\or%
+ znef\or%
+ `a\or%
+ `lel%
+ \fi %
+ \fi %
+}%
+%
+% \HebrewDayName{day}
+% ===============================
+% Name of day in Hebrew letters.
+%
+\def\HebrewDayName#1{%
+\ifcase#1%
+Dummy\or%
+`'\or%
+a'\or%
+b'\or%
+c'\or%
+d'\or%
+e'\or%
+f'\or%
+g'\or%
+h'\or%
+i'\or%
+i''`\or%
+i''a\or%
+i''b\or%
+i''c\or%
+h''e\or%
+h''f\or%
+i''f\or%
+i''g\or%
+i''h\or%
+k'\or%
+k''`\or%
+k''a\or%
+k''b\or%
+k''c\or%
+k''d\or%
+k''e\or%
+k''f\or%
+k''g\or%
+k''h\or%
+l'\or%
+l''`%
+\fi%
+}%
+%
+% \DigitInHebrew{n}
+% =================
+% Single digit 1 <= n <= 9 as Hebrew letter
+% short macro:
+% \def\DigitInHebrew #1{%
+% {\ifnum#1>0 \ifnum#1<10 \advance#1 by `\_ \char#1 \fi\fi}}
+%
+\def\DigitInHebrew #1{%
+ \ifcase#1%
+ % nothing for 0
+ \or `% 1
+ \or a% 2
+ \or b% 3
+ \or c% 4
+ \or d% 5
+ \or e% 6
+ \or f% 7
+ \or g% 8
+ \or h% 9
+ \fi%
+}%
+%
+% \TensInHebrew{num}
+% ================
+% Convert 10*num ( 1 <= num <= 9 ) into single Hebrew letter
+\def\TensInHebrew #1{%
+ \ifcase #1%
+ % nothing for 0
+ \or i% 10
+ \or k% 20
+ \or l% 30
+ \or n% 40
+ \or p% 50
+ \or q% 60
+ \or r% 70
+ \or t% 80
+ \or v% 90
+ \fi%
+}%
+%
+% \TensInHebrewEnd{num}
+% ================
+% Convert 10*num ( 1 <= num <= 9 ) into single Hebrew letter;
+% this letter is an endletter version ("oth sofith") if it exists.
+\def\TensInHebrewEnd #1{%
+ \ifcase #1%
+ % nothing for 0
+ \or i% 10
+ \or j% 20
+ \or l% 30
+ \or m% 40
+ \or o% 50
+ \or q% 60
+ \or r% 70
+ \or s% 80
+ \or u% 90
+ \fi%
+}%
+%
+% \FormatForHebrew{hday}{hmonth}{hyear}
+% =====================================
+\def\FormatForHebrew#1#2#3{%
+\HebrewDayName{#1}~a\HebrewMonthName{#2}{#3},~\HebrewYearName{#3}%
+}%
+%
+% English macros ==================================
+%
+% \HebrewMonthNameInEnglish{month}{year}
+% ===============================
+% Name of month in the `year'
+\def\HebrewMonthNameInEnglish #1#2{%
+ \ifnum #1 = 7%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap Adar II \else Adar \fi%
+ \else%
+ \ifcase #1%
+ Dummy \or%
+ Tishrei \or%
+ Heshvan \or%
+ Kislev \or%
+ Tebeth \or%
+ Shebat \or%
+ Adar I \or%
+ Adar II \or%
+ Nisan \or%
+ Iyar \or%
+ Sivan \or%
+ Tammuz \or%
+ Av \or%
+ Elul%
+ \fi %
+ \fi %
+}%
+%
+% \FormatForEnglish{hday}{hmonth}{hyear}
+% =====================================
+\def\FormatForEnglish #1#2#3{%
+ \HebrewMonthNameInEnglish{#2}{#3} \number#1,\ \number#3%
+}%
+%
+% *******************************************
+% * AUXILIARY MACROS *
+% *******************************************
+%
+\newcount\@common
+%
+% \Remainder{a}{b}{c}
+% ===================
+% c = a%b == a - b(a/b)
+\def\Remainder #1#2#3{%
+ #3 = #1% % c = a
+ \divide #3 by #2% % c = a/b
+ \multiply #3 by -#2% % c = -b(a/b)
+ \advance #3 by #1% % c = a - b(a/b)
+}%
+%
+\newif\if@Divisible
+%
+% \CheckIfDivisible{a}{b}
+% ==================
+% Set \@Divisibletrue if a%b == 0
+\def\CheckIfDivisible #1#2{%
+ {%
+ \countdef\tmp = 0% % \tmp == \count0 - temporary variable
+ \Remainder{#1}{#2}{\tmp}%
+ \ifnum \tmp = 0%
+ \global\@Divisibletrue%
+ \else%
+ \global\@Divisiblefalse%
+ \fi%
+ }%
+}%
+%
+% \strcat{str1}{str2}
+% ===================
+% apend str2 to the end of macro str1
+\def\strcat#1#2{\edef#1{#1#2}}
+%
+% \getlength{ string }
+% ====================
+% Number of nonblank tokens
+% This macro is called if \count0==strlen('string') >= 2
+% usage: {{\count0=0 \expandafter\getlength#1\end \number\count0}}
+\def\getlength #1{%
+ \ifx#1\end%
+ \let\next=\relax%
+ \else%
+ \advance\count0 by 1%
+ \let\next=\getlength%
+ \fi%
+ \next%
+}%
+%
+% \Insert
+% =======
+% Insert char <"> befor the last char and output 'string'
+% usage: {\def\abc{abc} \count0=0 \expandafter\getlength\abc\end
+% \expandafter\Insert\abc}
+\def\Insert #1{%
+ \ifnum\count0 = 1%
+#1%
+\let\next=\relax%
+\else%
+#1%
+\ifnum\count0 = 2%
+"%
+\fi
+\advance\count0 by -1%
+\let\next=\Insert%
+\fi%
+\next%
+}
+%
+% \ifundefined{command}
+% =====================
+% TeXbook, ex. 7.7 \ifundefined{command}<true text>\else<false text>\fi
+\def\ifundefined #1{\expandafter\ifx\csname#1\endcsname\relax}
+%
+% *******************************************
+% * GREGORIAN PART *
+% *******************************************
+%
+\newif\if@GregorianLeap
+%
+% \IfGregorianLeap{year}
+% ======================
+% Conditional which is true if Gregorian `year' is
+% a leap year:
+% ( ( year%4 == 0 ) && ( year%100 != 0 ) || ( year%400 == 0 ) )
+\def\IfGregorianLeap #1{%
+ \CheckIfDivisible{#1}{4}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{100}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{400}%
+ \if@Divisible%
+ \@GregorianLeaptrue%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \else%
+ \@GregorianLeaptrue%
+ \fi%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \if@GregorianLeap%
+}%
+%
+% \GregorianDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\GregorianDaysInPriorMonths #1#2#3{%
+ {%
+ #3 = \ifcase #1%
+ 0 \or % % no month number 0
+ 0 \or 31 \or 59 \or 90 \or 120 \or 151 \or %
+ 181 \or 212 \or 243 \or 273 \or 304 \or 334%
+ \fi%
+ \IfGregorianLeap{#2}% % in leap year ...
+ \ifnum #1 > 2% % if month after February ...
+ \advance #3 by 1% % add leap day
+ \fi%
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \GregorianDaysInPriorYears{year}{days}
+% ===============================
+% Number of days since 01.01.01 in years prior to the `year'
+\def\GregorianDaysInPriorYears #1#2{%
+ {%
+ \countdef\tmpc = 4% % \tmpc==\count4
+ \countdef\tmpb = 2% % \tmpb==\count2
+ \tmpb = #1%
+ \advance \tmpb by -1%
+ \tmpc = \tmpb% % \tmpc = \tmpb = year-1
+ \multiply \tmpc by 365% % Days in prior years =
+ #2 = \tmpc% % = 365*(year-1) ...
+ \tmpc = \tmpb%
+ \divide \tmpc by 4% % \tmpc = (year-1)/4
+ \advance #2 by \tmpc% % ... plus Julian leap days ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 100% % \tmpc = (year-1)/100
+ \advance #2 by -\tmpc% % ... minus century years ...
+ \tmpc = \tmpb%
+ \divide \tmpc by 400% % \tmpc = (year-1)/400
+ \advance #2 by \tmpc% % ... plus 4-century years.
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \AbsoluteFromGregorian{day}{month}{year}{absdate}
+% ======================
+% Calculation of absolute date ( days since 01.01.01 ) from
+% Gregorian date day.month.year
+\def\AbsoluteFromGregorian #1#2#3#4{%
+ {%
+ \countdef\tmpd = 0% % \tmpd==\count0
+ #4 = #1% % days so far this month
+ \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior months
+ \GregorianDaysInPriorYears{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior years
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+%
+\newif\if@GregorianLeap
+%
+% \IfGregorianLeap{year}
+% ======================
+% Conditional which is true if Gregorian `year' is
+% a leap year:
+% ( ( year%4 == 0 ) && ( year%100 != 0 ) || ( year%400 == 0 ) )
+\def\IfGregorianLeap #1{%
+ \CheckIfDivisible{#1}{4}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{100}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{400}%
+ \if@Divisible%
+ \@GregorianLeaptrue%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \else%
+ \@GregorianLeaptrue%
+ \fi%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \if@GregorianLeap%
+}%
+%
+% \GregorianDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\GregorianDaysInPriorMonths #1#2#3{%
+ {%
+ #3 = \ifcase #1%
+ 0 \or% % no month number 0
+ 0 \or%
+ 31 \or%
+ 59 \or%
+ 90 \or%
+ 120 \or%
+ 151 \or%
+ 181 \or%
+ 212 \or%
+ 243 \or%
+ 273 \or%
+ 304 \or%
+ 334%
+ \fi%
+ \IfGregorianLeap{#2}%
+ \ifnum #1 > 2% % if month after February
+ \advance #3 by 1% % add leap day
+ \fi%
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \GregorianDaysInPriorYears{year}{days}
+% ===============================
+% Number of days in years prior to the `year'
+\def\GregorianDaysInPriorYears #1#2{%
+ {%
+ \countdef\tmpc = 4% % \tmpc==\count4
+ \countdef\tmpb = 2% % \tmpb==\count2
+ \tmpb = #1% %
+ \advance \tmpb by -1% %
+ \tmpc = \tmpb% % \tmpc = \tmpb = year-1
+ \multiply \tmpc by 365% % Days in prior years =
+ #2 = \tmpc% % = 365*(year-1) ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 4% % \tmpc = (year-1)/4
+ \advance #2 by \tmpc% % ... plus Julian leap days ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 100% % \tmpc = (year-1)/100
+ \advance #2 by -\tmpc% % ... minus century years ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 400% % \tmpc = (year-1)/400
+ \advance #2 by \tmpc% % ... plus 4-century years.
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \AbsoluteFromGregorian{day}{month}{year}{absdate}
+% ======================
+% Calculation of absolute date ( days since 01.01.0001 ) from
+% Gregorian date day.month.year
+\def\AbsoluteFromGregorian #1#2#3#4{%
+ {%
+ \countdef\tmpd = 0% % \tmpd==\count0
+ #4 = #1% % days so far this month
+ \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior months
+ \GregorianDaysInPriorYears{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior years
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+
+% *******************************************
+% * HEBREW PART *
+% *******************************************
+%
+\newif\if@HebrewLeap
+%
+% \CheckLeapHebrewYear{year}
+% ======================
+% Set \@HebrewLeaptrue if Hebrew `year' is
+% a leap year: if (1+7*year)%19 < 7 then true else false
+\def\CheckLeapHebrewYear #1{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+%
+ \tmpa = #1%
+ \multiply \tmpa by 7%
+ \advance \tmpa by 1%
+ \Remainder{\tmpa}{19}{\tmpb}%
+ \ifnum \tmpb < 7% % \tmpb = (7*year+1)%19
+ \global\@HebrewLeaptrue%
+ \else%
+ \global\@HebrewLeapfalse%
+ \fi%
+ }%
+}%
+%
+% \HebrewElapsedMonths{year}{months}
+% ==============================
+% Number of months elapsed from the Sunday prior to the start
+% of the Hebrew calendar to the mean conjunction of Tishri
+% of Hebrew `year'
+\def\HebrewElapsedMonths #1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \tmpa = #1% %
+ \advance \tmpa by -1% %
+ #2 = \tmpa% % #2 = \tmpa = year-1
+ \divide #2 by 19% % Number of complete Meton cycles
+ \multiply #2 by 235% % #2 = 235*((year-1)/19)
+%
+ \Remainder{\tmpa}{19}{\tmpb}% % \tmpa = years%19 - years this cycle
+ \tmpc = \tmpb% %
+ \multiply \tmpb by 12% %
+ \advance #2 by \tmpb% % add regular months this cycle
+%
+ \multiply \tmpc by 7% %
+ \advance \tmpc by 1% %
+ \divide \tmpc by 19% % \tmpc = (1+7*((year-1)%19))/19 -
+% % number of leap months this cycle
+ \advance #2 by \tmpc% % add leap months
+%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \HebrewElapsedDays{year}{days}
+% ==============================
+% Number of days elapsed from the Sunday prior to the start
+% of the Hebrew calendar to the mean conjunction of Tishri
+% of Hebrew `year'
+\def\HebrewElapsedDays #1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \HebrewElapsedMonths{#1}{#2}% %
+ \tmpa = #2% %
+ \multiply \tmpa by 13753% %
+ \advance \tmpa by 5604% % \tmpa=MonthsElapsed*13758 + 5604
+ \Remainder{\tmpa}{25920}{\tmpc}% % \tmpc == ConjunctionParts
+ \divide \tmpa by 25920%
+%
+ \multiply #2 by 29%
+ \advance #2 by 1%
+ \advance #2 by \tmpa% % #2 = 1 + MonthsElapsed*29 +
+% % PartsElapsed/25920
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpc < 19440%
+ \ifnum \tmpc < 9924%
+ \else% % New moon at 9 h. 204 p. or later ...
+ \ifnum \tmpa = 2% % on Tuesday ...
+ \CheckLeapHebrewYear{#1}% % of a common year
+ \if@HebrewLeap%
+ \else%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum \tmpc < 16789%
+ \else% % New moon at 15 h. 589 p. or later ...
+ \ifnum \tmpa = 1% % on Monday ...
+ \advance #1 by -1%
+ \CheckLeapHebrewYear{#1}% % at the end of leap year
+ \if@HebrewLeap%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \advance #2 by 1% % new moon at or after midday
+ \fi%
+%
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpa = 0% % if Sunday ...
+ \advance #2 by 1%
+ \else% %
+ \ifnum \tmpa = 3% % Wednesday ...
+ \advance #2 by 1%
+ \else%
+ \ifnum \tmpa = 5% % or Friday
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \DaysInHebrewYear{year}{days}
+% ==============================
+% Number of days in Hebrew `year'
+\def\DaysInHebrewYear #1#2{%
+ {%
+ \countdef\tmpe = 12% % \tmpe==\count12
+%
+ \HebrewElapsedDays{#1}{\tmpe}%
+ \advance #1 by 1%
+ \HebrewElapsedDays{#1}{#2}%
+ \advance #2 by -\tmpe%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \HebrewDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\HebrewDaysInPriorMonths #1#2#3{%
+ {%
+ \countdef\tmpf= 14% % \tmpf==\count14
+%
+ #3 = \ifcase #1% % Days in prior month of regular year
+ 0 \or% % no month number 0
+ 0 \or% % Tishri
+ 30 \or% % Heshvan
+ 59 \or% % Kislev
+ 89 \or% % Tebeth
+ 118 \or% % Shebat
+ 148 \or% % Adar I
+ 148 \or% % Adar II
+ 177 \or% % Nisan
+ 207 \or% % Iyar
+ 236 \or% % Sivan
+ 266 \or% % Tammuz
+ 295 \or% % Av
+ 325 \or% % Elul
+ 400% % Dummy
+ \fi%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap% % in leap year
+ \ifnum #1 > 6% % if month after Adar I
+ \advance #3 by 30% % add 30 days
+ \fi%
+ \fi%
+ \DaysInHebrewYear{#2}{\tmpf}%
+ \ifnum #1 > 3%
+ \ifnum \tmpf = 353% %
+ \advance #3 by -1% %
+ \fi% % Short Kislev
+ \ifnum \tmpf = 383% %
+ \advance #3 by -1% %
+ \fi% %
+ \fi%
+%
+ \ifnum #1 > 2%
+ \ifnum \tmpf = 355% %
+ \advance #3 by 1% %
+ \fi% % Long Heshvan
+ \ifnum \tmpf = 385% %
+ \advance #3 by 1% %
+ \fi% %
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \AbsoluteFromHebrew{day}{month}{year}{days}
+% ===============================
+% Absolute date of Hebrew day,month,year
+\def\AbsoluteFromHebrew #1#2#3#4{%
+ {%
+ #4 = #1%
+ \HebrewDaysInPriorMonths{#2}{#3}{#1}%
+ \advance #4 by #1% % Add days in prior months this year
+ \HebrewElapsedDays{#3}{#1}%
+ \advance #4 by #1% % Add days in prior years
+ \advance #4 by -1373429% % Subtract days before Gregorian 1.1.1
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+%
+% \HebrewFromGregorian{Gday}{Gmonth}{Gyear}{Hday}{Hmonth}{Hyear}
+% ===============================
+% Evaluating Hebrew date Hday,Hmonth,Hyear from
+% Gregorian date Gday,Gmonth,Gyear
+\def\HebrewFromGregorian #1#2#3#4#5#6{%
+ {%
+ \countdef\tmpx= 17% % \tmpx==\count17
+ \countdef\tmpy= 18% % \tmpy==\count18
+ \countdef\tmpz= 19% % \tmpz==\count19
+%
+ #6 = #3% %
+ \global\advance #6 by 3761% % approximation from above
+ \AbsoluteFromGregorian{#1}{#2}{#3}{#4}%
+ \tmpz = 1 \tmpy = 1%
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \ifnum \tmpx > #4% %
+ \global\advance #6 by -1% % Hyear = Gyear + 3760
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \fi% %
+ \advance #4 by -\tmpx% % Days in this year
+ \advance #4 by 1% %
+ #5 = #4% %
+ \divide #5 by 30% % Approximation for month from below
+ \loop% % Search for month
+ \HebrewDaysInPriorMonths{#5}{#6}{\tmpx}%
+ \ifnum \tmpx < #4%
+ \advance #5 by 1%
+ \tmpy = \tmpx%
+ \repeat%
+ \global\advance #5 by -1%
+ \global\advance #4 by -\tmpy%
+ }%
+}%
+\catcode`@=12
+
diff --git a/language/hebrew/hebtex/macros/tex_macros/hebcal_newcode.tex b/language/hebrew/hebtex/macros/tex_macros/hebcal_newcode.tex
new file mode 100644
index 0000000000..a66a925a31
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/hebcal_newcode.tex
@@ -0,0 +1,908 @@
+%
+% TeX & LaTeX MACROS FOR COMPUTING HEBREW DATE FROM GREGORIAN ONE
+%
+% by Michail Rozman, misha@iop.tartu.ew.su
+%
+% Released: Tammuz 12, 5751 -- June 24, 1991
+% Corrected: Shebat 10, 5752 -- January 15, 1992 by Rama Porrat
+% Corrected: Adar II 5, 5752 -- March 10, 1992 by Misha
+% Corrected: Tebeth, 5756 -- January 1996 Dan Haran
+% (haran@math.tau.ac.il)
+
+% Please direct any comments, bug reports, questions, etc.
+% to the address above.
+%
+% If Hebrew fonts and style macros are loaded AND you are in
+% Hebrew mode the produced date is in Hebrew.
+% Otherwise the date string looks like Shebat 10, 5752.
+%
+% Use this style as follows:
+%
+% LaTeX | TeX
+% |
+% \documentstyle[...,hebcal,...] \input hebcal.sty
+%
+% % ONLY IF \ifheb IS NOT
+% \newif\ifheb \hebtrue % DEFINED IN YOUR
+% % HEBREW STYLE !!
+%
+% \Hebrewtoday
+% or
+% {\day=10 \month=3 \year=1992 % to fool \today
+% \today == \Hebrewtoday}
+% or
+% \newcount\hd \newcount\hm \newcount\hy
+% \hd=10 \hm=3 \hy=1992 \Hebrewdate{\hd}{\hm}{\hy}
+%
+%
+% TABLE OF CONTENTS
+%
+% INTRODUCTION
+% REGISTERS, COMMANDS AND LANGUAGE-DEPENDENT INTERFACE
+% Hebrew language macros
+% English language macros
+% AUXILIARY MACROS
+% GREGORIAN PART
+% HEBREW PART
+%
+% *******************************************
+% * INTRODUCTION *
+% *******************************************
+%
+% The Hebrew calendar is inherently complicated:
+% It is lunisolar -- each year starts close to the
+% autumn equinox, but each month must strictly start
+% at a new moon. Thus Hebrew calendar must be harmonized
+% simultaneously with both lunar and solar events.
+% In addition, for reasons of the religious practice, the
+% year cannot start on Sunday, Wednesday or Friday.
+%
+% For the full description of Hebrew calendar and for
+% the list of references see:
+%
+% Nachum Dershowitz and Edward M. Reingold,
+% "Calendrical Calculations", Software--Pract.Exper.,
+% vol. 20 (9), pp.899--928 (September 1990)
+% C translation of LISP programs from the above article
+% available from Mr. Wayne Geiser, geiser%pictel@uunet.uu.net
+%
+% The 4th distribution ( July 1989 ) of hdate/hcal ( Hebrew
+% calendar programs similar to UNIX date/cal ) by
+% Mr. Amos Shapir, amos@shum.huji.ac.il , contains short
+% and very clear description of algorithms.
+%
+\catcode`@=11
+% *******************************************
+% * REGISTERS, COMMAND, FORMATTING MACROS *
+% *******************************************
+%
+% The command \Hebrewtoday produces today's date for Hebrew
+% calendar. It is similar to the \today command of the LETTER
+% style. In addition three numerical registers \Hebrewday
+% \Hebrewmonth and \Hebrewyear are set.
+% For setting this registers without producing of date string
+% command \Hebrewsetreg can be used.
+% The command \Hebrewdate{Gday}{Gmonth}{Gyear} produces Hebrew
+% calendar date corresponding to Gregorian date Gday.Gmonth.Gyear.
+% Three numerical registers \Hebrewday \Hebrewmonth and
+% \Hebrewyear are set.
+% For converting arbitrary Gregorian date Gday.Gmonth.Gyear
+% to Hebrew date Hday.Hmonth.Hyear without producing date string
+% the command:
+% \HebrewFromGregorian{Gday}{Gmonth}{Gyear}{Hday}{Hmonth}{Hyear}
+% can be used.
+%
+\newcount\Hebrewday \newcount\Hebrewmonth \newcount\Hebrewyear
+%
+% \Hebrewdate{Gday}{Gmonth}{Gyear}
+% ================================
+% Hebrew calendar date corresponding to Gregorian Gday.Gmonth.Gyear
+\def\Hebrewdate #1#2#3{%
+ \HebrewFromGregorian{#1}{#2}{#3}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \ifundefined{ifheb}% Hebrew fonts&macros are not loaded
+ \FormatForEnglish{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \else%
+ \FormatDate{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \fi%
+}%
+%
+%\Hebrewtoday
+% ============
+% Today's date in Hebrew calendar
+\def\Hebrewtoday{\Hebrewdate{\day}{\month}{\year}}
+\let\hebrewtoday=\Hebrewtoday
+%
+% \Hebrewsetreg
+% ============
+% Set registers: today's date in hebrew calendar
+\def\Hebrewsetreg{%
+ \HebrewFromGregorian{\day}{\month}{\year}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+}%
+%
+% \FormatDate{Hebrewday}{Hebrewmonth}{Hebrewyear}
+% ===============================================
+\def\FormatDate #1#2#3{%
+ \ifheb% Hebrew mode
+ \FormatForHebrew{#1}{#2}{#3}%
+ \else% English mode
+ \FormatForEnglish{#1}{#2}{#3}
+ \fi%
+}%
+%
+% TO PREPARE ANOTHER LANGUAGE VERSION CHANGE/ADD HERE !!!
+%
+% ====================== Hebrew macros ===============================
+%
+\def\HebrewYearChar{'}
+%
+%
+% \ShortHYName{year}
+% =====================
+% Hebrew year (mod 1000) as a string of Hebrew letters
+\def\ShortHYName#1{{%
+ \count2 = #1%
+ \Remainder{\count2}{1000}{#1}% E.g., for 5752: #1 = 752
+ \def\HY{}% the string of hundreds, tens and ones
+ \ifnum #1 > 799 \strcat{\HY}{ϊϊ}\advance#1 by -800 \fi%
+ \ifnum #1 > 399 \strcat{\HY}{ϊ}\advance#1 by -400 \fi%
+ \ifnum #1 > 299 \strcat{\HY}{ω}\advance#1 by -300 \fi%
+ \ifnum #1 > 199 \strcat{\HY}{ψ}\advance#1 by -200 \fi%
+ \ifnum #1 > 99 \strcat{\HY}{χ}\advance#1 by -100 \fi%
+ \ifnum #1 > 0 %
+ %
+ % 15 and 16 are special exceptions
+ %
+ \ifnum #1 = 16 %
+ \strcat{\HY}{θζ}%
+ \else%
+ \ifnum #1 = 15 %
+ \strcat{\HY}{θε}%
+ \else%
+ \Remainder{#1}{10}{\count0 }%
+ \divide #1 by 10 %
+ \ifnum\count0 = 0%
+ \strcat{\HY}{\TensInHebrewEnd{#1}}%
+ \else%
+ \strcat{\HY}{\TensInHebrew{#1}}%
+ \strcat{\HY}{\DigitInHebrew{\count0 }}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \countdef\HYLength=0 % \HYLength==\count0 = strlen(\HY)
+ \HYLength =0 \expandafter\getlength\HY\end%
+ \ifnum\HYLength > 0 %
+ \ifnum\HYLength = 1 %
+ \HY\HebrewYearChar%
+ \else%
+ \expandafter\Insert\HY%
+ \fi%
+ \else%
+ \relax%
+ \fi%
+}}%
+%
+% \HebrewYearName{year}
+% =====================
+% Hebrew year as a string of Hebrew letters
+% 0 < year < 10000
+\def\HebrewYearName#1{{%
+ \count2 = #1%
+ \Remainder{\count2}{10000}{#1}% macro only for year <= 9999
+ \count2 = #1%
+ \Remainder{\count2}{1000}{#1}% E.g., for 5752: #1 = 752
+ \divide \count2 by 1000 % E.g., for 5752: \count2 = 5
+ \countdef\thousand=2 % \thousand==\count2
+ \def\Thousands{}% the string of thousands
+ \strcat{\Thousands}{\DigitInHebrew{\thousand }}% output 1000'
+ \ifnum\thousand = 5 % Change it in the next Hebrew Millennium..
+ \ifnum#1 > 0 % if 5000 < year < 6000
+ \def\Thousands{}% don't mention thousands
+ \fi%
+ \fi%
+ \countdef\ThousandsLength=0 %
+ % \ThousandsLength==\count0 = strlen(\Thousands)
+ \ThousandsLength =0 \expandafter\getlength\Thousands\end%
+ \ifnum\ThousandsLength > 0 % if the letter of thousands is not empty
+ \strcat{\Thousands}{'}% add '
+ \fi%
+ \def\HY{\ShortHYName{#1}}% the string of hundreds, tens and ones
+ \def\PratGadol{}% An additional string to date. Default: empty
+ \ifnum\thousand < 1%
+ \def\PratGadol{\ )μτ"β(}%
+ \fi%
+ \ifnum#1 = 0%
+ \def\PratGadol{\ )μτ"β(}%
+ \fi%
+ \Thousands\HY\PratGadol%
+}}%
+%
+% \HebrewMonthName{month}{year}
+% =============================
+% Name of month in the `year'
+\def\HebrewMonthName #1#2{%
+ \ifnum #1 = 7 %
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap ΰγψ α`%
+ \else ΰγψ%
+ \fi%
+ \else%
+ \ifcase #1%
+ Dummy\or%
+ ϊωψι\or%
+ ηωεο\or%
+ λρμε\or%
+ θαϊ\or%
+ ωαθ\or%
+ ΰγψ ΰ'\or%
+ ΰγψ α'\or%
+ πιρο\or%
+ ΰιιψ\or%
+ ριεο\or%
+ ϊξεζ\or%
+ ΰα\or%
+ ΰμεμ%
+ \fi %
+ \fi %
+}%
+%
+% \HebrewDayName{day}
+% ===============================
+% Name of day in Hebrew letters.
+%
+\def\HebrewDayName#1{%
+\ifcase#1%
+Dummy\or%
+ΰ'\or%
+α'\or%
+β'\or%
+γ'\or%
+δ'\or%
+ε'\or%
+ζ'\or%
+η'\or%
+θ'\or%
+ι'\or%
+ι''ΰ\or%
+ι''α\or%
+ι''β\or%
+ι''γ\or%
+θ''ε\or%
+θ''ζ\or%
+ι''ζ\or%
+ι''η\or%
+ι''θ\or%
+λ'\or%
+λ''ΰ\or%
+λ''α\or%
+λ''β\or%
+λ''γ\or%
+λ''δ\or%
+λ''ε\or%
+λ''ζ\or%
+λ''η\or%
+λ''θ\or%
+μ'\or%
+μ''ΰ%
+\fi%
+}%
+%
+% \DigitInHebrew{n}
+% =================
+% Single digit 1 <= n <= 9 as Hebrew letter
+% short macro:
+% \def\DigitInHebrew #1{%
+% {\ifnum#1>0 \ifnum#1<10 \advance#1 by `\_ \char#1 \fi\fi}}
+%
+\def\DigitInHebrew #1{%
+ \ifcase#1%
+ % nothing for 0
+ \or ΰ% 1
+ \or α% 2
+ \or β% 3
+ \or γ% 4
+ \or δ% 5
+ \or ε% 6
+ \or ζ% 7
+ \or η% 8
+ \or θ% 9
+ \fi%
+}%
+%
+% \TensInHebrew{num}
+% ================
+% Convert 10*num ( 1 <= num <= 9 ) into single Hebrew letter
+\def\TensInHebrew #1{%
+ \ifcase #1%
+ % nothing for 0
+ \or ι% 10
+ \or λ% 20
+ \or μ% 30
+ \or ξ% 40
+ \or π% 50
+ \or ρ% 60
+ \or ς% 70
+ \or τ% 80
+ \or φ% 90
+ \fi%
+}%
+%
+% \TensInHebrewEnd{num}
+% ================
+% Convert 10*num ( 1 <= num <= 9 ) into single Hebrew letter;
+% this letter is an endletter version ("oth sofith") if it exists.
+\def\TensInHebrewEnd #1{%
+ \ifcase #1%
+ % nothing for 0
+ \or ι% 10
+ \or κ% 20
+ \or μ% 30
+ \or ν% 40
+ \or ο% 50
+ \or ρ% 60
+ \or ς% 70
+ \or σ% 80
+ \or υ% 90
+ \fi%
+}%
+%
+% \FormatForHebrew{hday}{hmonth}{hyear}
+% =====================================
+\def\FormatForHebrew#1#2#3{%
+\HebrewDayName{#1}~α\HebrewMonthName{#2}{#3},~\HebrewYearName{#3}%
+}%
+%
+% English macros ==================================
+%
+% \HebrewMonthNameInEnglish{month}{year}
+% ===============================
+% Name of month in the `year'
+\def\HebrewMonthNameInEnglish #1#2{%
+ \ifnum #1 = 7%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap Adar II \else Adar \fi%
+ \else%
+ \ifcase #1%
+ Dummy \or%
+ Tishrei \or%
+ Heshvan \or%
+ Kislev \or%
+ Tebeth \or%
+ Shebat \or%
+ Adar I \or%
+ Adar II \or%
+ Nisan \or%
+ Iyar \or%
+ Sivan \or%
+ Tammuz \or%
+ Av \or%
+ Elul%
+ \fi %
+ \fi %
+}%
+%
+% \FormatForEnglish{hday}{hmonth}{hyear}
+% =====================================
+\def\FormatForEnglish #1#2#3{%
+ \HebrewMonthNameInEnglish{#2}{#3} \number#1,\ \number#3%
+}%
+%
+% *******************************************
+% * AUXILIARY MACROS *
+% *******************************************
+%
+\newcount\@common
+%
+% \Remainder{a}{b}{c}
+% ===================
+% c = a%b == a - b(a/b)
+\def\Remainder #1#2#3{%
+ #3 = #1% % c = a
+ \divide #3 by #2% % c = a/b
+ \multiply #3 by -#2% % c = -b(a/b)
+ \advance #3 by #1% % c = a - b(a/b)
+}%
+%
+\newif\if@Divisible
+%
+% \CheckIfDivisible{a}{b}
+% ==================
+% Set \@Divisibletrue if a%b == 0
+\def\CheckIfDivisible #1#2{%
+ {%
+ \countdef\tmp = 0% % \tmp == \count0 - temporary variable
+ \Remainder{#1}{#2}{\tmp}%
+ \ifnum \tmp = 0%
+ \global\@Divisibletrue%
+ \else%
+ \global\@Divisiblefalse%
+ \fi%
+ }%
+}%
+%
+% \strcat{str1}{str2}
+% ===================
+% apend str2 to the end of macro str1
+\def\strcat#1#2{\edef#1{#1#2}}
+%
+% \getlength{ string }
+% ====================
+% Number of nonblank tokens
+% This macro is called if \count0==strlen('string') >= 2
+% usage: {{\count0=0 \expandafter\getlength#1\end \number\count0}}
+\def\getlength #1{%
+ \ifx#1\end%
+ \let\next=\relax%
+ \else%
+ \advance\count0 by 1%
+ \let\next=\getlength%
+ \fi%
+ \next%
+}%
+%
+% \Insert
+% =======
+% Insert char <"> befor the last char and output 'string'
+% usage: {\def\abc{abc} \count0=0 \expandafter\getlength\abc\end
+% \expandafter\Insert\abc}
+\def\Insert #1{%
+ \ifnum\count0 = 1%
+#1%
+\let\next=\relax%
+\else%
+#1%
+\ifnum\count0 = 2%
+"%
+\fi
+\advance\count0 by -1%
+\let\next=\Insert%
+\fi%
+\next%
+}
+%
+% \ifundefined{command}
+% =====================
+% TeXbook, ex. 7.7 \ifundefined{command}<true text>\else<false text>\fi
+\def\ifundefined #1{\expandafter\ifx\csname#1\endcsname\relax}
+%
+% *******************************************
+% * GREGORIAN PART *
+% *******************************************
+%
+\newif\if@GregorianLeap
+%
+% \IfGregorianLeap{year}
+% ======================
+% Conditional which is true if Gregorian `year' is
+% a leap year:
+% ( ( year%4 == 0 ) && ( year%100 != 0 ) || ( year%400 == 0 ) )
+\def\IfGregorianLeap #1{%
+ \CheckIfDivisible{#1}{4}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{100}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{400}%
+ \if@Divisible%
+ \@GregorianLeaptrue%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \else%
+ \@GregorianLeaptrue%
+ \fi%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \if@GregorianLeap%
+}%
+%
+% \GregorianDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\GregorianDaysInPriorMonths #1#2#3{%
+ {%
+ #3 = \ifcase #1%
+ 0 \or % % no month number 0
+ 0 \or 31 \or 59 \or 90 \or 120 \or 151 \or %
+ 181 \or 212 \or 243 \or 273 \or 304 \or 334%
+ \fi%
+ \IfGregorianLeap{#2}% % in leap year ...
+ \ifnum #1 > 2% % if month after February ...
+ \advance #3 by 1% % add leap day
+ \fi%
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \GregorianDaysInPriorYears{year}{days}
+% ===============================
+% Number of days since 01.01.01 in years prior to the `year'
+\def\GregorianDaysInPriorYears #1#2{%
+ {%
+ \countdef\tmpc = 4% % \tmpc==\count4
+ \countdef\tmpb = 2% % \tmpb==\count2
+ \tmpb = #1%
+ \advance \tmpb by -1%
+ \tmpc = \tmpb% % \tmpc = \tmpb = year-1
+ \multiply \tmpc by 365% % Days in prior years =
+ #2 = \tmpc% % = 365*(year-1) ...
+ \tmpc = \tmpb%
+ \divide \tmpc by 4% % \tmpc = (year-1)/4
+ \advance #2 by \tmpc% % ... plus Julian leap days ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 100% % \tmpc = (year-1)/100
+ \advance #2 by -\tmpc% % ... minus century years ...
+ \tmpc = \tmpb%
+ \divide \tmpc by 400% % \tmpc = (year-1)/400
+ \advance #2 by \tmpc% % ... plus 4-century years.
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \AbsoluteFromGregorian{day}{month}{year}{absdate}
+% ======================
+% Calculation of absolute date ( days since 01.01.01 ) from
+% Gregorian date day.month.year
+\def\AbsoluteFromGregorian #1#2#3#4{%
+ {%
+ \countdef\tmpd = 0% % \tmpd==\count0
+ #4 = #1% % days so far this month
+ \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior months
+ \GregorianDaysInPriorYears{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior years
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+%
+\newif\if@GregorianLeap
+%
+% \IfGregorianLeap{year}
+% ======================
+% Conditional which is true if Gregorian `year' is
+% a leap year:
+% ( ( year%4 == 0 ) && ( year%100 != 0 ) || ( year%400 == 0 ) )
+\def\IfGregorianLeap #1{%
+ \CheckIfDivisible{#1}{4}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{100}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{400}%
+ \if@Divisible%
+ \@GregorianLeaptrue%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \else%
+ \@GregorianLeaptrue%
+ \fi%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \if@GregorianLeap%
+}%
+%
+% \GregorianDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\GregorianDaysInPriorMonths #1#2#3{%
+ {%
+ #3 = \ifcase #1%
+ 0 \or% % no month number 0
+ 0 \or%
+ 31 \or%
+ 59 \or%
+ 90 \or%
+ 120 \or%
+ 151 \or%
+ 181 \or%
+ 212 \or%
+ 243 \or%
+ 273 \or%
+ 304 \or%
+ 334%
+ \fi%
+ \IfGregorianLeap{#2}%
+ \ifnum #1 > 2% % if month after February
+ \advance #3 by 1% % add leap day
+ \fi%
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \GregorianDaysInPriorYears{year}{days}
+% ===============================
+% Number of days in years prior to the `year'
+\def\GregorianDaysInPriorYears #1#2{%
+ {%
+ \countdef\tmpc = 4% % \tmpc==\count4
+ \countdef\tmpb = 2% % \tmpb==\count2
+ \tmpb = #1% %
+ \advance \tmpb by -1% %
+ \tmpc = \tmpb% % \tmpc = \tmpb = year-1
+ \multiply \tmpc by 365% % Days in prior years =
+ #2 = \tmpc% % = 365*(year-1) ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 4% % \tmpc = (year-1)/4
+ \advance #2 by \tmpc% % ... plus Julian leap days ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 100% % \tmpc = (year-1)/100
+ \advance #2 by -\tmpc% % ... minus century years ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 400% % \tmpc = (year-1)/400
+ \advance #2 by \tmpc% % ... plus 4-century years.
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \AbsoluteFromGregorian{day}{month}{year}{absdate}
+% ======================
+% Calculation of absolute date ( days since 01.01.0001 ) from
+% Gregorian date day.month.year
+\def\AbsoluteFromGregorian #1#2#3#4{%
+ {%
+ \countdef\tmpd = 0% % \tmpd==\count0
+ #4 = #1% % days so far this month
+ \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior months
+ \GregorianDaysInPriorYears{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior years
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+
+% *******************************************
+% * HEBREW PART *
+% *******************************************
+%
+\newif\if@HebrewLeap
+%
+% \CheckLeapHebrewYear{year}
+% ======================
+% Set \@HebrewLeaptrue if Hebrew `year' is
+% a leap year: if (1+7*year)%19 < 7 then true else false
+\def\CheckLeapHebrewYear #1{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+%
+ \tmpa = #1%
+ \multiply \tmpa by 7%
+ \advance \tmpa by 1%
+ \Remainder{\tmpa}{19}{\tmpb}%
+ \ifnum \tmpb < 7% % \tmpb = (7*year+1)%19
+ \global\@HebrewLeaptrue%
+ \else%
+ \global\@HebrewLeapfalse%
+ \fi%
+ }%
+}%
+%
+% \HebrewElapsedMonths{year}{months}
+% ==============================
+% Number of months elapsed from the Sunday prior to the start
+% of the Hebrew calendar to the mean conjunction of Tishri
+% of Hebrew `year'
+\def\HebrewElapsedMonths #1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \tmpa = #1% %
+ \advance \tmpa by -1% %
+ #2 = \tmpa% % #2 = \tmpa = year-1
+ \divide #2 by 19% % Number of complete Meton cycles
+ \multiply #2 by 235% % #2 = 235*((year-1)/19)
+%
+ \Remainder{\tmpa}{19}{\tmpb}% % \tmpa = years%19 - years this cycle
+ \tmpc = \tmpb% %
+ \multiply \tmpb by 12% %
+ \advance #2 by \tmpb% % add regular months this cycle
+%
+ \multiply \tmpc by 7% %
+ \advance \tmpc by 1% %
+ \divide \tmpc by 19% % \tmpc = (1+7*((year-1)%19))/19 -
+% % number of leap months this cycle
+ \advance #2 by \tmpc% % add leap months
+%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \HebrewElapsedDays{year}{days}
+% ==============================
+% Number of days elapsed from the Sunday prior to the start
+% of the Hebrew calendar to the mean conjunction of Tishri
+% of Hebrew `year'
+\def\HebrewElapsedDays #1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \HebrewElapsedMonths{#1}{#2}% %
+ \tmpa = #2% %
+ \multiply \tmpa by 13753% %
+ \advance \tmpa by 5604% % \tmpa=MonthsElapsed*13758 + 5604
+ \Remainder{\tmpa}{25920}{\tmpc}% % \tmpc == ConjunctionParts
+ \divide \tmpa by 25920%
+%
+ \multiply #2 by 29%
+ \advance #2 by 1%
+ \advance #2 by \tmpa% % #2 = 1 + MonthsElapsed*29 +
+% % PartsElapsed/25920
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpc < 19440%
+ \ifnum \tmpc < 9924%
+ \else% % New moon at 9 h. 204 p. or later ...
+ \ifnum \tmpa = 2% % on Tuesday ...
+ \CheckLeapHebrewYear{#1}% % of a common year
+ \if@HebrewLeap%
+ \else%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum \tmpc < 16789%
+ \else% % New moon at 15 h. 589 p. or later ...
+ \ifnum \tmpa = 1% % on Monday ...
+ \advance #1 by -1%
+ \CheckLeapHebrewYear{#1}% % at the end of leap year
+ \if@HebrewLeap%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \advance #2 by 1% % new moon at or after midday
+ \fi%
+%
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpa = 0% % if Sunday ...
+ \advance #2 by 1%
+ \else% %
+ \ifnum \tmpa = 3% % Wednesday ...
+ \advance #2 by 1%
+ \else%
+ \ifnum \tmpa = 5% % or Friday
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \DaysInHebrewYear{year}{days}
+% ==============================
+% Number of days in Hebrew `year'
+\def\DaysInHebrewYear #1#2{%
+ {%
+ \countdef\tmpe = 12% % \tmpe==\count12
+%
+ \HebrewElapsedDays{#1}{\tmpe}%
+ \advance #1 by 1%
+ \HebrewElapsedDays{#1}{#2}%
+ \advance #2 by -\tmpe%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \HebrewDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\HebrewDaysInPriorMonths #1#2#3{%
+ {%
+ \countdef\tmpf= 14% % \tmpf==\count14
+%
+ #3 = \ifcase #1% % Days in prior month of regular year
+ 0 \or% % no month number 0
+ 0 \or% % Tishri
+ 30 \or% % Heshvan
+ 59 \or% % Kislev
+ 89 \or% % Tebeth
+ 118 \or% % Shebat
+ 148 \or% % Adar I
+ 148 \or% % Adar II
+ 177 \or% % Nisan
+ 207 \or% % Iyar
+ 236 \or% % Sivan
+ 266 \or% % Tammuz
+ 295 \or% % Av
+ 325 \or% % Elul
+ 400% % Dummy
+ \fi%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap% % in leap year
+ \ifnum #1 > 6% % if month after Adar I
+ \advance #3 by 30% % add 30 days
+ \fi%
+ \fi%
+ \DaysInHebrewYear{#2}{\tmpf}%
+ \ifnum #1 > 3%
+ \ifnum \tmpf = 353% %
+ \advance #3 by -1% %
+ \fi% % Short Kislev
+ \ifnum \tmpf = 383% %
+ \advance #3 by -1% %
+ \fi% %
+ \fi%
+%
+ \ifnum #1 > 2%
+ \ifnum \tmpf = 355% %
+ \advance #3 by 1% %
+ \fi% % Long Heshvan
+ \ifnum \tmpf = 385% %
+ \advance #3 by 1% %
+ \fi% %
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \AbsoluteFromHebrew{day}{month}{year}{days}
+% ===============================
+% Absolute date of Hebrew day,month,year
+\def\AbsoluteFromHebrew #1#2#3#4{%
+ {%
+ #4 = #1%
+ \HebrewDaysInPriorMonths{#2}{#3}{#1}%
+ \advance #4 by #1% % Add days in prior months this year
+ \HebrewElapsedDays{#3}{#1}%
+ \advance #4 by #1% % Add days in prior years
+ \advance #4 by -1373429% % Subtract days before Gregorian 1.1.1
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+%
+% \HebrewFromGregorian{Gday}{Gmonth}{Gyear}{Hday}{Hmonth}{Hyear}
+% ===============================
+% Evaluating Hebrew date Hday,Hmonth,Hyear from
+% Gregorian date Gday,Gmonth,Gyear
+\def\HebrewFromGregorian #1#2#3#4#5#6{%
+ {%
+ \countdef\tmpx= 17% % \tmpx==\count17
+ \countdef\tmpy= 18% % \tmpy==\count18
+ \countdef\tmpz= 19% % \tmpz==\count19
+%
+ #6 = #3% %
+ \global\advance #6 by 3761% % approximation from above
+ \AbsoluteFromGregorian{#1}{#2}{#3}{#4}%
+ \tmpz = 1 \tmpy = 1%
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \ifnum \tmpx > #4% %
+ \global\advance #6 by -1% % Hyear = Gyear + 3760
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \fi% %
+ \advance #4 by -\tmpx% % Days in this year
+ \advance #4 by 1% %
+ #5 = #4% %
+ \divide #5 by 30% % Approximation for month from below
+ \loop% % Search for month
+ \HebrewDaysInPriorMonths{#5}{#6}{\tmpx}%
+ \ifnum \tmpx < #4%
+ \advance #5 by 1%
+ \tmpy = \tmpx%
+ \repeat%
+ \global\advance #5 by -1%
+ \global\advance #4 by -\tmpy%
+ }%
+}%
+\catcode`@=12
+
diff --git a/language/hebrew/hebtex/macros/tex_macros/hebcal_p.tex b/language/hebrew/hebtex/macros/tex_macros/hebcal_p.tex
new file mode 100644
index 0000000000..72f4fdc4f4
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/hebcal_p.tex
@@ -0,0 +1,908 @@
+%
+% TeX & LaTeX MACROS FOR COMPUTING HEBREW DATE FROM GREGORIAN ONE
+%
+% by Michail Rozman, misha@iop.tartu.ew.su
+%
+% Released: Tammuz 12, 5751 -- June 24, 1991
+% Corrected: Shebat 10, 5752 -- January 15, 1992 by Rama Porrat
+% Corrected: Adar II 5, 5752 -- March 10, 1992 by Misha
+% Corrected: Tebeth, 5756 -- January 1996 Dan Haran
+% (haran@math.tau.ac.il)
+
+% Please direct any comments, bug reports, questions, etc.
+% to the address above.
+%
+% If Hebrew fonts and style macros are loaded AND you are in
+% Hebrew mode the produced date is in Hebrew.
+% Otherwise the date string looks like Shebat 10, 5752.
+%
+% Use this style as follows:
+%
+% LaTeX | TeX
+% |
+% \documentstyle[...,hebcal,...] \input hebcal.sty
+%
+% % ONLY IF \ifheb IS NOT
+% \newif\ifheb \hebtrue % DEFINED IN YOUR
+% % HEBREW STYLE !!
+%
+% \Hebrewtoday
+% or
+% {\day=10 \month=3 \year=1992 % to fool \today
+% \today == \Hebrewtoday}
+% or
+% \newcount\hd \newcount\hm \newcount\hy
+% \hd=10 \hm=3 \hy=1992 \Hebrewdate{\hd}{\hm}{\hy}
+%
+%
+% TABLE OF CONTENTS
+%
+% INTRODUCTION
+% REGISTERS, COMMANDS AND LANGUAGE-DEPENDENT INTERFACE
+% Hebrew language macros
+% English language macros
+% AUXILIARY MACROS
+% GREGORIAN PART
+% HEBREW PART
+%
+% *******************************************
+% * INTRODUCTION *
+% *******************************************
+%
+% The Hebrew calendar is inherently complicated:
+% It is lunisolar -- each year starts close to the
+% autumn equinox, but each month must strictly start
+% at a new moon. Thus Hebrew calendar must be harmonized
+% simultaneously with both lunar and solar events.
+% In addition, for reasons of the religious practice, the
+% year cannot start on Sunday, Wednesday or Friday.
+%
+% For the full description of Hebrew calendar and for
+% the list of references see:
+%
+% Nachum Dershowitz and Edward M. Reingold,
+% "Calendrical Calculations", Software--Pract.Exper.,
+% vol. 20 (9), pp.899--928 (September 1990)
+% C translation of LISP programs from the above article
+% available from Mr. Wayne Geiser, geiser%pictel@uunet.uu.net
+%
+% The 4th distribution ( July 1989 ) of hdate/hcal ( Hebrew
+% calendar programs similar to UNIX date/cal ) by
+% Mr. Amos Shapir, amos@shum.huji.ac.il , contains short
+% and very clear description of algorithms.
+%
+\catcode`@=11
+% *******************************************
+% * REGISTERS, COMMAND, FORMATTING MACROS *
+% *******************************************
+%
+% The command \Hebrewtoday produces today's date for Hebrew
+% calendar. It is similar to the \today command of the LETTER
+% style. In addition three numerical registers \Hebrewday
+% \Hebrewmonth and \Hebrewyear are set.
+% For setting this registers without producing of date string
+% command \Hebrewsetreg can be used.
+% The command \Hebrewdate{Gday}{Gmonth}{Gyear} produces Hebrew
+% calendar date corresponding to Gregorian date Gday.Gmonth.Gyear.
+% Three numerical registers \Hebrewday \Hebrewmonth and
+% \Hebrewyear are set.
+% For converting arbitrary Gregorian date Gday.Gmonth.Gyear
+% to Hebrew date Hday.Hmonth.Hyear without producing date string
+% the command:
+% \HebrewFromGregorian{Gday}{Gmonth}{Gyear}{Hday}{Hmonth}{Hyear}
+% can be used.
+%
+\newcount\Hebrewday \newcount\Hebrewmonth \newcount\Hebrewyear
+%
+% \Hebrewdate{Gday}{Gmonth}{Gyear}
+% ================================
+% Hebrew calendar date corresponding to Gregorian Gday.Gmonth.Gyear
+\def\Hebrewdate #1#2#3{%
+ \HebrewFromGregorian{#1}{#2}{#3}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \ifundefined{ifheb}% Hebrew fonts&macros are not loaded
+ \FormatForEnglish{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \else%
+ \FormatDate{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \fi%
+}%
+%
+%\Hebrewtoday
+% ============
+% Today's date in Hebrew calendar
+\def\Hebrewtoday{\Hebrewdate{\day}{\month}{\year}}
+\let\hebrewtoday=\Hebrewtoday
+%
+% \Hebrewsetreg
+% ============
+% Set registers: today's date in hebrew calendar
+\def\Hebrewsetreg{%
+ \HebrewFromGregorian{\day}{\month}{\year}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+}%
+%
+% \FormatDate{Hebrewday}{Hebrewmonth}{Hebrewyear}
+% ===============================================
+\def\FormatDate #1#2#3{%
+ \ifheb% Hebrew mode
+ \FormatForHebrew{#1}{#2}{#3}%
+ \else% English mode
+ \FormatForEnglish{#1}{#2}{#3}
+ \fi%
+}%
+%
+% TO PREPARE ANOTHER LANGUAGE VERSION CHANGE/ADD HERE !!!
+%
+% ====================== Hebrew macros ===============================
+%
+\def\HebrewYearChar{'}
+%
+%
+% \ShortHYName{year}
+% =====================
+% Hebrew year (mod 1000) as a string of Hebrew letters
+\def\ShortHYName#1{{%
+ \count2 = #1%
+ \Remainder{\count2}{1000}{#1}% E.g., for 5752: #1 = 752
+ \def\HY{}% the string of hundreds, tens and ones
+ \ifnum #1 > 799 \strcat{\HY}{šš}\advance#1 by -800 \fi%
+ \ifnum #1 > 399 \strcat{\HY}{š}\advance#1 by -400 \fi%
+ \ifnum #1 > 299 \strcat{\HY}{™}\advance#1 by -300 \fi%
+ \ifnum #1 > 199 \strcat{\HY}{˜}\advance#1 by -200 \fi%
+ \ifnum #1 > 99 \strcat{\HY}{—}\advance#1 by -100 \fi%
+ \ifnum #1 > 0 %
+ %
+ % 15 and 16 are special exceptions
+ %
+ \ifnum #1 = 16 %
+ \strcat{\HY}{ˆ†}%
+ \else%
+ \ifnum #1 = 15 %
+ \strcat{\HY}{ˆ…}%
+ \else%
+ \Remainder{#1}{10}{\count0 }%
+ \divide #1 by 10 %
+ \ifnum\count0 = 0%
+ \strcat{\HY}{\TensInHebrewEnd{#1}}%
+ \else%
+ \strcat{\HY}{\TensInHebrew{#1}}%
+ \strcat{\HY}{\DigitInHebrew{\count0 }}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \countdef\HYLength=0 % \HYLength==\count0 = strlen(\HY)
+ \HYLength =0 \expandafter\getlength\HY\end%
+ \ifnum\HYLength > 0 %
+ \ifnum\HYLength = 1 %
+ \HY\HebrewYearChar%
+ \else%
+ \expandafter\Insert\HY%
+ \fi%
+ \else%
+ \relax%
+ \fi%
+}}%
+%
+% \HebrewYearName{year}
+% =====================
+% Hebrew year as a string of Hebrew letters
+% 0 < year < 10000
+\def\HebrewYearName#1{{%
+ \count2 = #1%
+ \Remainder{\count2}{10000}{#1}% macro only for year <= 9999
+ \count2 = #1%
+ \Remainder{\count2}{1000}{#1}% E.g., for 5752: #1 = 752
+ \divide \count2 by 1000 % E.g., for 5752: \count2 = 5
+ \countdef\thousand=2 % \thousand==\count2
+ \def\Thousands{}% the string of thousands
+ \strcat{\Thousands}{\DigitInHebrew{\thousand }}% output 1000'
+ \ifnum\thousand = 5 % Change it in the next Hebrew Millennium..
+ \ifnum#1 > 0 % if 5000 < year < 6000
+ \def\Thousands{}% don't mention thousands
+ \fi%
+ \fi%
+ \countdef\ThousandsLength=0 %
+ % \ThousandsLength==\count0 = strlen(\Thousands)
+ \ThousandsLength =0 \expandafter\getlength\Thousands\end%
+ \ifnum\ThousandsLength > 0 % if the letter of thousands is not empty
+ \strcat{\Thousands}{'}% add '
+ \fi%
+ \def\HY{\ShortHYName{#1}}% the string of hundreds, tens and ones
+ \def\PratGadol{}% An additional string to date. Default: empty
+ \ifnum\thousand < 1%
+ \def\PratGadol{\ )Œ”"‚(}%
+ \fi%
+ \ifnum#1 = 0%
+ \def\PratGadol{\ )Œ”"‚(}%
+ \fi%
+ \Thousands\HY\PratGadol%
+}}%
+%
+% \HebrewMonthName{month}{year}
+% =============================
+% Name of month in the `year'
+\def\HebrewMonthName #1#2{%
+ \ifnum #1 = 7 %
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap €ƒ˜ `%
+ \else €ƒ˜%
+ \fi%
+ \else%
+ \ifcase #1%
+ Dummy\or%
+ š™˜‰\or%
+ ‡™…\or%
+ ‹‘Œ…\or%
+ ˆš\or%
+ ™ˆ\or%
+ €ƒ˜ €'\or%
+ €ƒ˜ '\or%
+ ‰‘\or%
+ €‰‰˜\or%
+ ‘‰…\or%
+ šŽ…†\or%
+ €\or%
+ €Œ…Œ%
+ \fi %
+ \fi %
+}%
+%
+% \HebrewDayName{day}
+% ===============================
+% Name of day in Hebrew letters.
+%
+\def\HebrewDayName#1{%
+\ifcase#1%
+Dummy\or%
+€'\or%
+'\or%
+‚'\or%
+ƒ'\or%
+„'\or%
+…'\or%
+†'\or%
+‡'\or%
+ˆ'\or%
+‰'\or%
+‰''€\or%
+‰''\or%
+‰''‚\or%
+‰''ƒ\or%
+ˆ''…\or%
+ˆ''†\or%
+‰''†\or%
+‰''‡\or%
+‰''ˆ\or%
+‹'\or%
+‹''€\or%
+‹''\or%
+‹''‚\or%
+‹''ƒ\or%
+‹''„\or%
+‹''…\or%
+‹''†\or%
+‹''‡\or%
+‹''ˆ\or%
+Œ'\or%
+Œ''€%
+\fi%
+}%
+%
+% \DigitInHebrew{n}
+% =================
+% Single digit 1 <= n <= 9 as Hebrew letter
+% short macro:
+% \def\DigitInHebrew #1{%
+% {\ifnum#1>0 \ifnum#1<10 \advance#1 by `\_ \char#1 \fi\fi}}
+%
+\def\DigitInHebrew #1{%
+ \ifcase#1%
+ % nothing for 0
+ \or €% 1
+ \or % 2
+ \or ‚% 3
+ \or ƒ% 4
+ \or „% 5
+ \or …% 6
+ \or †% 7
+ \or ‡% 8
+ \or ˆ% 9
+ \fi%
+}%
+%
+% \TensInHebrew{num}
+% ================
+% Convert 10*num ( 1 <= num <= 9 ) into single Hebrew letter
+\def\TensInHebrew #1{%
+ \ifcase #1%
+ % nothing for 0
+ \or ‰% 10
+ \or ‹% 20
+ \or Œ% 30
+ \or Ž% 40
+ \or % 50
+ \or ‘% 60
+ \or ’% 70
+ \or ”% 80
+ \or –% 90
+ \fi%
+}%
+%
+% \TensInHebrewEnd{num}
+% ================
+% Convert 10*num ( 1 <= num <= 9 ) into single Hebrew letter;
+% this letter is an endletter version ("oth sofith") if it exists.
+\def\TensInHebrewEnd #1{%
+ \ifcase #1%
+ % nothing for 0
+ \or ‰% 10
+ \or Š% 20
+ \or Œ% 30
+ \or % 40
+ \or % 50
+ \or ‘% 60
+ \or ’% 70
+ \or “% 80
+ \or •% 90
+ \fi%
+}%
+%
+% \FormatForHebrew{hday}{hmonth}{hyear}
+% =====================================
+\def\FormatForHebrew#1#2#3{%
+\HebrewDayName{#1}~\HebrewMonthName{#2}{#3},~\HebrewYearName{#3}%
+}%
+%
+% English macros ==================================
+%
+% \HebrewMonthNameInEnglish{month}{year}
+% ===============================
+% Name of month in the `year'
+\def\HebrewMonthNameInEnglish #1#2{%
+ \ifnum #1 = 7%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap Adar II \else Adar \fi%
+ \else%
+ \ifcase #1%
+ Dummy \or%
+ Tishrei \or%
+ Heshvan \or%
+ Kislev \or%
+ Tebeth \or%
+ Shebat \or%
+ Adar I \or%
+ Adar II \or%
+ Nisan \or%
+ Iyar \or%
+ Sivan \or%
+ Tammuz \or%
+ Av \or%
+ Elul%
+ \fi %
+ \fi %
+}%
+%
+% \FormatForEnglish{hday}{hmonth}{hyear}
+% =====================================
+\def\FormatForEnglish #1#2#3{%
+ \HebrewMonthNameInEnglish{#2}{#3} \number#1,\ \number#3%
+}%
+%
+% *******************************************
+% * AUXILIARY MACROS *
+% *******************************************
+%
+\newcount\@common
+%
+% \Remainder{a}{b}{c}
+% ===================
+% c = a%b == a - b(a/b)
+\def\Remainder #1#2#3{%
+ #3 = #1% % c = a
+ \divide #3 by #2% % c = a/b
+ \multiply #3 by -#2% % c = -b(a/b)
+ \advance #3 by #1% % c = a - b(a/b)
+}%
+%
+\newif\if@Divisible
+%
+% \CheckIfDivisible{a}{b}
+% ==================
+% Set \@Divisibletrue if a%b == 0
+\def\CheckIfDivisible #1#2{%
+ {%
+ \countdef\tmp = 0% % \tmp == \count0 - temporary variable
+ \Remainder{#1}{#2}{\tmp}%
+ \ifnum \tmp = 0%
+ \global\@Divisibletrue%
+ \else%
+ \global\@Divisiblefalse%
+ \fi%
+ }%
+}%
+%
+% \strcat{str1}{str2}
+% ===================
+% apend str2 to the end of macro str1
+\def\strcat#1#2{\edef#1{#1#2}}
+%
+% \getlength{ string }
+% ====================
+% Number of nonblank tokens
+% This macro is called if \count0==strlen('string') >= 2
+% usage: {{\count0=0 \expandafter\getlength#1\end \number\count0}}
+\def\getlength #1{%
+ \ifx#1\end%
+ \let\next=\relax%
+ \else%
+ \advance\count0 by 1%
+ \let\next=\getlength%
+ \fi%
+ \next%
+}%
+%
+% \Insert
+% =======
+% Insert char <"> befor the last char and output 'string'
+% usage: {\def\abc{abc} \count0=0 \expandafter\getlength\abc\end
+% \expandafter\Insert\abc}
+\def\Insert #1{%
+ \ifnum\count0 = 1%
+#1%
+\let\next=\relax%
+\else%
+#1%
+\ifnum\count0 = 2%
+"%
+\fi
+\advance\count0 by -1%
+\let\next=\Insert%
+\fi%
+\next%
+}
+%
+% \ifundefined{command}
+% =====================
+% TeXbook, ex. 7.7 \ifundefined{command}<true text>\else<false text>\fi
+\def\ifundefined #1{\expandafter\ifx\csname#1\endcsname\relax}
+%
+% *******************************************
+% * GREGORIAN PART *
+% *******************************************
+%
+\newif\if@GregorianLeap
+%
+% \IfGregorianLeap{year}
+% ======================
+% Conditional which is true if Gregorian `year' is
+% a leap year:
+% ( ( year%4 == 0 ) && ( year%100 != 0 ) || ( year%400 == 0 ) )
+\def\IfGregorianLeap #1{%
+ \CheckIfDivisible{#1}{4}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{100}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{400}%
+ \if@Divisible%
+ \@GregorianLeaptrue%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \else%
+ \@GregorianLeaptrue%
+ \fi%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \if@GregorianLeap%
+}%
+%
+% \GregorianDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\GregorianDaysInPriorMonths #1#2#3{%
+ {%
+ #3 = \ifcase #1%
+ 0 \or % % no month number 0
+ 0 \or 31 \or 59 \or 90 \or 120 \or 151 \or %
+ 181 \or 212 \or 243 \or 273 \or 304 \or 334%
+ \fi%
+ \IfGregorianLeap{#2}% % in leap year ...
+ \ifnum #1 > 2% % if month after February ...
+ \advance #3 by 1% % add leap day
+ \fi%
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \GregorianDaysInPriorYears{year}{days}
+% ===============================
+% Number of days since 01.01.01 in years prior to the `year'
+\def\GregorianDaysInPriorYears #1#2{%
+ {%
+ \countdef\tmpc = 4% % \tmpc==\count4
+ \countdef\tmpb = 2% % \tmpb==\count2
+ \tmpb = #1%
+ \advance \tmpb by -1%
+ \tmpc = \tmpb% % \tmpc = \tmpb = year-1
+ \multiply \tmpc by 365% % Days in prior years =
+ #2 = \tmpc% % = 365*(year-1) ...
+ \tmpc = \tmpb%
+ \divide \tmpc by 4% % \tmpc = (year-1)/4
+ \advance #2 by \tmpc% % ... plus Julian leap days ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 100% % \tmpc = (year-1)/100
+ \advance #2 by -\tmpc% % ... minus century years ...
+ \tmpc = \tmpb%
+ \divide \tmpc by 400% % \tmpc = (year-1)/400
+ \advance #2 by \tmpc% % ... plus 4-century years.
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \AbsoluteFromGregorian{day}{month}{year}{absdate}
+% ======================
+% Calculation of absolute date ( days since 01.01.01 ) from
+% Gregorian date day.month.year
+\def\AbsoluteFromGregorian #1#2#3#4{%
+ {%
+ \countdef\tmpd = 0% % \tmpd==\count0
+ #4 = #1% % days so far this month
+ \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior months
+ \GregorianDaysInPriorYears{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior years
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+%
+\newif\if@GregorianLeap
+%
+% \IfGregorianLeap{year}
+% ======================
+% Conditional which is true if Gregorian `year' is
+% a leap year:
+% ( ( year%4 == 0 ) && ( year%100 != 0 ) || ( year%400 == 0 ) )
+\def\IfGregorianLeap #1{%
+ \CheckIfDivisible{#1}{4}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{100}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{400}%
+ \if@Divisible%
+ \@GregorianLeaptrue%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \else%
+ \@GregorianLeaptrue%
+ \fi%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \if@GregorianLeap%
+}%
+%
+% \GregorianDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\GregorianDaysInPriorMonths #1#2#3{%
+ {%
+ #3 = \ifcase #1%
+ 0 \or% % no month number 0
+ 0 \or%
+ 31 \or%
+ 59 \or%
+ 90 \or%
+ 120 \or%
+ 151 \or%
+ 181 \or%
+ 212 \or%
+ 243 \or%
+ 273 \or%
+ 304 \or%
+ 334%
+ \fi%
+ \IfGregorianLeap{#2}%
+ \ifnum #1 > 2% % if month after February
+ \advance #3 by 1% % add leap day
+ \fi%
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \GregorianDaysInPriorYears{year}{days}
+% ===============================
+% Number of days in years prior to the `year'
+\def\GregorianDaysInPriorYears #1#2{%
+ {%
+ \countdef\tmpc = 4% % \tmpc==\count4
+ \countdef\tmpb = 2% % \tmpb==\count2
+ \tmpb = #1% %
+ \advance \tmpb by -1% %
+ \tmpc = \tmpb% % \tmpc = \tmpb = year-1
+ \multiply \tmpc by 365% % Days in prior years =
+ #2 = \tmpc% % = 365*(year-1) ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 4% % \tmpc = (year-1)/4
+ \advance #2 by \tmpc% % ... plus Julian leap days ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 100% % \tmpc = (year-1)/100
+ \advance #2 by -\tmpc% % ... minus century years ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 400% % \tmpc = (year-1)/400
+ \advance #2 by \tmpc% % ... plus 4-century years.
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \AbsoluteFromGregorian{day}{month}{year}{absdate}
+% ======================
+% Calculation of absolute date ( days since 01.01.0001 ) from
+% Gregorian date day.month.year
+\def\AbsoluteFromGregorian #1#2#3#4{%
+ {%
+ \countdef\tmpd = 0% % \tmpd==\count0
+ #4 = #1% % days so far this month
+ \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior months
+ \GregorianDaysInPriorYears{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior years
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+
+% *******************************************
+% * HEBREW PART *
+% *******************************************
+%
+\newif\if@HebrewLeap
+%
+% \CheckLeapHebrewYear{year}
+% ======================
+% Set \@HebrewLeaptrue if Hebrew `year' is
+% a leap year: if (1+7*year)%19 < 7 then true else false
+\def\CheckLeapHebrewYear #1{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+%
+ \tmpa = #1%
+ \multiply \tmpa by 7%
+ \advance \tmpa by 1%
+ \Remainder{\tmpa}{19}{\tmpb}%
+ \ifnum \tmpb < 7% % \tmpb = (7*year+1)%19
+ \global\@HebrewLeaptrue%
+ \else%
+ \global\@HebrewLeapfalse%
+ \fi%
+ }%
+}%
+%
+% \HebrewElapsedMonths{year}{months}
+% ==============================
+% Number of months elapsed from the Sunday prior to the start
+% of the Hebrew calendar to the mean conjunction of Tishri
+% of Hebrew `year'
+\def\HebrewElapsedMonths #1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \tmpa = #1% %
+ \advance \tmpa by -1% %
+ #2 = \tmpa% % #2 = \tmpa = year-1
+ \divide #2 by 19% % Number of complete Meton cycles
+ \multiply #2 by 235% % #2 = 235*((year-1)/19)
+%
+ \Remainder{\tmpa}{19}{\tmpb}% % \tmpa = years%19 - years this cycle
+ \tmpc = \tmpb% %
+ \multiply \tmpb by 12% %
+ \advance #2 by \tmpb% % add regular months this cycle
+%
+ \multiply \tmpc by 7% %
+ \advance \tmpc by 1% %
+ \divide \tmpc by 19% % \tmpc = (1+7*((year-1)%19))/19 -
+% % number of leap months this cycle
+ \advance #2 by \tmpc% % add leap months
+%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \HebrewElapsedDays{year}{days}
+% ==============================
+% Number of days elapsed from the Sunday prior to the start
+% of the Hebrew calendar to the mean conjunction of Tishri
+% of Hebrew `year'
+\def\HebrewElapsedDays #1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \HebrewElapsedMonths{#1}{#2}% %
+ \tmpa = #2% %
+ \multiply \tmpa by 13753% %
+ \advance \tmpa by 5604% % \tmpa=MonthsElapsed*13758 + 5604
+ \Remainder{\tmpa}{25920}{\tmpc}% % \tmpc == ConjunctionParts
+ \divide \tmpa by 25920%
+%
+ \multiply #2 by 29%
+ \advance #2 by 1%
+ \advance #2 by \tmpa% % #2 = 1 + MonthsElapsed*29 +
+% % PartsElapsed/25920
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpc < 19440%
+ \ifnum \tmpc < 9924%
+ \else% % New moon at 9 h. 204 p. or later ...
+ \ifnum \tmpa = 2% % on Tuesday ...
+ \CheckLeapHebrewYear{#1}% % of a common year
+ \if@HebrewLeap%
+ \else%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum \tmpc < 16789%
+ \else% % New moon at 15 h. 589 p. or later ...
+ \ifnum \tmpa = 1% % on Monday ...
+ \advance #1 by -1%
+ \CheckLeapHebrewYear{#1}% % at the end of leap year
+ \if@HebrewLeap%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \advance #2 by 1% % new moon at or after midday
+ \fi%
+%
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpa = 0% % if Sunday ...
+ \advance #2 by 1%
+ \else% %
+ \ifnum \tmpa = 3% % Wednesday ...
+ \advance #2 by 1%
+ \else%
+ \ifnum \tmpa = 5% % or Friday
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \DaysInHebrewYear{year}{days}
+% ==============================
+% Number of days in Hebrew `year'
+\def\DaysInHebrewYear #1#2{%
+ {%
+ \countdef\tmpe = 12% % \tmpe==\count12
+%
+ \HebrewElapsedDays{#1}{\tmpe}%
+ \advance #1 by 1%
+ \HebrewElapsedDays{#1}{#2}%
+ \advance #2 by -\tmpe%
+ \global\@common = #2%
+ }%
+ #2 = \@common%
+}%
+%
+% \HebrewDaysInPriorMonths{month}{year}{days}
+% ===============================
+% Number of days in months prior to `month' in the `year'
+\def\HebrewDaysInPriorMonths #1#2#3{%
+ {%
+ \countdef\tmpf= 14% % \tmpf==\count14
+%
+ #3 = \ifcase #1% % Days in prior month of regular year
+ 0 \or% % no month number 0
+ 0 \or% % Tishri
+ 30 \or% % Heshvan
+ 59 \or% % Kislev
+ 89 \or% % Tebeth
+ 118 \or% % Shebat
+ 148 \or% % Adar I
+ 148 \or% % Adar II
+ 177 \or% % Nisan
+ 207 \or% % Iyar
+ 236 \or% % Sivan
+ 266 \or% % Tammuz
+ 295 \or% % Av
+ 325 \or% % Elul
+ 400% % Dummy
+ \fi%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap% % in leap year
+ \ifnum #1 > 6% % if month after Adar I
+ \advance #3 by 30% % add 30 days
+ \fi%
+ \fi%
+ \DaysInHebrewYear{#2}{\tmpf}%
+ \ifnum #1 > 3%
+ \ifnum \tmpf = 353% %
+ \advance #3 by -1% %
+ \fi% % Short Kislev
+ \ifnum \tmpf = 383% %
+ \advance #3 by -1% %
+ \fi% %
+ \fi%
+%
+ \ifnum #1 > 2%
+ \ifnum \tmpf = 355% %
+ \advance #3 by 1% %
+ \fi% % Long Heshvan
+ \ifnum \tmpf = 385% %
+ \advance #3 by 1% %
+ \fi% %
+ \fi%
+ \global\@common = #3%
+ }%
+ #3 = \@common%
+}%
+%
+% \AbsoluteFromHebrew{day}{month}{year}{days}
+% ===============================
+% Absolute date of Hebrew day,month,year
+\def\AbsoluteFromHebrew #1#2#3#4{%
+ {%
+ #4 = #1%
+ \HebrewDaysInPriorMonths{#2}{#3}{#1}%
+ \advance #4 by #1% % Add days in prior months this year
+ \HebrewElapsedDays{#3}{#1}%
+ \advance #4 by #1% % Add days in prior years
+ \advance #4 by -1373429% % Subtract days before Gregorian 1.1.1
+ \global\@common = #4%
+ }%
+ #4 = \@common%
+}%
+%
+% \HebrewFromGregorian{Gday}{Gmonth}{Gyear}{Hday}{Hmonth}{Hyear}
+% ===============================
+% Evaluating Hebrew date Hday,Hmonth,Hyear from
+% Gregorian date Gday,Gmonth,Gyear
+\def\HebrewFromGregorian #1#2#3#4#5#6{%
+ {%
+ \countdef\tmpx= 17% % \tmpx==\count17
+ \countdef\tmpy= 18% % \tmpy==\count18
+ \countdef\tmpz= 19% % \tmpz==\count19
+%
+ #6 = #3% %
+ \global\advance #6 by 3761% % approximation from above
+ \AbsoluteFromGregorian{#1}{#2}{#3}{#4}%
+ \tmpz = 1 \tmpy = 1%
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \ifnum \tmpx > #4% %
+ \global\advance #6 by -1% % Hyear = Gyear + 3760
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \fi% %
+ \advance #4 by -\tmpx% % Days in this year
+ \advance #4 by 1% %
+ #5 = #4% %
+ \divide #5 by 30% % Approximation for month from below
+ \loop% % Search for month
+ \HebrewDaysInPriorMonths{#5}{#6}{\tmpx}%
+ \ifnum \tmpx < #4%
+ \advance #5 by 1%
+ \tmpy = \tmpx%
+ \repeat%
+ \global\advance #5 by -1%
+ \global\advance #4 by -\tmpy%
+ }%
+}%
+\catcode`@=12
+
diff --git a/language/hebrew/hebtex/macros/tex_macros/hletter1.tex b/language/hebrew/hebtex/macros/tex_macros/hletter1.tex
new file mode 100644
index 0000000000..7cee8bd418
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/hletter1.tex
@@ -0,0 +1,92 @@
+%(c) 1990,91 by Joel M. Hoffman - belongs to hclassic, hcaption.
+%hletter1.tex. Version 1.0.
+%updated 5/15/91 by JMH
+
+%Defines \aleph - \taf according to the standard Israeli fonts, with a
+%variety of spelling options for the Hebrew letters. Both ``\peh'' and
+%``\pe'' are recognized, for example. ``\fchaf'' is a Final Chaf; other
+%final letters are similar.
+%Capitalized letters are letters with a _dagesh_ (requires the file
+%``dots.tex''). So \Bet is \bet with a _dagesh_ in it. You can put a
+%_dagesh_ in any letter you want, although sometimes it's a little silly.
+%(``\Aleph'' for example).
+%Also defined are \vowelayin -- a non-descending \ayin for use with vowels,
+%and \alephlamed, the ligature. Most Israeli fonts do not contain these.
+
+%Use of this material in a commercial venture of any sort requires
+%permission from me. Otherwise, you are free to use this for any
+%legal, non-destructive purpose. If you find this useful, a
+%contribution to charity will be most appreciated.
+
+%Send comments or complaints to:
+%
+%BITNET: hoffman@nyuacf.BITNET <-- this will change soon
+%CompuServe: 72700,402 -or- 72700.402@compuserve.com
+%SNAIL: Joel M. Hoffman
+% 19 Hillcrest Lane
+% Rye, NY 10580
+% U.S.A.
+
+\def\aleph{€}
+\def\bet{}
+\def\gimel{‚}
+\def\dalet{ƒ}\def\daled{ƒ}
+\def\he{„} \def\heh{„}
+\def\vav{…}
+\def\zion{†}
+\def\chet{‡}
+\def\tet{ˆ}
+\def\yud{‰}
+\def\fkaf{Š} \def\fchaf{Š}
+\def\kaf{‹} \def\chaf{‹}
+\def\lamed{Œ}
+\def\fmem{}
+\def\mem{Ž}
+\def\fnun{}
+\def\nun{}
+\def\samech{‘}
+\def\ayin{’}
+\def\fpe{“} \def\fpeh{“} \def\ffe{“} \def\ffeh{“}
+\def\pe{”} \def\peh{”} \def\fe{”} \def\feh{”}
+\def\ftzadi{•} \def\ftzadik{•}
+\def\tzadi{–} \def\tzadik{–}
+\def\kuf{—} \def\koof{—}
+\def\resh{˜}
+\def\shin{™} \def\sin{™}
+\def\tav{š} \def\taf{š}
+
+
+
+\def\Aleph{\dagesh{€}}
+\def\Bet{\dagesh{}}
+\def\Gimel{\dagesh{‚}}
+\def\Dalet{\dagesh{ƒ}}\def\Daled{\dagesh{ƒ}}
+\def\He{\dagesh{„}} \def\Heh{\dagesh{„}}
+\def\Vav{\dagesh{…}}
+\def\Zion{\dagesh{†}}
+\def\Chet{\dagesh{‡}}
+\def\Tet{\dagesh{ˆ}}
+\def\Yud{\dagesh{‰}}
+\def\Fkaf{\dagesh{Š}} \def\Fchaf{\dagesh{Š}}
+\def\Kaf{\dagesh{‹}} \def\Chaf{\dagesh{‹}}
+\def\Lamed{\dagesh{Œ}}
+\def\Fmem{\dagesh{}}
+\def\Mem{\dagesh{Ž}}
+\def\Fnun{\dagesh{}}
+\def\Nun{\dagesh{}}
+\def\Samech{\dagesh{‘}}
+\def\Ayin{\dagesh{’}}
+\def\Fpe{\dagesh{“}} \def\Fpeh{\dagesh{“}} \def\Ffe{\dagesh{“}}
+\def\Ffeh{\dagesh{“}}
+\def\Pe{\dagesh{”}}\def\Peh{\dagesh{”}} \def\Fe{\dagesh{”}}
+\def\Feh{\dagesh{”}}
+\def\Ftzadi{\dagesh{•}} \def\Ftzadik{\dagesh{•}}
+\def\Tzadi{\dagesh{–}} \def\Tzadik{\dagesh{–}}
+\def\Kuf{\dagesh{—}} \def\Koof{\dagesh{—}}
+\def\Resh{\dagesh{˜}}
+\def\Shin{\dagesh{™}} \def\Sin{\dagesh{™}}
+\def\Tav{\dagesh{š}} \def\Taf{\dagesh{š}}
+
+\def\alephlamed{\char124}
+\def\vowelayin{\char123}
+ \ No newline at end of file
diff --git a/language/hebrew/hebtex/macros/tex_macros/null.tex b/language/hebrew/hebtex/macros/tex_macros/null.tex
new file mode 100644
index 0000000000..1b483c1b45
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/null.tex
@@ -0,0 +1,2 @@
+\message{This is the dummy input file `null.tex'}
+ \ No newline at end of file
diff --git a/language/hebrew/hebtex/macros/tex_macros/rotate.tex b/language/hebrew/hebtex/macros/tex_macros/rotate.tex
new file mode 100644
index 0000000000..94b478b21f
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/rotate.tex
@@ -0,0 +1,44 @@
+%
+% These macros allow you to rotate or flip a \TeX\ box. Very useful for
+% sideways tables or upsidedown answers.
+%
+% To use, create a box containing the information you want to rotate.
+% (An hbox or vbox will do.) Now call \rotr\boxnum to rotate the
+% material and create a new box with the appropriate (flipped) dimensions.
+% \rotr rotates right, \rotl rotates left, \rotu turns upside down, and
+% \rotf flips. These boxes may contain other rotated boxes.
+%
+\newdimen\rotdimen
+\def\vspec#1{\special{ps:#1}}% passes #1 verbatim to the output
+\def\rotstart#1{\vspec{gsave currentpoint currentpoint translate
+ #1 neg exch neg exch translate}}% #1 can be any origin-fixing transformation
+\def\rotfinish{\vspec{currentpoint grestore moveto}}% gets back in synch
+%
+% First, the rotation right. The reference point of the rotated box
+% is the lower right corner of the original box.
+%
+\def\rotr#1{\rotdimen=\ht#1\advance\rotdimen by\dp#1%
+ \hbox to\rotdimen{\hskip\ht#1\vbox to\wd#1{\rotstart{90 rotate}%
+ \box#1\vss}\hss}\rotfinish}
+%
+% Next, the rotation left. The reference point of the rotated box
+% is the upper left corner of the original box.
+%
+\def\rotl#1{\rotdimen=\ht#1\advance\rotdimen by\dp#1%
+ \hbox to\rotdimen{\vbox to\wd#1{\vskip\wd#1\rotstart{270 rotate}%
+ \box#1\vss}\hss}\rotfinish}%
+%
+% Upside down is simple. The reference point of the rotated box
+% is the upper right corner of the original box. (The box's height
+% should be the current font's xheight, \fontdimen5\font,
+% if you want that xheight to be at the baseline after rotation.)
+%
+\def\rotu#1{\rotdimen=\ht#1\advance\rotdimen by\dp#1%
+ \hbox to\wd#1{\hskip\wd#1\vbox to\rotdimen{\vskip\rotdimen
+ \rotstart{-1 dup scale}\box#1\vss}\hss}\rotfinish}%
+%
+% And flipped end for end is pretty ysae too. We retain the baseline.
+%
+\def\rotf#1{\hbox to\wd#1{\hskip\wd#1\rotstart{-1 1 scale}%
+ \box#1\hss}\rotfinish}%
+ \ No newline at end of file
diff --git a/language/hebrew/hebtex/macros/tex_macros/rotsample.tex b/language/hebrew/hebtex/macros/tex_macros/rotsample.tex
new file mode 100644
index 0000000000..413f4d89c9
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/rotsample.tex
@@ -0,0 +1,33 @@
+\input rotate
+\newbox\rotbox
+\newbox\rottwo
+%
+\font\big=cmr17 scaled\magstep4
+This is a \setbox\rotbox=\hbox{simple}\rotl\rotbox\ test of
+\setbox\rotbox=\hbox{some}\rotu\rotbox\ rotation primitives that
+\setbox\rotbox=\hbox{\big work}\rotr\rotbox.
+Or maybe \setbox\rotbox=\hbox{\vrule height .2in width .2in}\rotl\rotbox\
+not.
+\bigskip
+\centerline{\vbox{\offinterlineskip
+\def\tablerule{\noalign{\hrule}}
+\def\breather{height 2pt&&&&&&&&&&\cr}
+\def\allfive#1{\breather
+&\global\setbox\rottwo=\hbox{#1}\copy\rottwo&&%
+\setbox\rotbox=\copy\rottwo\rotl\rotbox&&%
+\setbox\rotbox=\copy\rottwo\rotu\rotbox&&%
+\setbox\rotbox=\copy\rottwo\rotr\rotbox&&%
+\rotf\rottwo&\cr
+\breather\tablerule}
+\offinterlineskip
+\halign{\vrule#&\hfil\ #\ \hfil&\vrule#&\hfil\ #\ \hfil&\vrule#&%
+ \hfil\ #\ \hfil&\vrule#&\hfil\ #\ \hfil&\vrule#&\hfil\ #\ \hfil&\vrule#\cr
+\tablerule
+\breather
+&\strut Upside&&Leftside&&Downside&&Rightside&&Flipside&\cr
+\breather\tablerule
+\allfive{gnus}
+\allfive{$-b\pm\sqrt{b^2-4ac}\over2a$}
+\allfive{{\big A}}}}}%
+\bye
+ \ No newline at end of file
diff --git a/language/hebrew/hebtex/macros/tex_macros/testfont.tex b/language/hebrew/hebtex/macros/tex_macros/testfont.tex
new file mode 100644
index 0000000000..544642aae4
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/testfont.tex
@@ -0,0 +1,208 @@
+% A testbed for font evaluation (see The METAFONTbook, Appendix H)
+
+\tracinglostchars=0
+\tolerance=1000
+\raggedbottom
+\nopagenumbers
+\parindent=0pt
+\newlinechar=`@
+\hyphenpenalty=200
+\doublehyphendemerits=30000
+\hyphenation{prom-i-nent}
+
+\newcount\m \newcount\n \newcount\p \newdimen\dim
+\chardef\other=12
+
+\def\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
+ \space\number\day, \number\year}
+\def\hours{\n=\time \divide\n 60
+ \m=-\n \multiply\m 60 \advance\m \time
+ \twodigits\n\twodigits\m}
+\def\twodigits#1{\ifnum #1<10 0\fi \number#1}
+
+\def\init{\message{@Name of the font to test = }
+ \read-1 to\fontname \startfont
+ \message{Now type a test command (\string\help\space for help):}}
+\def\startfont{\font\testfont=\fontname \spaceskip=0pt
+ \leftline{\sevenrm Test of \fontname\unskip\ on \today\ at \hours}
+ \medskip
+ \testfont \setbaselineskip
+ \ifdim\fontdimen6\testfont<10pt \rightskip=0pt plus 20pt
+ \else\rightskip=0pt plus 2em \fi
+ \spaceskip=\fontdimen2\testfont % space between words (\raggedright)
+ \xspaceskip=\fontdimen2\testfont \advance\xspaceskip by\fontdimen7\testfont}
+
+{\catcode`\|=0 \catcode`\\=\other
+|gdef|help{|message{%
+\init switches to another font;@%
+\end or \bye finishes the run;@%
+\table prints the font layout in tabular format;@%
+\text prints a sample text, assuming TeX text font conventions;@%
+\sample combines \table and \text;@%
+\mixture mixes a background character with a series of others;@%
+\alternation interleaves a background character with a series;@%
+\alphabet prints all lowercase letters within a given background;@%
+\ALPHABET prints all uppercase letters within a given background;@%
+\series prints a series of letters within a given background;@%
+\lowers prints a comprehensive test of lowercase;@%
+\uppers prints a comprehensive test of uppercase;@%
+\digits prints a comprehensive test of numerals;@%
+\math prints a comprehensive test of TeX math italic;@%
+\names prints a text that mixes upper and lower case;@%
+\punct prints a punctuation test;@%
+\bigtest combines many of the above routines;@%
+\help repeats this message;@%
+and you can use ordinary TeX commands (e.g., to \input a file).}}}
+
+\def\setbaselineskip{\setbox0=\hbox{\n=0
+\loop\char\n \ifnum \n<255 \advance\n 1 \repeat}
+\baselineskip=6pt \advance\baselineskip\ht0 \advance\baselineskip\dp0 }
+
+\def\setchar#1{{\escapechar-1\message{\string#1 character = }%
+ \def\do##1{\catcode`##1=\other}\dospecials
+ \read-1 to\next
+ \expandafter\finsetchar\next\next#1}}
+\def\finsetchar#1#2\next#3{\global\chardef#3=`#1
+ \ifnum #3=`\# \global\chardef#3=#2 \fi}
+\def\promptthree{\setchar\background
+ \setchar\starting \setchar\ending}
+
+\def\mixture{\promptthree \domix\mixpattern}
+\def\alternation{\promptthree \domix\altpattern}
+\def\mixpattern{\0\1\0\0\1\1\0\0\0\1\1\1\0\1}
+\def\altpattern{\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0}
+\def\domix#1{\par\chardef\0=\background \n=\starting
+ \loop \chardef\1=\n #1\endgraf
+ \ifnum \n<\ending \advance\n 1 \repeat}
+
+\def\!{\discretionary{\background}{\background}{\background}}
+\def\series{\promptthree \!\doseries\starting\ending\par}
+\def\doseries#1#2{\n=#1\loop\char\n\!\ifnum\n<#2\advance\n 1 \repeat}
+\def\complower{\!\doseries{`a}{`z}\doseries{'31}{'34}\par}
+\def\compupper{\!\doseries{`A}{`Z}\doseries{'35}{'37}\par}
+\def\compdigs{\!\doseries{`0}{`9}\par}
+\def\alphabet{\setchar\background\complower}
+\def\ALPHABET{\setchar\background\compupper}
+
+\def\lowers{\docomprehensive\complower{`a}{`z}{'31}{'34}}
+\def\uppers{\docomprehensive\compupper{`A}{`Z}{'35}{'37}}
+\def\digits{\docomprehensive\compdigs{`0}{`4}{`5}{`9}}
+\def\docomprehensive#1#2#3#4#5{\par\chardef\background=#2
+ \loop{#1} \ifnum\background<#3\m=\background\advance\m 1
+ \chardef\background=\m \repeat \chardef\background=#4
+ \loop{#1} \ifnum\background<#5\m=\background\advance\m 1
+ \chardef\background=\m \repeat}
+
+\def\names{ {\AA}ngel\aa\ Beatrice Claire
+ Diana \'Erica Fran\c{c}oise Ginette H\'el\`ene Iris
+ Jackie K\=aren {\L}au\.ra Mar{\'\i}a N\H{a}ta{\l}{\u\i}e {\O}ctave
+ Pauline Qu\^eneau Roxanne Sabine T\~a{\'\j}a Ur\v{s}ula
+ Vivian Wendy Xanthippe Yv{\o}nne Z\"azilie\par}
+\def\punct{\par\dopunct{min}\dopunct{pig}\dopunct{hid}
+ \dopunct{HIE}\dopunct{TIP}\dopunct{fluff}
+ \$1,234.56 + 7/8 = 9\% @ \#0\par}
+\def\dopunct#1{#1,\ #1:\ #1;\ `#1'\ ?`#1?\ !`#1!\ (#1)\ [#1]\ #1*\ #1.\par}
+
+\def\bigtest{\sample
+ hamburgefonstiv HAMBURGEFONSTIV\par
+ \names \punct \lowers \uppers \digits}
+
+\def\math{\textfont1=\testfont \skewchar\testfont=\skewtrial
+ \mathchardef\Gamma="100 \mathchardef\Delta="101
+ \mathchardef\Theta="102 \mathchardef\Lambda="103 \mathchardef\Xi="104
+ \mathchardef\Pi="105 \mathchardef\Sigma="106 \mathchardef\Upsilon="107
+ \mathchardef\Phi="108 \mathchardef\Psi="109 \mathchardef\Omega="10A
+ \def\ii{i} \def\jj{j}
+ \def\\##1{|##1|+}\mathtrial
+ \def\\##1{##1_2+}\mathtrial
+ \def\\##1{##1^2+}\mathtrial
+ \def\\##1{##1/2+}\mathtrial
+ \def\\##1{2/##1+}\mathtrial
+ \def\\##1{##1,{}+}\mathtrial
+ \def\\##1{d##1+}\mathtrial
+ \let\ii=\imath \let\jj=\jmath \def\\##1{\hat##1+}\mathtrial}
+\newcount\skewtrial \skewtrial='177
+\def\mathtrial{$\\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 \\a \\b \\c \\d \\e \\f \\g
+ \\h \\\ii \\\jj \\k \\l \\m \\n \\o \\p \\q \\r \\s \\t \\u \\v \\w \\x \\y
+ \\z \\\alpha \\\beta \\\gamma \\\delta \\\epsilon \\\zeta \\\eta \\\theta
+ \\\iota \\\kappa \\\lambda \\\mu \\\nu \\\xi \\\pi \\\rho \\\sigma \\\tau
+ \\\upsilon \\\phi \\\chi \\\psi \\\omega \\\vartheta \\\varpi \\\varphi
+ \\\Gamma \\\Delta \\\Theta \\\Lambda \\\Xi \\\Pi \\\Sigma \\\Upsilon
+ \\\Phi \\\Psi \\\Omega \\\partial \\\ell \\\wp$\par}
+\def\mathsy{\begingroup\skewtrial='060 % for math symbol font tests
+ \def\mathtrial{$\\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$\par}
+ \math\endgroup}
+
+\def\oct#1{\hbox{\rm\'{}\kern-.2em\it#1\/\kern.05em}} % octal constant
+\def\hex#1{\hbox{\rm\H{}\tt#1}} % hexadecimal constant
+\def\setdigs#1"#2{\gdef\h{#2}% \h=hex prefix; \0\1=corresponding octal
+ \m=\n \divide\m by 64 \xdef\0{\the\m}%
+ \multiply\m by-64 \advance\m by\n \divide\m by 8 \xdef\1{\the\m}}
+\def\testrow{\setbox0=\hbox{\penalty 1\def\\{\char"\h}%
+ \\0\\1\\2\\3\\4\\5\\6\\7\\8\\9\\A\\B\\C\\D\\E\\F%
+ \global\p=\lastpenalty}} % \p=1 if none of the characters exist
+\def\oddline{\cr
+ \noalign{\nointerlineskip}
+ \multispan{19}\hrulefill&
+ \setbox0=\hbox{\lower 2.3pt\hbox{\hex{\h x}}}\smash{\box0}\cr
+ \noalign{\nointerlineskip}}
+\newif\ifskipping
+\def\evenline{\loop\skippingfalse
+ \ifnum\n<256 \m=\n \divide\m 16 \chardef\next=\m
+ \expandafter\setdigs\meaning\next \testrow
+ \ifnum\p=1 \skippingtrue \fi\fi
+ \ifskipping \global\advance\n 16 \repeat
+ \ifnum\n=256 \let\next=\endchart\else\let\next=\morechart\fi
+ \next}
+\def\morechart{\cr\noalign{\hrule\penalty5000}
+ \chartline \oddline \m=\1 \advance\m 1 \xdef\1{\the\m}
+ \chartline \evenline}
+\def\chartline{&\oct{\0\1x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&}
+\def\chartstrut{\lower4.5pt\vbox to14pt{}}
+\def\table{$$\global\n=0
+ \halign to\hsize\bgroup
+ \chartstrut##\tabskip0pt plus10pt&
+ &\hfil##\hfil&\vrule##\cr
+ \lower6.5pt\null
+ &&&\oct0&&\oct1&&\oct2&&\oct3&&\oct4&&\oct5&&\oct6&&\oct7&\evenline}
+\def\endchart{\cr\noalign{\hrule}
+ \raise11.5pt\null&&&\hex 8&&\hex 9&&\hex A&&\hex B&
+ &\hex C&&\hex D&&\hex E&&\hex F&\cr\egroup$$\par}
+\def\:{\setbox0=\hbox{\char\n}%
+ \ifdim\ht0>7.5pt\reposition
+ \else\ifdim\dp0>2.5pt\reposition\fi\fi
+ \box0\global\advance\n 1 }
+\def\reposition{\setbox0=\vbox{\kern2pt\box0}\dim=\dp0
+ \advance\dim 2pt \dp0=\dim}
+\def\centerlargechars{
+ \def\reposition{\setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}}
+
+\def\text{{\advance\baselineskip-4pt
+\setbox0=\hbox{abcdefghijklmnopqrstuvwxyz}
+\ifdim\hsize>2\wd0 \ifdim 15pc>2\wd0 \hsize=15pc \else \hsize=2\wd0 \fi\fi
+On November 14, 1885, Senator \& Mrs.~Leland Stanford called
+together at their San Francisco mansion the 24~prominent men who had
+been chosen as the first trustees of The Leland Stanford Junior University.
+They handed to the board the Founding Grant of the University, which they
+had executed three days before. This document---with various amendments,
+legislative acts, and court decrees---remains as the University's charter.
+In bold, sweeping language it stipulates that the objectives of the University
+are ``to qualify students for personal success and direct usefulness in life;
+and to promote the publick welfare by exercising an influence in behalf of
+humanity and civilization, teaching the blessings of liberty regulated by
+law, and inculcating love and reverence for the great principles of
+government as derived from the inalienable rights of man to life, liberty,
+and the pursuit of happiness.'' \moretext
+(!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!)\par}}
+\def\moretext{?`But aren't Kafka's Schlo{\ss} and {\AE}sop's {\OE}uvres
+often na{\"\i}ve vis-\`a-vis the d{\ae}monic ph{\oe}nix's official r\^ole
+in fluffy souffl\'es? }
+\def\omitaccents{\let\moretext=\relax}
+
+\def\sample{\table\text}
+
+\ifx\noinit!\else\init\fi
diff --git a/language/hebrew/hebtex/macros/tex_macros/verbatim.tex b/language/hebrew/hebtex/macros/tex_macros/verbatim.tex
new file mode 100644
index 0000000000..e923636738
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/verbatim.tex
@@ -0,0 +1,42 @@
+%
+% S_Verbatim.TeX Macro
+%
+% macros for verbatim scanning
+\chardef\other=12
+\newskip\ttglue
+\ttglue=.5em plus.25em minus.15em
+\def\ttverbatim{\begingroup
+ \catcode`\\=\other
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\$=\other
+ \catcode`\&=\other
+ \catcode`\#=\other
+ \catcode`\%=\other
+ \catcode`\_=\other
+ \catcode`\^=\other
+ \catcode`\"=\other % this line is new stuff
+ \catcode`\|=\other
+ \catcode`\~=\other
+ \obeyspaces \obeylines \tt}
+
+\catcode`\"=\active
+
+\def"{\ttverbatim\continueverbatim}
+\def\continueverbatim#1{\spaceskip\ttglue
+\def\readit##1#1{##1\endgroup}\expandafter\readit}
+%
+% verbatim input macro, for inputting a complete file verbatim.
+% Use \verbatiminput{filename} in much the same way as you would use
+% \input filename.
+%
+\def^^L{\par}
+ \def\verbatiminput#1{\begingroup \frenchspacing \raggedbottom
+ \def\do##1{\catcode`##1=12 } \dospecials \catcode`\|=12
+ \parskip 0pt \parindent 0pt
+ \catcode`\ =\active \catcode`\^^M=\active
+ \catcode`\^^L=\active \outer\def^^L{\eject}
+ \tt \def\par{\ \endgraf} \obeylines \obeyspaces
+ \input #1 \endgroup}
+%
+ \ No newline at end of file
diff --git a/language/hebrew/hebtex/macros/tex_macros/vowels.tex b/language/hebrew/hebtex/macros/tex_macros/vowels.tex
new file mode 100644
index 0000000000..07b8a57017
--- /dev/null
+++ b/language/hebrew/hebtex/macros/tex_macros/vowels.tex
@@ -0,0 +1,71 @@
+%(c) 1990,91 by Joel M. Hoffman belongs to hcaption, hclassic.
+%vowels.tex. Version 1.0.
+%updated 5/13/91 by JMH
+
+%Use of this material in a commercial venture of any sort requires
+%permission from me. Otherwise, you are free to use this for any
+%legal, non-destructive purpose. If you find this useful, a
+%contribution to charity will be most appreciated.
+
+%This file provides the following commands:
+% \patach{ let } % These are the basic vowel-commands. Each
+% \kamatz{ let } % puts a vowel under the letter _let_. Each
+% \segol{ let } % also has a corresponding \chatafxxxxxx
+% \kibutz{ let } % command (e.g., \chatafpatach) for a chataf-
+% \chiriq{ let } % vowel -- even when the vowel doesn't exist.
+% \kamatzkatan{ let } % (There's a \chatafchiriq.) Additionally,
+% \shva{ let } % each has a capitalized version (\Patach, etc.)
+% \meteg{ let } % which puts a meteg with the vowel. There
+% \tzere{ let } % is no way to put a meteg with a chataf-vowel.
+
+%All of the above use the general \hvowel macro, which puts a vowel under
+%any letter. \hvowel automatically adjusts the vowel for certain letters
+%(_resh_ and _daled_ require a horizontal adjustment, _final chaf_ a
+%veritcal one.), and repalces \ayin with \vowelayin (which doesn't
+%descend). Unfortunately, \Daled (a \daled with a _dagesh_) isn't yet
+%handled correctly.
+
+%BITNET: hoffman@nyuacf.BITNET <-- this will change soon
+%CompuServe: 72700,402 -or- 72700.402@compuserve.com
+%SNAIL: Joel M. Hoffman
+% 19 Hillcrest Lane
+% Rye, NY 10580
+% U.S.A.
+
+
+%usage: \hvowel{letter}{vowel(s)}
+\def\hvowel#1#2{\def\l{#1}% \def was \let
+\def\hadjust{0}\def\vadjust{0}%
+\if\l\ayin \let\l=\vowelayin\fi%
+\if\l\fchaf \def\vadjust{.75}\fi%
+\if\l\resh \def\hadjust{.2}\fi%
+\if\l\daled \def\hadjust{.2}\fi%
+\if\l\koof \def\hadjust{.1}\fi%
+\hbox{\setbox0=\hbox{\l}%
+\setbox1=\hbox to \wd0{\hss #2\hss}%
+\kern\hadjust\wd0\raise\vadjust\ht0\box1\kern-\hadjust\wd0\kern-\wd0\box0}}
+
+\def\patach#1{\hvowel#1{\char001}}
+\def\kamatz#1{\hvowel#1{\char002}}
+\def\segol#1{\hvowel{#1}{\char003}}
+\def\kibutz#1{\hvowel{#1}{\char004}}
+\def\chiriq#1{\hvowel{#1}{\char005}}
+\def\kamatzkatan#1{\hvowel{#1}{\char006}}
+\def\shva#1{\hvowel{#1}{\char007}}
+\def\meteg#1{\hvowel{#1}{\char008}}
+\def\tzere#1{\hvowel{#1}{\char009}}
+\def\chatafpatach#1{\hvowel{#1}{\hbox{\char001\char007}}}
+\def\chatafkamatz#1{\hvowel{#1}{\hbox{\char002\char007}}}
+\def\chatafsegol#1{\hvowel{#1}{\hbox{\char003\char007}}}
+\def\chatafkibutz#1{\hvowel{#1}{\hbox{\char004\char007}}}
+\def\chatafhiriq#1{\hvowel{#1}{\hbox{\char00\char0075}}}%this doesn't exist!
+\def\chatafkamatzkatan#1{\hvowel{#1}{\hbox{\char006\char007}}}
+\def\Patach#1{\hvowel{#1}{\hbox{\char008\char001}}}
+\def\Kamatz#1{\hvowel{#1}{\hbox{\char008\char002}}}
+\def\Segol#1{\hvowel{#1}{\hbox{\char008\char003}}}
+\def\Kibutz#1{\hvowel{#1}{\hbox{\char008\char004}}}
+\def\Chiriq#1{\hvowel{#1}{\hbox{\char008\char005}}}
+\def\Kamatzkatan#1{\hvowel{#1}{\hbox{\char008\char006}}}
+\def\Tzere#1{\hvowel{#1}{\hbox{\char008\char009}}}
+
+