This question is concerned about writing a non-english document in LaTeX.
I compile my Hebrew document with pdfLaTeX. I know, XeLaTex
or LuaLaTeX
with the polyglossia
package are Unicode engines, and are the recommended engines for non-Latin scripts. But I decided to stick to pdfLaTeX
for its other useful features.
As I learned here, one can declare the Hebrew glyphs in the preamble, thus defining behavior for Unicode characters:
\documentclass{article}
\usepackage[T1]{fontenc} % Specifies which font encoding LATEX should
% use, (8-bit encoding (T1))
\usepackage[utf8]{inputenc} % Translate various standard and other
% input encodings into a ‘LaTeX internal language‘
\usepackage{culmus} % Hebrew fonts from the Culmus project
\usepackage[main=english, hebrew]{babel} % Multilingual support,
% typographical (and other) rules
\pdfmapfile{=culmus.map} % pdflatex now reads the file culmus.map,
% which tells pdflatex how to get the font into the output file
%% Declarations %%
\DeclareUnicodeCharacter{05D0}{\hebalef}
\DeclareUnicodeCharacter{05D1}{\hebbet}
\DeclareUnicodeCharacter{05D2}{\hebgimel}
% and so on, up to
\DeclareUnicodeCharacter{05EA}{\hebtav}
%% Document %%
\begin{document}
כיתוב בעברית
\end{document}
Now comes my question: I want to write down these 27 declarations in a separate file (probably a .sty
or a .def
file?) so as to make my preamble cleaner.
What is the correct way to do that?
What command should I pass to my latexmkrc
file so that pdfLaTeX
searches there for the declarations list?
Does the inputenx
package can do this for me? If yes, then what argument should I pass to \usepackage[...]{inputenx}
?
Any suggestion or help would be much appreciated.
.sty
file.lheenc.dfu
. Then it will be loaded automatically. If it is complete you could upload to ctan. Put it in a texmf tree e.g. in tex/latex/hebrew-unicode.