Mixed ltr rtl in LaTeX


Hello,

TLDR

TeX template file, generated PDF file.

In this post we’ll go through mixing RTL and LTR languages, specifically Hebrew and English, in a LaTeX Document.
Before we begin it is recommended to correctly setup the environment, You may want to read the previous guide on the topic.
I’ve based this post on a HW template used to submit my assignments in the academy.

I won’t go through the LaTeX code (as it’s well formatted and has plenty of comments).

I’ll only mention that this template has:

  1. A cover page - in which you may notice that numbers and Hebrew characters behave as expected.
  2. A ToC.
  3. A header with some details - in which you may notice that numbers and Hebrew characters behave as expected.
  4. A footer with page numbering.

all automatically handled and saves you some time.

As to the mixing of LTR and RTL languages, you can see that in section 2 no matter how we choose to write the code the result will be beautiful.
the following code:

שלום כיתה א! \unsethebrew Hello, First Grade!

Hello, First Grade! \sethebrew שלום כיתה א!

שלום כיתה א! \unsethebrew Hello, First Grade!

will result in: Result Image

That’s it for today, if You have any questions let me know in the comments section below.

Related Posts

Writing LaTeX like a coder

A short guide on writing LaTeX in a code editor. Bonus - Hebrew support.

Init Blog

This is the first post in the blog.

בדיקה