1 % \iffalse meta-comment
3 % Copyright 1989-2005 Johannes L. Braams and any individual authors
4 % listed elsewhere in this file. All rights reserved.
6 % This file is part of the Babel system.
7 % --------------------------------------
9 % It may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of LaTeX
15 % version 2003/12/01 or later.
17 % This work has the LPPL maintenance status "maintained".
19 % The Current Maintainer of this work is Johannes Braams.
21 % The list of all files belonging to the Babel system is
22 % given in the file `manifest.bbl. See also `legal.bbl' for additional
25 % The list of derived (unpacked) files belonging to the distribution
26 % and covered by LPPL is defined by the unpacking scripts (with
27 % extension .ins) which are part of the distribution.
32 %<si960> \ProvidesFile{si960.def}
33 %<8859-8> \ProvidesFile{8859-8.def}
34 %<cp862> \ProvidesFile{cp862.def}
35 %<cp1255> \ProvidesFile{cp1255.def}
37 \ProvidesFile{hebinp.drv}
40 % \ProvidesFile{hebinp.dtx}
41 [2004/02/20 v1.1b Hebrew input encoding file]
42 % \iffalse meta-comment
43 %% File `hebinp.dtx' for installing the input hebrew encodings.
44 %% Copyright (C) 1997 -- 2005 Boris Lavva.
46 %% Babel package for LaTeX version 2e
47 %% Copyright (C) 1989 -- 2005 by Johannes Braams,
49 %% All rights reserved.
52 % \providecommand\dst{\textsc{docstrip}}
53 % \GetFileInfo{hebinp.dtx}
55 % \changes{hebinp~1.0a}{1997/12/07}{%
56 % Initial version. Provides 8859-8, cp862, cp1255, and old 7-bit
57 % input encodings (by Boris Lavva)}
58 % \changes{hebinp~1.1}{2001/02/27}{%
59 % Renamed hebrew letters: \cs{alef} to \cs{hebalef} etc.
61 % \changes{hebinp~1.1a}{2001/07/22}{%
62 % Renamed CP1255 nikud \cs{patah} to \cs{hebpatah etc}.
63 % Added the macro \cs{DisableNikud} - may not be a good idea
66 % \section{Hebrew input encodings}\label{sec:hebinp}
68 % Hebrew input encodings defined in file |hebinp.dtx|\footnote{The
69 % files described in this section have version number \fileversion\
70 % and were last revised on \filedate.} should be used with |inputenc|
71 % \LaTeXe{} package. This package allows the user
72 % to specify an input encoding from this file (for example, ISO
73 % Hebrew/Latin 8859-8, IBM Hebrew codepage 862 or MS Windows
74 % Hebrew codepage 1255) by saying:
76 % |\usepackage[|\emph{encoding name}|]{inputenc}|
78 % The encoding can also be selected in the document with:
80 % |\inputencoding{|\emph{encoding name}|}|
82 % The only practical use of this command within a document is when
83 % using text from several documents to build up a composite work such
84 % as a volume of journal articles. Therefore this command will be
85 % used only in vertical mode.
87 % The encodings provided by this package are:
89 % \item |si960| 7-bit Hebrew encoding for the range 32--127. This
90 % encoding also known as ``old-code'' and defined by Israeli
92 % \item |8859-8| ISO 8859-8 Hebrew/Latin encoding commonly used in
93 % UNIX systems. This encoding also known as ``new-code'' and
94 % includes hebrew letters in positions starting from 224.
95 % \item |cp862| IBM 862 code page commonly used by DOS on
96 % IBM-compatible personal computers. This encoding also known as
97 % ``pc-code'' and includes hebrew letters in positions starting
99 % \item |cp1255| MS Windows 1255 (hebrew) code page which is similar to
100 % 8859-8. In addition to hebrew letters, this encoding contains
101 % also hebrew vowels and dots (nikud).
103 % Each encoding has an associated |.def| file, for example
104 % |8859-8.def| which defines the behaviour of each input character,
105 % using the commands:
107 % |\DeclareInputText{|\emph{slot}|}{|\emph{text}|}| \\
108 % |\DeclareInputMath{|\emph{slot}|}{|\emph{math}|}|
110 % This defines the input character \emph{slot} to be the
111 % \emph{text} material or \emph{math} material respectively.
112 % For example, |8859-8.def| defines slots |"EA| (letter hebalef)
113 % and |"B5| ($\mu$) by saying:
115 % \DeclareInputText{224}{\hebalef}
116 % \DeclareInputMath{181}{\mu}
118 % Note that the \emph{commands} should be robust, and should not be
119 % dependent on the output encoding. The same \emph{slot} should not
120 % have both a text and a math declaration for it. (This restriction
121 % may be removed in future releases of inputenc).
123 % The |.def| file may also define commands using the declarations:\\
124 % |\providecommand| or |\ProvideTextCommandDefault|.
125 % For example, |8859-8.def| defines:
127 % \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
128 % \DeclareInputText{188}{\textonequarter}
130 % The use of the `provide' forms here will ensure that a
131 % better definition will not be over-written; their use is
132 % recommended since, in general, the best defintion depends on the
135 % See the documentation in |inputenc.dtx| for details of how to
136 % declare input definitions for various encodings.
141 % \subsection{A driver for this document}
143 % The next bit of code contains the documentation driver file for
144 % \TeX{}, i.e., the file that will produce the documentation you
145 % are currently reading. It will be extracted from this file by
146 % the \dst{} program.
150 \documentclass{ltxdoc}
151 \title{Hebrew input encodings for use with \LaTeXe}
153 \date{Printed \today}
156 \DocInput{hebinp.dtx}
162 % \subsection{Default definitions for characters}
164 % First, we insert a |\makeatletter| at the beginning of all |.def|
165 % files to use |@| symbol in the macros' names.
167 %<-driver>\makeatletter
170 % Some input characters map to internal functions which are not in
171 % either the |T1| or |OT1| font encoding. For this reason default
172 % definitions are provided in the encoding file: these will be
173 % used unless some other output encoding is used which supports
174 % those glyphs. In some cases this default defintion has to be
175 % simply an error message.
177 % Note that this works reasonably well only because the encoding
178 % files for both |OT1| and |T1| are loaded in the standard LaTeX
182 %<*8859-8|cp862|cp1255>
183 \ProvideTextCommandDefault{\textdegree}{\ensuremath{{^\circ}}}
184 \ProvideTextCommandDefault{\textonehalf}{\ensuremath{\frac12}}
185 \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
186 %</8859-8|cp862|cp1255>
188 \ProvideTextCommandDefault{\textthreequarters}{\ensuremath{\frac34}}
191 \ProvideTextCommandDefault{\textflorin}{\textit{f}}
194 \ProvideTextCommandDefault{\textpeseta}{Pt}
198 % The name |\textblacksquare| is derived from the AMS symbol name
199 % since Adobe seem not to want this symbol. The default
200 % definition, as a rule, makes no claim to being a good design.
203 \ProvideTextCommandDefault{\textblacksquare}
204 {\vrule \@width .3em \@height .4em \@depth -.1em\relax}
208 % Some commands can't be faked, so we have them generate an error
211 %<*8859-8|cp862|cp1255>
212 \ProvideTextCommandDefault{\textcent}
213 {\TextSymbolUnavailable\textcent}
214 \ProvideTextCommandDefault{\textyen}
215 {\TextSymbolUnavailable\textyen}
216 %</8859-8|cp862|cp1255>
218 \ProvideTextCommandDefault{\textcurrency}
219 {\TextSymbolUnavailable\textcurrency}
222 \ProvideTextCommandDefault{\newsheqel}
223 {\TextSymbolUnavailable\newsheqel}
226 \ProvideTextCommandDefault{\textbrokenbar}
227 {\TextSymbolUnavailable\textbrokenbar}
230 \ProvideTextCommandDefault{\textperthousand}
231 {\TextSymbolUnavailable\textperthousand}
235 % Characters that are supposed to be used only in math will be defined
236 % by |\providecommand| because \LaTeXe{} assumes that the font
237 % encoding for math fonts is static.
240 \providecommand{\mathonesuperior}{{^1}}
241 \providecommand{\maththreesuperior}{{^3}}
243 %<*8859-8|cp862|cp1255>
244 \providecommand{\mathtwosuperior}{{^2}}
245 %</8859-8|cp862|cp1255>
247 \providecommand{\mathordmasculine}{{^o}}
248 \providecommand{\mathordfeminine}{{^a}}
252 % \subsection{The SI-960 encoding}
254 %% The SI-960 or ``old-code'' encoding only allows characters in the
255 %% range 32--127, so we only need to provide an empty |si960.def| file.
257 % \subsection{The ISO 8859-8 encoding and the MS Windows cp1255 encoding}
259 % The |8859-8.def| encoding file defines the characters in the ISO
262 % The MS Windows Hebrew character set incorporates the Hebrew
263 % letter repertoire of ISO 8859-8, and uses the same code points
264 % (starting from 224). It has also some important additions in the
265 % 128--159 and 190--224 ranges.
269 \DeclareInputText{130}{\quotesinglbase}
270 \DeclareInputText{131}{\textflorin}
271 \DeclareInputText{132}{\quotedblbase}
272 \DeclareInputText{133}{\dots}
273 \DeclareInputText{134}{\dag}
274 \DeclareInputText{135}{\ddag}
275 \DeclareInputText{136}{\^{}}
276 \DeclareInputText{137}{\textperthousand}
277 \DeclareInputText{139}{\guilsinglleft}
278 \DeclareInputText{145}{\textquoteleft}
279 \DeclareInputText{146}{\textquoteright}
280 \DeclareInputText{147}{\textquotedblleft}
281 \DeclareInputText{148}{\textquotedblright}
282 \DeclareInputText{149}{\textbullet}
283 \DeclareInputText{150}{\textendash}
284 \DeclareInputText{151}{\textemdash}
285 \DeclareInputText{152}{\~{}}
286 \DeclareInputText{153}{\texttrademark}
287 \DeclareInputText{155}{\guilsinglright}
293 \DeclareInputText{160}{\nobreakspace}
294 \DeclareInputText{162}{\textcent}
295 \DeclareInputText{163}{\pounds}
296 %<+8859-8>\DeclareInputText{164}{\textcurrency}
297 %<+cp1255>\DeclareInputText{164}{\newsheqel}
298 \DeclareInputText{165}{\textyen}
299 \DeclareInputText{166}{\textbrokenbar}
300 \DeclareInputText{167}{\S}
301 \DeclareInputText{168}{\"{}}
302 \DeclareInputText{169}{\textcopyright}
303 %<+8859-8>\DeclareInputMath{170}{\times}
304 \DeclareInputText{171}{\guillemotleft}
305 \DeclareInputMath{172}{\lnot}
306 \DeclareInputText{173}{\-}
307 \DeclareInputText{174}{\textregistered}
308 \DeclareInputText{175}{\@tabacckludge={}}
309 \DeclareInputText{176}{\textdegree}
310 \DeclareInputMath{177}{\pm}
311 \DeclareInputMath{178}{\mathtwosuperior}
312 \DeclareInputMath{179}{\maththreesuperior}
313 \DeclareInputText{180}{\@tabacckludge'{}}
314 \DeclareInputMath{181}{\mu}
315 \DeclareInputText{182}{\P}
316 \DeclareInputText{183}{\textperiodcentered}
317 %<+8859-8>\DeclareInputText{184}{\c\ }
318 \DeclareInputMath{185}{\mathonesuperior}
319 %<+8859-8>\DeclareInputMath{186}{\div}
320 \DeclareInputText{187}{\guillemotright}
321 \DeclareInputText{188}{\textonequarter}
322 \DeclareInputText{189}{\textonehalf}
323 \DeclareInputText{190}{\textthreequarters}
327 % Hebrew vowels and dots (nikud) are included only to MS Windows cp1255
328 % page and start from the position 192.
331 \DeclareInputText{192}{\hebsheva}
332 \DeclareInputText{193}{\hebhatafsegol}
333 \DeclareInputText{194}{\hebhatafpatah}
334 \DeclareInputText{195}{\hebhatafqamats}
335 \DeclareInputText{196}{\hebhiriq}
336 \DeclareInputText{197}{\hebtsere}
337 \DeclareInputText{198}{\hebsegol}
338 \DeclareInputText{199}{\hebpatah}
339 \DeclareInputText{200}{\hebqamats}
340 \DeclareInputText{201}{\hebholam}
341 \DeclareInputText{203}{\hebqubuts}
342 \DeclareInputText{204}{\hebdagesh}
343 \DeclareInputText{205}{\hebmeteg}
344 \DeclareInputText{206}{\hebmaqaf}
345 \DeclareInputText{207}{\hebrafe}
346 \DeclareInputText{208}{\hebpaseq}
347 \DeclareInputText{209}{\hebshindot}
348 \DeclareInputText{210}{\hebsindot}
349 \DeclareInputText{211}{\hebsofpasuq}
350 \DeclareInputText{212}{\hebdoublevav}
351 \DeclareInputText{213}{\hebvavyod}
352 \DeclareInputText{214}{\hebdoubleyod}
356 % Hebrew letters start from the position 224 in both encodings.
359 \DeclareInputText{224}{\hebalef}
360 \DeclareInputText{225}{\hebbet}
361 \DeclareInputText{226}{\hebgimel}
362 \DeclareInputText{227}{\hebdalet}
363 \DeclareInputText{228}{\hebhe}
364 \DeclareInputText{229}{\hebvav}
365 \DeclareInputText{230}{\hebzayin}
366 \DeclareInputText{231}{\hebhet}
367 \DeclareInputText{232}{\hebtet}
368 \DeclareInputText{233}{\hebyod}
369 \DeclareInputText{234}{\hebfinalkaf}
370 \DeclareInputText{235}{\hebkaf}
371 \DeclareInputText{236}{\heblamed}
372 \DeclareInputText{237}{\hebfinalmem}
373 \DeclareInputText{238}{\hebmem}
374 \DeclareInputText{239}{\hebfinalnun}
375 \DeclareInputText{240}{\hebnun}
376 \DeclareInputText{241}{\hebsamekh}
377 \DeclareInputText{242}{\hebayin}
378 \DeclareInputText{243}{\hebfinalpe}
379 \DeclareInputText{244}{\hebpe}
380 \DeclareInputText{245}{\hebfinaltsadi}
381 \DeclareInputText{246}{\hebtsadi}
382 \DeclareInputText{247}{\hebqof}
383 \DeclareInputText{248}{\hebresh}
384 \DeclareInputText{249}{\hebshin}
385 \DeclareInputText{250}{\hebtav}
389 % Special symbols which define the direction of symbols explicitly.
390 % Currently, they are not used in \LaTeX.
393 \DeclareInputText{253}{\lefttorightmark}
394 \DeclareInputText{254}{\righttoleftmark}
398 % \subsection{The IBM code page 862}
400 % The |cp862.def| encoding file defines the characters in the IBM
401 % codepage 862 encoding. The DOS graphics `letters' and a few
402 % other positions are ignored (left undefined).
404 % Hebrew letters start from the position 128.
407 \DeclareInputText{128}{\hebalef}
408 \DeclareInputText{129}{\hebbet}
409 \DeclareInputText{130}{\hebgimel}
410 \DeclareInputText{131}{\hebdalet}
411 \DeclareInputText{132}{\hebhe}
412 \DeclareInputText{133}{\hebvav}
413 \DeclareInputText{134}{\hebzayin}
414 \DeclareInputText{135}{\hebhet}
415 \DeclareInputText{136}{\hebtet}
416 \DeclareInputText{137}{\hebyod}
417 \DeclareInputText{138}{\hebfinalkaf}
418 \DeclareInputText{139}{\hebkaf}
419 \DeclareInputText{140}{\heblamed}
420 \DeclareInputText{141}{\hebfinalmem}
421 \DeclareInputText{142}{\hebmem}
422 \DeclareInputText{143}{\hebfinalnun}
423 \DeclareInputText{144}{\hebnun}
424 \DeclareInputText{145}{\hebsamekh}
425 \DeclareInputText{146}{\hebayin}
426 \DeclareInputText{147}{\hebfinalpe}
427 \DeclareInputText{148}{\hebpe}
428 \DeclareInputText{149}{\hebfinaltsadi}
429 \DeclareInputText{150}{\hebtsadi}
430 \DeclareInputText{151}{\hebqof}
431 \DeclareInputText{152}{\hebresh}
432 \DeclareInputText{153}{\hebshin}
433 \DeclareInputText{154}{\hebtav}
437 \DeclareInputText{155}{\textcent}
438 \DeclareInputText{156}{\pounds}
439 \DeclareInputText{157}{\textyen}
440 \DeclareInputText{158}{\textpeseta}
441 \DeclareInputText{159}{\textflorin}
442 \DeclareInputText{160}{\@tabacckludge'a}
443 \DeclareInputText{161}{\@tabacckludge'\i}
444 \DeclareInputText{162}{\@tabacckludge'o}
445 \DeclareInputText{163}{\@tabacckludge'u}
446 \DeclareInputText{164}{\~n}
447 \DeclareInputText{165}{\~N}
448 \DeclareInputMath{166}{\mathordfeminine}
449 \DeclareInputMath{167}{\mathordmasculine}
450 \DeclareInputText{168}{\textquestiondown}
451 \DeclareInputMath{170}{\lnot}
452 \DeclareInputText{171}{\textonehalf}
453 \DeclareInputText{172}{\textonequarter}
454 \DeclareInputText{173}{\textexclamdown}
455 \DeclareInputText{174}{\guillemotleft}
456 \DeclareInputText{175}{\guillemotright}
460 \DeclareInputMath{224}{\alpha}
461 \DeclareInputText{225}{\ss}
462 \DeclareInputMath{226}{\Gamma}
463 \DeclareInputMath{227}{\pi}
464 \DeclareInputMath{228}{\Sigma}
465 \DeclareInputMath{229}{\sigma}
466 \DeclareInputMath{230}{\mu}
467 \DeclareInputMath{231}{\tau}
468 \DeclareInputMath{232}{\Phi}
469 \DeclareInputMath{233}{\Theta}
470 \DeclareInputMath{234}{\Omega}
471 \DeclareInputMath{235}{\delta}
472 \DeclareInputMath{236}{\infty}
473 \DeclareInputMath{237}{\phi}
474 \DeclareInputMath{238}{\varepsilon}
475 \DeclareInputMath{239}{\cap}
476 \DeclareInputMath{240}{\equiv}
477 \DeclareInputMath{241}{\pm}
478 \DeclareInputMath{242}{\ge}
479 \DeclareInputMath{243}{\le}
480 \DeclareInputMath{246}{\div}
481 \DeclareInputMath{247}{\approx}
482 \DeclareInputText{248}{\textdegree}
483 \DeclareInputText{249}{\textperiodcentered}
484 \DeclareInputText{250}{\textbullet}
485 \DeclareInputMath{251}{\surd}
486 \DeclareInputMath{252}{\mathnsuperior}
487 \DeclareInputMath{253}{\mathtwosuperior}
488 \DeclareInputText{254}{\textblacksquare}
489 \DeclareInputText{255}{\nobreakspace}
493 % \begin{macro}{\DisableNikud}
494 % A utility macro to ignore any nikud character that may appear in the
495 % input. This allows you to ignore cp1255 nikud characters that happened to
496 % appear in the input.
500 \newcommand{\DisableNikud}{%
501 \DeclareInputText{192}{}%
502 \DeclareInputText{193}{}%
503 \DeclareInputText{194}{}%
504 \DeclareInputText{195}{}%
505 \DeclareInputText{196}{}%
506 \DeclareInputText{197}{}%
507 \DeclareInputText{198}{}%
508 \DeclareInputText{199}{}%
509 \DeclareInputText{200}{}%
510 \DeclareInputText{201}{}%
511 \DeclareInputText{203}{}%
512 \DeclareInputText{204}{}%
513 \DeclareInputText{205}{}%
514 \DeclareInputText{206}{}%
515 \DeclareInputText{207}{}%
516 \DeclareInputText{208}{}%
517 \DeclareInputText{209}{}%
518 \DeclareInputText{210}{}%
519 \DeclareInputText{211}{}%
520 \DeclareInputText{212}{}%
521 \DeclareInputText{213}{}%
522 \DeclareInputText{214}{}%
527 % Finally, we reset the category code of the |@| sign at the end of
530 %<-driver>\makeatother
536 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
537 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
538 %% Digits \0\1\2\3\4\5\6\7\8\9
539 %% Exclamation \! Double quote \" Hash (number) \#
540 %% Dollar \$ Percent \% Ampersand \&
541 %% Acute accent \' Left paren \( Right paren \)
542 %% Asterisk \* Plus \+ Comma \,
543 %% Minus \- Point \. Solidus \/
544 %% Colon \: Semicolon \; Less than \<
545 %% Equals \= Greater than \> Question mark \?
546 %% Commercial at \@ Left bracket \[ Backslash \\
547 %% Right bracket \] Circumflex \^ Underscore \_
548 %% Grave accent \` Left brace \{ Vertical bar \|
549 %% Right brace \} Tilde \~}