Go to page:

Search:

Help

Edit

LyX /

# HebrewOnLinux

Categories: Linux, Hebrew
<< | Page list | >>

Hebrew, LyX and Linux can work together.

### Pop!_OS 19.10

 [Added by Yitzchak Schwarz <s.y.schwarz@gmail.com> on 8 Jan 2020]


Here's what I did on Pop!_OS 19.10 to get Hebrew working as expected:

I installed LyX and texlive-full from the repositories and culmus-latex-0.7

In Tools->Preferences->Editing I set it to use keyboard map with null as primary and hebrew as secondary
In Tools->Preferences->File Formats->"Default Output Formats"->"With TeX Fonts" I set to "PDF (pdflatex)"

In Document->Settings->Fonts:
I don't use non-TeX fonts (leave it on the default: TeX fonts)
For the Roman, Sans Serif, Typewriter fonts I set them all to Latin Modern fonts because I found through trial and error that they work, though some others might work too. Math I left on automatic.

Since I like to use sans fonts for everything, I set Default family to Sans Serif.

Of course I saved all of the changes I made in Document->Settings as Document Defaults.

In order to be able to render my LyX document that I previously created with a different configuration all I had to do was change the fonts.

It's also important to note that I need to switch back to the non-Hebrew keyboard layout before creating a math closure to prevent strange artifacts from appearing at the beginning of the math closure when exporting to PDF.

### Ubuntu 18.04

 [Added by Yuri Chernyavsky <yurac777@gmail.com> on 19 Sep 2018]


Here is a script that enables hebrew for me. Only need to install fonts from culmus-latex package and set HE8 as the encoding.

 #!/bin/sh

dTEXMFLOCAL="$(kpsewhich -var-value TEXMFLOCAL)" mkdir -p "/tmp/HebrewFonts" && cd "/tmp/HebrewFonts" && wget https://sourceforge.net/projects/ivritex/files/culmus-latex/culmus-latex-0.7/culmus-latex-0.7-r1.tar.gz/download -O culmus-latex-0.7-r1.tar.gz && tar -xvzf culmus-latex-0.7-r1.tar.gz && cd culmus-latex-0.7-r1 && sudo mkdir -p "${dTEXMFLOCAL}" &&
sudo rsync -a "usr/share/texmf/fonts" "${dTEXMFLOCAL}/" && sudo mktexlsr && sudo updmap-sys --enable Map=culmus.map && ( echo SUCCESS!!! Need to add the following to your preamble before loading babel: echo '\def\HeblatexEncoding{HE8}' echo '\def\HeblatexEncodingFile{he8enc}' )  ### Method 1 - Ubuntu 12.04+ : Use IvriTeX If you would like a TeX Live installation with Hebrew support, consider install-tl-ubuntu. It can be run as  sudo ./install-tl-ubuntu --hebrew  ### Method 2 - Ubuntu 10.04 (Lucid) A) Install LyX using the synaptic package manager. B) Download latest culmus release.(Recommended: not the source-release) note: Synaptic installation of culmus is general-usage fonts, and not LaTeX fonts. Synaptic's ivritex and texlive-lang-hebrew are not up to date C) Install culmus:  a. Extract the downloaded file to a folder b. apply "sudo make" via the terminal c. apply "sudo make install" via the terminal  D) Launch LyX E) Go to (Top side menu) Document -> Settings... :  a. in the Document Class tab (menu on the left side of the window), Set Document Class to "article (Hebrew)". b. in the Language tab (menu on the left side of the window), Set Language to "Hebrew", Set encoding to "other: Hebrew (CP 1255)".  F) Go to (Top side menu) Tools -> Preferences -> a. (in the left side menu) Language Settings and make sure Right-To-Left (RTL) support is enabled. You might want to toggle the "Cursor movement" from Logical to Visual. That will change the behavior of the cursor in math-mode (The next steps are optional)  You can use LyX-keyboard mapping instead of Linux-keyboard mapping for Hebrew.For some people, that is more continent, as you do not have to change keyboard-layout when you switch into math-mode. b. Editing->Keyboard/Mouse -- mark "Use keyboard map" and set the "First" to 'null' and the "Second" to 'hebrew'. c. Editing->Shortcut -- Press on "New" button and in the "Function" field write 'language hebrew", and then set shortcut key as you desire. This key will toggle Hebrew\English. Note: for me, 'language english' worked and 'language hebrew' didn't. See Amir Rachum's Article  G) Write some text, Press Ctrl+D, an output file should be generated (if not, some errors will pop up). H) If all went well, that's it, you're done. Note: You do not need to change the system keyboard layout when typing hebrew in LyX, you can leave it on "USA". Another note: if the output is pixelated in close-up, see "Problem - Bitmap output" below. ### Method 3 - General NOTE: The last 2 commands are ubuntu 7.04/7.10-specific, but might work on other distros. There are many tutorials, most of them are too old, about how to do that. Some of them cause Hebrew to work, but the generated documents are fuzzy, or just not pretty enough. We recommend this way: (these are Ubuntu oriented instructions, but will probably work on Debian as well) • First of all, do not install tetex, it is not maintained any more; install texlive instead. • Trying to install ivritex package (as most tutorials suggest) will fail, because ivritex depends on tetex. • Instead, install texlive-font-utils. • Then, install culmus fonts (and other Hebrew fonts): $ sudo aptitude install culmus culmus-fancy xfonts-efont-unicode xfonts-efont-unicode-ib xfonts-intl-european msttcorefonts

 $sudo make CULMUSDIR=/usr/share/fonts/X11/Type1/ TEXMFDIR=/usr/share/texmf-texlive/$ sudo make install CULMUSDIR=/usr/share/fonts/X11/Type1/ TEXMFDIR=/usr/share/texmf-texlive/


The last 2 commands are ubuntu 7.04/7.10-specific, but might work on other distros; if not, try to remove the CULMUSDIR=... (until the end of the line) and see if the make recognizes the right directories instead.

Now your Hebrew documents should look much better!

### Problem - Bitmap output

Following the instruction in this page I managed to produce hebrew pdf, but with bitmap font (not vector one). After looking at other sites, I found out I had to add "\usepackage{culmus}" (or "\usepackage[use-david]{culmus}" - matter of taste) to the preamble. Perhaps this will help others as well.

#### Nikud/Vowels

Going beyond the use of consonants to add Nikud, or vowel points, to Hebrew seems to cause a fair amount of difficulty.

• set your document encoding to utf8x (in the language tab of the document's preferences)

This should remove the errors requesting you activate the combine option.

### LyX 2.1+ with unicode

It is fairly simple to get LyX to display and print fully pointed Hebrew with recent versions. (The set up below also allows the use of fully accented polytonic Greek.)

This set up requires the use of XeTeX, so ensure that your LyX installation supports this output method first.

The use of the Cardo font for the display of Hebrew and Greek is strongly recommended, as it has an extensive character set. See http://scholarsfonts.net/cardofnt.html

If you want to use sans serif or monospaced foreign characters, then the installation of FreeSans and FreeMono is recommended. See https://www.gnu.org/software/freefont/

Open Document → Settings. Under the "Fonts" tab, select "Use non-TeX fonts (via XeTeX/LuaTeX)". Select Cardo as the Roman font, FreeSans for Sans Serif, and FreeMono for Typewriter.

If using biblatex, you will also need to switch from babel to polyglossia. In the Document → Settings → LaTeX Preamble tab, add:

\usepackage{polyglossia}
\usepackage[style=verbose,natbib=true,citestyle=verbose,backend=biber,url=false,doi=false,isbn=false]{biblatex}

\newfontfamily\greekfont{BABEL Unicode}


The first line ensures polyglossia is used, instead of babel. The second line uses biblatex for bibliographies, which is much more flexible than bibtex,
but can be safely removed. Change the settings to suit your needs (see the excellent biblatex manual.) If not using biblatex, then remove the third line,
which sets the source bib file.

The newfontfamily command is an example of how a font may be selected to typeset a particular language, overriding the main document font.

In order for LyX to recognize your new language(s) for the first time:

1. Insert some text in the new language;
2. Select that text;
3. Go to Edit → Text Style → Customized...;
4. From the "Language;" dropdown, choose the appropriate language (for this tutorial, presumably either "Hebrew" or "Greek (polytonic)").

Once the language has been set up for the first time, it will appear as an item in the Edit menu,
or in the pop-up when you select some text and right-click on it.

You should now be able to enter both Greek and Hebrew and set the language in LyX. The text will be properly hyphenated.
The Hebrew will also be displayed and typeset properly as right-to-left text.
(If you don't set the language to Hebrew, the text will not display or be typeset correctly.)