Guy Rutenberg

Keeping track of what I do

Algorithm Float Label for Hebrew Document

with 2 comments

For a while now I’ve refrained from using the very nice Algorithm environment for LaTeX papers I wrote in Hebrew due to the way it’s label was displayed. The English label was displayed in reverse.

algorithm-before

For sometime before letting go of the issue, I’ve tried to correct the direction of the label. It could have been fixed by marking the float as English text in LyX (I use it for editing Hebrew papers, as it makes editing multi-lingual texts easy), effectively adding \selectlanguage{english} before the \begin{algorithm} line. However, it resulted in display mess in LyX and some LaTeX errors when compiling (also it seemed LaTeX could complete the first pass).

Today, I’ve decided to tackle and solve the problem for a new paper I’m writing. After searching a bit for a way to override the Algorithm environment label, I’ve found a general way to override a float label in LaTeX:

\floatname{floatname}{floatlabel}

So for our case it would look like this:

\floatname{algorithm}{אלגוריתם}

You should put it in your LaTeX preamble (Documents->Settings in LyX). This neatly fixes the problem (see screenshot below).

algorithm-after

Share and Enjoy:
  • del.icio.us
  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google Bookmarks
  • Simpy

Written by Guy

June 18th, 2009 at 7:00 pm

Posted in LaTeX, Tips

Tagged with , ,

2 Responses to 'Algorithm Float Label for Hebrew Document'

Subscribe to comments with RSS or TrackBack to 'Algorithm Float Label for Hebrew Document'.

  1. Thanks, I just used this tip :)

    Rani

    25 Jun 09 at 18:52

  2. I also just used this after avoiding the Algorithm environment for over a year.

    I wonder in what package the bug lies…

    Afief

    7 Dec 09 at 16:34

Leave a Reply