KOMA-Script: Specifying Binding Correction for RTL Documents

The KOMA-Script bundle provides an option to specify the amount of binding correction needed to compensate for the width lost in the binding process. By default, it is added to the left margin, which is where the binding is applied for left-to-right languages. However, if a document is written in Hebrew or Arabic, it is bound on the right. The KOMA-Script manual does not consider that option. After a bit of playing around, I’ve found that simply using a negative value for the binding correction works.

For example, if in an English document you would use

documentclass[BCOR=8.25mm]{scrreprt}

For Hebrew you would set

documentclass[BCOR=-8.25mm]{scrreprt}

RTL Tiddlers in TiddlyWiki 5

A few years ago, I wrote about how to create RTL (right-to-left) tiddlers in TiddlyWiki. Creating RTL tiddlers is almost a necessity if you want to create tiddlers in a right-to-left language such as Hebrew or Arabic. TiddlyWiki5, the new version of TiddlyWiki, broke the old solution, but a similar one can be made. In order to be able to add RTL tiddlers to your TiddlyWiki, follow these steps:
Continue reading RTL Tiddlers in TiddlyWiki 5

Hebrew Support in Hyperref – Situation Review

It’s been a bit more than three years since I wrote about a workaround for getting hyperref to play (almost) nicely with Hebrew. Over the past few weeks, I saw a rising interest in this, and a few people contacted me regarding this issue. So I thought it’s a good opportunity to better document the current situation and possible approaches that should be further investigated, which I believe might lead to better solutions.
Continue reading Hebrew Support in Hyperref – Situation Review

An Early Release of the New cssrtl.py-2.0

It has been three years since I released the original version of cssrtl.py (and two since its re-release). The old version did a nice job, but experience gained during that time led me to write a new version from scratch. More than a month ago, I detailed the basic principles and ideas that guided me in designing a better tool to help adapt CSS files from left-to-right to right-to-left.

The guidelines weren’t just empty words; they were written while working on the Hebrew adaptation of the Fusion theme and at the same time writing a new proof-of-concept version of cssrtl.py. The original intent was to release a more mature version of that code when it was completed. However, due to the apparent shortage of time in the present and foreseeable future, I can’t see myself completing the project any time soon. So, following the “release early” mantra, I’ve decided to release the code as-is. As I said, the code is in a working state, but not polished, so it may be beneficial but may contain bugs. If you find any bugs or have any suggestions, I would be glad to hear.
Continue reading An Early Release of the New cssrtl.py-2.0

RTL Tiddlers in TiddlyWiki

Update – For TiddlyWiki 5, see RTL Tiddlers in TiddlyWiki 5.

I’ve been using TiddlyWiki for a while now, and it has become a very useful tool for me. Today, I decided to organize my various recipes (somehow cooking, and especially making desserts, has turned into a hobby of mine), and as you can expect, I’ve decided to use TiddlyWiki for the task.

There was a slight problem, as some of the recipes are in Hebrew, and it seems TiddlyWiki doesn’t have built-in support for RTL (right-to-left) tiddlers. However, such support can be added via custom stylesheets and the tiddlers’ tags. The idea for this method was taken from this TiddlyWiki.

Create a new tiddler called “StyleSheet” (without the quotes). This is a special tiddler (a shadow tiddler) that lets you add additional CSS code for your wiki. Insert the following code into the newly created tiddler:

/*{{{*/
div[tags~="RTL"].tiddler {
    direction: rtl;
}
div[tags~="RTL"].tiddler .subtitle {
    direction: ltr;
}
div[tags~="RTL"].tiddler .tagged {
    direction: ltr;
    float: left;
}
/*}}}*/

Now, for every tiddler you want to be in RTL direction, just add RTL to its list of tags. After you do that, the tiddler will appear correctly. Here is an example of what RTL looks like after the fix:

A screenshot of an RTL tiddler
A screenshot of an RTL tiddler

Fixing Numbering Direction for Hebrew Text in LyX

On Monday, I submitted a patch to the LyX developers mailing list with a fix for the numbering direction in Hebrew text. In Hebrew text, the dot appeared before the numbering symbol instead of after it, as it should.
before-fix
This behaviour has been this way for years (at least as long as I can remember).
Continue reading Fixing Numbering Direction for Hebrew Text in LyX

Convert CSS layout to RTL – cssrtl.py

This is a re-release of a script of mine that helps convert CSS layouts to RTL. I originally released it about a year ago, but it was lost when I moved to the new blog. The script, cssrtl.py, utilizes a bunch of regular expressions to translate a given CSS layout to RTL.

Continue reading Convert CSS layout to RTL – cssrtl.py