<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Guy Rutenberg &#187; Hebrew</title>
	<atom:link href="http://www.guyrutenberg.com/tag/hebrew/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guyrutenberg.com</link>
	<description>Keeping track of what I do</description>
	<lastBuildDate>Sat, 14 Jan 2012 11:30:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Emulating Kav-Mafrid (em-dash) for the David Font</title>
		<link>http://www.guyrutenberg.com/2009/07/11/emulating-kav-mafrid-em-dash-for-the-david-font/</link>
		<comments>http://www.guyrutenberg.com/2009/07/11/emulating-kav-mafrid-em-dash-for-the-david-font/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 06:37:09 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[culmus-latex]]></category>
		<category><![CDATA[Hebrew]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=395</guid>
		<description><![CDATA[The David font that is used in Culmus-LaTeX lacks support of Kav-Mafrid, the ligature that is created by two consecutive dashes, --. Because the regular Hebrew dash, Maqaf, is position near the top of the line, one can&#8217;t use it instead of the Kav-Mafrid and expect a graphically pleasant result (while Kav-Mafrid can replace Maqaf [...]]]></description>
			<content:encoded><![CDATA[<p>The David font that is used in <a href="/culmus-latex">Culmus-LaTeX</a> lacks support of Kav-Mafrid, the ligature that is created by two consecutive dashes, <code>--</code>. Because the regular Hebrew dash, Maqaf, is position near the top of the line, one can&#8217;t use it instead of the Kav-Mafrid and expect a graphically pleasant result (while Kav-Mafrid can replace Maqaf and the text would still look ok). To make things even more problematic, this ligature is supported by Culmus-LaTeX&#8217;s default font, Frank Ruehl, which means one can&#8217;t easily switch fonts without hurting the layout.<br />
<span id="more-395"></span></p>
<p>At first, I&#8217;ve tried to use the English dash and en-dash but result weren&#8217;t satisfactory. Both of them were too light and positioned too low to be used in an Hebrew text written in the Culmus fonts (see screenshot).</p>
<p>So finally, I&#8217;ve decided to write a simple macro to emulate a Kav-Mafrid for the David font.</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">newcommand</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\dd</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\lower</span>0.17em<span style="color: #800000; font-weight: normal;">\hbox</span><span style="color: #E02020; ">{</span>-<span style="color: #800000; font-weight: normal;">\kern</span>-0.13em-</span><span style="color: #E02020; ">}}</span></pre></div></div>

<p>The command works by kerning two Hebrew, Maqaf&#8217;s, together (with a slight overlap to adjust width), and lowering their position to the middle of the line.</p>
<p>In the following screensot the first line features the Frank Ruehl font and it\&#8217;s Maqaf and Kav-Mafrid. The second line featured the david font with a Maqaf and the missing Kav-Mafrid ligature. The third line features the David font with English dash and en-dash. The last line uses David with the regular Maqaf and the <code>\dd{}</code> macro.<br />
<div id="attachment_397" class="wp-caption alignnone" style="width: 208px"><img src="http://www.guyrutenberg.com/wp-content/uploads/2009/07/dash-example.png" alt="Different dash examples" title="dash-example" width="198" height="232" class="size-full wp-image-397" /><p class="wp-caption-text">Different dash examples</p></div></p>
<p>As it can be seen, the <code>\dd{}</code> macro does provide a good alternative for the Kav-Mafrid. However this solution isn&#8217;t perfect. One can improve the macro by detecting if the Kav-Mafrid ligature is present in the current font and if so, use it instead of the kerned one. This would enable one to use the macro and safely switch fonts, knowing he will always get the best Kav-Mafrid possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/07/11/emulating-kav-mafrid-em-dash-for-the-david-font/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Hyperref to Work with Hebrew (in XeTeX)</title>
		<link>http://www.guyrutenberg.com/2009/06/27/getting-hyperref-to-work-with-hebrew-in-xetex/</link>
		<comments>http://www.guyrutenberg.com/2009/06/27/getting-hyperref-to-work-with-hebrew-in-xetex/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 10:18:54 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Hebrew]]></category>
		<category><![CDATA[hyperref]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=389</guid>
		<description><![CDATA[The hyperref package is notoriously known to cause problem with RTL text, which unfortunately include Hebrew. In this post I present some preliminary workarounds that enable the user to use the hyperref package with Hebrew and possibly other RTL languages. The solution requires XeTeX which is available in TeXLive. I had no success, yet, to [...]]]></description>
			<content:encoded><![CDATA[<p>The <code>hyperref</code> package is notoriously known to cause problem with RTL text, which unfortunately include Hebrew. In this post I present some preliminary workarounds that enable the user to use the  <code>hyperref</code> package with Hebrew and possibly other RTL languages. The solution requires XeTeX which is available in TeXLive. I had no success, yet, to port the workaround to pdfTeX, which is more popular.<br />
<span id="more-389"></span></p>
<p>The problem is that because TeX doesn&#8217;t store information regarding the direction of text inside the dvi, RTL text is actually stored in reverse. When a link is inserted in such text, the command to start the link ends up after the command to end the link, which is problematic. When trying to compile such document with pdfTex it throws errors like:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">! pdfTeX error (ext4): pdf_link_stack empty, \pdfendlink used without \pdfstart</pre></div></div>

<p>On the otherhand XeTeX behaves a little nicer and compiles the document, but the wrong parts of the text are marked as links.</p>
<p>My workaround basically changes the order of the start and end link commands. Thus, in RTL text the commands get reversed and actually end up in the correct order. The workaround doesn&#8217;t support links spanning multiple lines and color links (although link border is supported). Further work needs to be done in order to support links in the table of contents. I could get it to work only in LTR mode (which isn&#8217;t good). You should insert the following code to your preamble in order to enable the workaround.</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">makeatletter</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">def</span><span style="color: #800000; font-weight: normal;">\hyper</span>@link#1#2#3<span style="color: #E02020; ">{</span><span style="color: #2C922C; font-style: italic;">%</span>
  <span style="color: #800000; font-weight: normal;">\if</span>@rl
    <span style="color: #800000; font-weight: normal;">\setLR</span>
      <span style="color: #800000; font-weight: normal;">\begingroup</span>
      <span style="color: #800000; font-weight: normal;">\hyper</span>@linkend
        #3
      <span style="color: #800000; font-weight: normal;">\hyper</span>@linkstart<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">#1</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">#2</span><span style="color: #E02020; ">}</span>
    <span style="color: #800000; font-weight: normal;">\setRL</span>
  <span style="color: #E02020; ">\</span><span style="color: #800000;">else</span>
    <span style="color: #800000; font-weight: normal;">\hyper</span>@linkstart<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">#1</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">#2</span><span style="color: #E02020; ">}</span>
        #3
    <span style="color: #800000; font-weight: normal;">\hyper</span>@linkend
  <span style="color: #E02020; ">\</span><span style="color: #800000;">fi</span>
<span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">makeatother</span></pre></div></div>

<p>I&#8217;ll also note that in order to generate correct pdf bookmarks (not in gibberish), you should set <code>unicode=false</code> in the <code>hyperref</code>&#8216;s options.</p>
<p>You can find a working example bellow (and the corresponding PDF output <a href="/wp-content/uploads/2009/06/xetex-hyperref-test.pdf">here</a>).</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">documentclass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">article</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">fontspec</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">xunicode</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">bidi</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">unicode=false,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">0 0 1</span>},backref=false,colorlinks=false</span><span style="color: #E02020; ">]</span>
 <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">hyperref</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #E02020; ">\</span><span style="color: #800000;">makeatletter</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">def</span><span style="color: #800000; font-weight: normal;">\hyper</span>@link#1#2#3<span style="color: #E02020; ">{</span><span style="color: #2C922C; font-style: italic;">%</span>
  <span style="color: #800000; font-weight: normal;">\if</span>@rl
    <span style="color: #800000; font-weight: normal;">\setLR</span>
      <span style="color: #800000; font-weight: normal;">\begingroup</span>
      <span style="color: #800000; font-weight: normal;">\hyper</span>@linkend
        #3
      <span style="color: #800000; font-weight: normal;">\hyper</span>@linkstart<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">#1</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">#2</span><span style="color: #E02020; ">}</span>
    <span style="color: #800000; font-weight: normal;">\setRL</span>
  <span style="color: #E02020; ">\</span><span style="color: #800000;">else</span>
    <span style="color: #800000; font-weight: normal;">\hyper</span>@linkstart<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">#1</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">#2</span><span style="color: #E02020; ">}</span>
        #3
    <span style="color: #800000; font-weight: normal;">\hyper</span>@linkend
  <span style="color: #E02020; ">\</span><span style="color: #800000;">fi</span>
<span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">makeatother</span>
<span style="color: #800000; font-weight: normal;">\setromanfont</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">Times New Roman</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\setRL</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">title</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">בדיקה</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">author</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">גיא רוטנברג</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">date</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">maketitle</span>
<span style="color: #800000; font-weight: normal;">\pagebreak</span>{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #E02020; ">\</span><span style="color: #800000;">section</span>{סעיף ראשון</span><span style="color: #E02020; ">}\</span><span style="color: #800000;">label</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">testlabel</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">subsection</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">תת-סעיף ראשון</span><span style="color: #E02020; ">}\</span><span style="color: #800000;">label</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">testlabel2</span><span style="color: #E02020; ">}</span>
&nbsp;
לה לה
&nbsp;
לי לי
&nbsp;
לו לו
&nbsp;
<span style="color: #800000; font-weight: normal;">\pagebreak</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">section</span>{סעיף שני</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">subsection</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">תת-סעיף ראשון</span><span style="color: #E02020; ">}</span>
&nbsp;
לה לה
&nbsp;
<span style="color: #E02020; ">\</span><span style="color: #800000;">subsection</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">תת-סעיף שני</span><span style="color: #E02020; ">}</span>
&nbsp;
לי לי
חלק <span style="color: #E02020; ">\</span><span style="color: #800000;">ref</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">testlabel</span><span style="color: #E02020; ">}</span>
אבגד
<span style="color: #800000; font-weight: normal;">\hyperref</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">testlabel2</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">בדיקה ארוכה</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\setLR</span>
This is a test for LTR links. See section <span style="color: #E02020; ">\</span><span style="color: #800000;">ref</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">testlabel</span><span style="color: #E02020; ">}</span> and <span style="color: #800000; font-weight: normal;">\hyperref</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">testlabel2</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">long label</span><span style="color: #E02020; ">}</span>.
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/06/27/getting-hyperref-to-work-with-hebrew-in-xetex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Algorithm Float Label for Hebrew Document</title>
		<link>http://www.guyrutenberg.com/2009/06/18/algorithm-float-label-for-hebrew-document/</link>
		<comments>http://www.guyrutenberg.com/2009/06/18/algorithm-float-label-for-hebrew-document/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 16:00:12 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Hebrew]]></category>
		<category><![CDATA[LyX]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=379</guid>
		<description><![CDATA[For a while now I&#8217;ve refrained from using the very nice Algorithm environment for LaTeX papers I wrote in Hebrew due to the way it&#8217;s label was displayed. The English label was displayed in reverse. For sometime before letting go of the issue, I&#8217;ve tried to correct the direction of the label. It could have [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now I&#8217;ve refrained from using the very nice Algorithm environment for LaTeX papers I wrote in Hebrew due to the way it&#8217;s label was displayed. The English label was displayed in reverse.</p>
<p><img src="http://www.guyrutenberg.com/wp-content/uploads/2009/06/algorithm-before.png" alt="algorithm-before" title="algorithm-before" width="230" height="150" class="aligncenter size-full wp-image-380" /><br />
<span id="more-379"></span><br />
For sometime before letting go of the issue, I&#8217;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 <code>\selectlanguage{english}</code> before the <code>\begin{algorithm}</code> line. However, it resulted in display mess in LyX and some LaTeX errors when compiling (also it seemed LaTeX could complete the first pass).</p>
<p>Today, I&#8217;ve decided to tackle and solve the problem for a new paper I&#8217;m writing. After searching a bit for a way to override the Algorithm environment label, I&#8217;ve found a general way to override a float label in LaTeX:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\floatname</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">floatname</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">floatlabel</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>So for our case it would look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\floatname</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">algorithm</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">אלגוריתם</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>You should put it in your LaTeX preamble (Documents->Settings in LyX). This neatly fixes the problem (see screenshot below).</p>
<p><img src="http://www.guyrutenberg.com/wp-content/uploads/2009/06/algorithm-after.png" alt="algorithm-after" title="algorithm-after" width="303" height="163" class="aligncenter size-full wp-image-381" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/06/18/algorithm-float-label-for-hebrew-document/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fixing Numbering Direction for Hebrew Text in LyX</title>
		<link>http://www.guyrutenberg.com/2009/01/14/fixing-numbering-direction-for-hebrew-text-in-lyx/</link>
		<comments>http://www.guyrutenberg.com/2009/01/14/fixing-numbering-direction-for-hebrew-text-in-lyx/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 07:57:11 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hebrew]]></category>
		<category><![CDATA[LyX]]></category>
		<category><![CDATA[RTL]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=242</guid>
		<description><![CDATA[On Monday, I&#8217;ve 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. This behaviour has been this way for years (at least as long as I can remember). [...]]]></description>
			<content:encoded><![CDATA[<p>On Monday, I&#8217;ve 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.<br />
<img src="http://www.guyrutenberg.com/wp-content/uploads/2009/01/before-fix.png" alt="before-fix" title="before-fix" width="403" height="121" class="aligncenter size-full wp-image-243" /><br />
This behaviour has been this way for years (at least as long as I can remember).<br />
<span id="more-242"></span><br />
My first solution was a patch against the actual LyX code, but developers in the mailing list suggested the issue could be solved within the <code>po</code> file for Hebrew (<code>he.po</code>), as the po files are loaded for each paragraph depending on its language.</p>
<p>So I wrote a patch for the <code>he.po</code> file that fixes the problem.</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;">Index: he.po
===================================================================
<span style="color: #888822;">--- he.po	<span style="">&#40;</span>revision 28095<span style="">&#41;</span></span>
<span style="color: #888822;">+++ he.po	<span style="">&#40;</span>working copy<span style="">&#41;</span></span>
<span style="color: #440088;">@@ -15050,15 +15050,15 @@</span>
&nbsp;
 #: src/Buffer.cpp:<span style="">2902</span>
 msgid &quot;\\arabic<span style="">&#123;</span>enumi<span style="">&#125;</span>.&quot;
<span style="color: #991111;">-msgstr &quot;\\arabic<span style="">&#123;</span>enumi<span style="">&#125;</span>.&quot;</span>
<span style="color: #00b000;">+msgstr &quot;.\\arabic<span style="">&#123;</span>enumi<span style="">&#125;</span>&quot;</span>
&nbsp;
 #: src/Buffer.cpp:<span style="">2908</span>
 msgid &quot;\\roman<span style="">&#123;</span>enumiii<span style="">&#125;</span>.&quot;
<span style="color: #991111;">-msgstr &quot;\\roman<span style="">&#123;</span>enumiii<span style="">&#125;</span>.&quot;</span>
<span style="color: #00b000;">+msgstr &quot;.\\roman<span style="">&#123;</span>enumiii<span style="">&#125;</span>&quot;</span>
&nbsp;
 #: src/Buffer.cpp:<span style="">2911</span>
 msgid &quot;\\Alph<span style="">&#123;</span>enumiv<span style="">&#125;</span>.&quot;
<span style="color: #991111;">-msgstr &quot;\\Alph<span style="">&#123;</span>enumiv<span style="">&#125;</span>.&quot;</span>
<span style="color: #00b000;">+msgstr &quot;.\\Alph<span style="">&#123;</span>enumiv<span style="">&#125;</span>&quot;</span>
&nbsp;
 #: src/Buffer.cpp:<span style="">2928</span> src/insets/InsetCaption.cpp:<span style="">293</span>
 msgid &quot;Senseless!!! &quot;</pre></div></div>

<p>While this patch is against the SVN trunk (LyX 2.0), it could also be applied manually to older LyX versions.<br />
After yo apply the patch you should do the following (I assume that you are in the root of the LyX source tree):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cd po/
make he.gmo
cd ../
make install</pre></div></div>

<p>Now restart LyX and you will see the numbering appear as it should.<br />
<img src="http://www.guyrutenberg.com/wp-content/uploads/2009/01/after-fix.png" alt="after-fix" title="after-fix" width="426" height="108" class="aligncenter size-full wp-image-245" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/01/14/fixing-numbering-direction-for-hebrew-text-in-lyx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes About Using amsmath split Environment In Hebrew Documents</title>
		<link>http://www.guyrutenberg.com/2008/04/09/notes-about-using-amsmath-split-enviroment-in-hebrew-documents/</link>
		<comments>http://www.guyrutenberg.com/2008/04/09/notes-about-using-amsmath-split-enviroment-in-hebrew-documents/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 04:25:19 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[amsmath]]></category>
		<category><![CDATA[Errors]]></category>
		<category><![CDATA[Hebrew]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/2008/04/09/notes-about-using-amsmath-split-enviroment-in-hebrew-documents/</guid>
		<description><![CDATA[Recently I&#8217;ve worked on a Hebrew document in LaTeX and wanted to use the split environment to typeset some multiline formula. The document which compiled just fine till that point, failed to compile with the following error: Package amsmath Error: \begin{split} won't work here. I was using LyX, so I&#8217;ve assumed that it would generate [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve worked on a Hebrew document in LaTeX and wanted to use the split environment to typeset some multiline formula. The document which compiled just fine till that point, failed to compile with the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Package amsmath Error: \begin{split} won't work here.</pre></div></div>

<p><span id="more-49"></span></p>
<p>I was using <a href="http://www.lyx.org/">LyX</a>, so I&#8217;ve assumed that it would generate the correct syntax for this environment. But the error clearly said that the <code>\begin{split}</code> was used wrong. I&#8217;ve went through the <a href="ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf">user&#8217;s guide</a> for the <code>amsmath</code> package and rechecked the syntax. The document has a very handy section that contain common error messages and explanations. I was happy to find out that the error I got was documented there. Unfortunately, the explanation only confirmed that LyX generated the appropriated code for the <code>split</code> environment. </p>
<p>At this point, I&#8217;ve decided to export the document to a LaTeX file and manually tweak it till I find a solution. I&#8217;ve removed everything from the document apart from some Hebrew text and the <code>split</code> formula. I&#8217;ve suspected this error had to do with the Hebrew, as nobody else reported errors using <code>split</code> to the LyX mailing list. I&#8217;ve remembered that someone mentioned to me once that LaTex is very sensitive to the order the packages are added. So I&#8217;ve started to play with the order and moved the <code>\usepackage</code> statements around. When I&#8217;ve put the <code>\usepackage{babel}</code> above the <code>\usepackage{amsmath}</code> the document suddenly compiled fine.</p>
<p>Some further testing showed that in order for the <code>split</code> environment to work properly in an Hebrew document the <code>babel</code> package must be included before <code>amsmath</code> and any other package that depends on it (like <code>mathtools</code>).</p>
<p>Getting things to work back in LyX was a bit more tricky. LyX automatically adds the <code>babel</code> package after the LaTeX preamble, and by default it adds the <code>amsmath</code> when needed, but it does so before the LaTeX preamble. This, as you can see, results in the <code>\usepackage{amsmath}</code> appearing before the <code>\usepackage{babel}</code>. The solution had to override the placements of both statements.</p>
<p>The first step is to go to Document->Settings->Math Options and uncheck both &#8220;Use the AMS math package automatically&#8221; and &#8220;Use the AMS math package&#8221;. This won&#8217;t prevent you from using any to the <code>amsmath</code> package feature if you include it manually (like we will do). The next step is to go to Documents->Settings->LaTeX Preamble, and insert directly at the top of the preamble the following two lines:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">\usepackage{babel}
\usepackage{amsmath}</pre></div></div>

<p>Now the Hebrew document will compile fine even if you use the <code>amsmath</code>&#8216;s <code>split</code> environment. Note that LyX will add <code>\usepackage</code> statement for for <code>babel</code> after the preamble despite the fact you already have one. But don&#8217;t worry, LaTeX will ignore that second statement and no harm will be done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2008/04/09/notes-about-using-amsmath-split-enviroment-in-hebrew-documents/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing IvriTex-1.2.1 on teTex-3.0</title>
		<link>http://www.guyrutenberg.com/2007/02/16/installing-ivritex-121-on-tetex-30/</link>
		<comments>http://www.guyrutenberg.com/2007/02/16/installing-ivritex-121-on-tetex-30/#comments</comments>
		<pubDate>Fri, 16 Feb 2007 11:41:12 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Hebrew]]></category>
		<category><![CDATA[IvriTex]]></category>

		<guid isPermaLink="false">http://temp.sikumuna.com/2007/02/16/installing-ivritex-121-on-tetex-30/</guid>
		<description><![CDATA[Few days ago I finally decided to install Ivritex-1.2.1 on my system. I&#8217;m running a tetex-3.0. The new version of Ivritex includes some very important improvements and, at least for me, the most important thing is support for the Culmus fonts. tetex-3.0 introduced a major directory change which cause many problem with installing packages which [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago I finally decided to install Ivritex-1.2.1 on my system. I&#8217;m running a tetex-3.0. The new version of Ivritex includes some very important improvements and, at least for me, the most important thing is support for the <a href="http://culmus.sourceforge.net/">Culmus</a> fonts. tetex-3.0 introduced a major directory change which cause many problem with installing packages which are unaware of the changes. In this post I will try to walk through the installation process.</p>
<p>TEXMF will be the directory of you local TeX tree (usually /usr/share/texmf). Before Begining the installation process make sure you have the Culmus fonts installed. Apparently Culmus is not optional it&#8217;s a requirement. I&#8217;ll assume that your Culmus fonts are installed in /usr/share/fonts/culmus.</p>
<ol>
<li> Download the ivritex-1.2.1 source-code from <a href="https://sourceforge.net/project/showfiles.php?group_id=33341&amp;package_id=25386&amp;release_id=405161">here</a> .</li>
<li> Extract the archive into a temporary directory.</li>
<li>Save the diff file below a file named &#8220;Makefile_patch&#8221; and save it inside ivritex-1.2.1/fonts/culmus .</li>
<li> Apply the patch by going to the ivritex-1.2.1/fonts/culmus directory (under the directory where you extracted the source archive) and executing &#8220;patch Makefile_patch. The patch will alter the places where some file will be installed.</li>
<li>As root execute &#8220;updmap &#8211;enable Map culmus.map&#8221;.</li>
<li>Still as root execute &#8220;mktexlsr&#8221;.</li>
<li>Ivritex 1.2.1 should be installed now.</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;"><span style="color: #888822;">--- Makefile	2007-02-14 19:59:52.000000000 +0200</span>
<span style="color: #888822;">+++ Makefilenew	2007-02-16 10:11:07.000000000 +0200</span>
<span style="color: #440088;">@@ -20,8 +20,8 @@</span>
 vf_target     = $<span style="">&#40;</span>TEX_ROOT<span style="">&#41;</span>/fonts/vf/culmus
 # this is where ivritex will eventually be:
 tex_target    = $<span style="">&#40;</span>TEX_ROOT<span style="">&#41;</span>/tex/generic/babel
<span style="color: #991111;">-encode_dir    = $<span style="">&#40;</span>TEX_ROOT<span style="">&#41;</span>/dvips/base</span>
<span style="color: #991111;">-dvips_cfg_dir = $<span style="">&#40;</span>TEX_ROOT<span style="">&#41;</span>/dvips/config</span>
<span style="color: #00b000;">+encode_dir    = $<span style="">&#40;</span>TEX_ROOT<span style="">&#41;</span>/fonts/enc/dvips/base</span>
<span style="color: #00b000;">+map_dir       = $<span style="">&#40;</span>TEX_ROOT<span style="">&#41;</span>/fonts/map/</span>
 sysconf       = $<span style="">&#40;</span>DESTDIR<span style="">&#41;</span>/etc
 updmap_dir    = $<span style="">&#40;</span>sysconf<span style="">&#41;</span>/texmf/updmap
 #culmus_target = $<span style="">&#40;</span>PREFIX<span style="">&#41;</span>/fonts/culmus
<span style="color: #440088;">@@ -137,11 +137,11 @@</span>
 	mkdir -p $<span style="">&#40;</span>sysconf<span style="">&#41;</span>/texmf/updmap.d
 	echo &quot;Map culmus.map&quot; &amp;gt;$<span style="">&#40;</span>sysconf<span style="">&#41;</span>/texmf/updmap.d/10culmus.cfg
 else
<span style="color: #991111;">-	mkdir -p $<span style="">&#40;</span>dvips_cfg_dir<span style="">&#41;</span></span>
<span style="color: #991111;">-	cp culmus.map $<span style="">&#40;</span>dvips_cfg_dir<span style="">&#41;</span>/</span>
<span style="color: #00b000;">+	mkdir -p $<span style="">&#40;</span>map_dir<span style="">&#41;</span></span>
<span style="color: #00b000;">+	cp culmus.map $<span style="">&#40;</span>map_dir<span style="">&#41;</span>/</span>
   ifeq <span style="">&#40;</span>$<span style="">&#40;</span>tetex_ver<span style="">&#41;</span>,<span style="">2</span><span style="">&#41;</span>
 	# this should run mktexlsr as well
<span style="color: #991111;">-	$<span style="">&#40;</span>updmap<span style="">&#41;</span> --enable Map $<span style="">&#40;</span>dvips_cfg_dir<span style="">&#41;</span>/culmus.map</span>
<span style="color: #00b000;">+	$<span style="">&#40;</span>updmap<span style="">&#41;</span> --enable Map $<span style="">&#40;</span>map_dir<span style="">&#41;</span>/culmus.map</span>
   else # for tetex-<span style="">1</span>
     ifeq <span style="">&#40;</span>$<span style="">&#40;</span>tetex_ver<span style="">&#41;</span>,<span style="">1</span><span style="">&#41;</span>
 	# TODO: fill in sed line here</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2007/02/16/installing-ivritex-121-on-tetex-30/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Hebrew TrueType fonts with pdfTeX</title>
		<link>http://www.guyrutenberg.com/2006/12/08/using-hebrew-truetype-fonts-with-pdftex/</link>
		<comments>http://www.guyrutenberg.com/2006/12/08/using-hebrew-truetype-fonts-with-pdftex/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 07:35:14 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Hebrew]]></category>

		<guid isPermaLink="false">http://temp.sikumuna.com/2007/07/10/using-hebrew-truetype-fonts-with-pdftex/</guid>
		<description><![CDATA[This guide is base on a guide published by Dekel Tsur that can be found here. Dekel Tsur&#8217;s guide was very good but now it is outdated since it doesn&#8217;t work with teTex 3.0. In this guide I addressed this issue and updated the instructions and scripts so it will work with teTex 3.0.Since the [...]]]></description>
			<content:encoded><![CDATA[<p>This guide is base on a guide published by Dekel Tsur that can be found <a href="http://cs.haifa.ac.il/%7Edekelts/ttf/">here</a>. Dekel Tsur&#8217;s guide was very good but now it is outdated since it doesn&#8217;t work with teTex 3.0. In this guide I addressed this issue and updated the instructions and scripts so it will work with teTex 3.0.Since the quality of the Hebrew metafonts that comes with the Hebrew LaTeX is quite poor, alternative fonts are needed. The best quality free Hebrew fonts are TrueType fonts (for example, the times new/arial/courier new fonts). Using TrueType fonts with TeX is somewhat complicated, but it is quite easy with pdfTeX, as pdfTeX has native support for TrueType fonts. This document explains how to use TrueType fonts with pdfTeX. Since Hebrew requires the use of the eTeX engine, you need to have the pdfelatex program. It is available in teTeX 1.0 (which comes with recent Linux distributions). The instruction below allows using nikud, although the result is quite poor as the nikud glyphs are not aligned correctly (but it is better than nothing).</p>
<p><span id="more-1"></span></p>
<p>Hebrew TrueType fonts can be downloaded from <a href="http://corefonts.sourceforge.net/">here</a>.</p>
<p>In the following, TEXMF is the place of the (local) TeX tree (usually <font face="courier new,courier">/usr/share/texmf</font>), and TMP is some temporary directory you need to create. Steps 1-3 can be done as a regular user, while the other steps need to be done as root.</p>
<ol>
<li> Create the directory TMP, and chdir into it. Copy (or link) your TrueType fonts to TMP. Download the tar.gz file <a href="/wp-content/uploads/2007/07/ttf.tar.gz" title="ttf.tar.gz">ttf.tar.gz</a> and extract it into TMP.</li>
<li> Run the python script `ttf.py&#8217;:
<dl>
<dt>
</dt>
<dd><font face="courier new,courier"> python ttf.py *.ttf</font> </dd>
</dl>
<p> If you are unable to run this script, you can manually perform the following steps for each font (you also need to create an empty file called `hebrew.map&#8217;). Steps (d) and (e) are optional. These steps are needed for nikud. Step (e) is also needed for ligatures. The instruction are written for the times.ttf font (for other font, you might need to replace winheb2.enc by another encoding file).</p>
<ol>
<li> Create a tfm file by
<dl>
<dt>
</dt>
<dd><font face="courier new,courier"> ttf2tfm times.ttf -N -T winheb2.enc -v tmp.vpl htimes.tfm</font> </dd>
</dl>
</li>
<li> Get the font name by running
<dl>
<dt>
</dt>
<dd><font face="courier new,courier"> ttf2afm times.ttf | grep FontName</font> </dd>
</dl>
<p> For the times font, the result is `TimesNewRomanPSMT&#8217;</li>
<li> Add the following line to the file `hebrew.map&#8217;:
<dl>
<dt>
</dt>
<dd><font face="courier new,courier"> htimes TimesNewRomanPSMT &lt;winheb2.enc &lt;times.ttf</font> </dd>
</dl>
</li>
<li> Edit the file `tmp.vpl&#8217;. Change the width of each nikud character to 0. For example, change
<dl>
<dt>
</dt>
<dd><font face="courier new,courier"> (CHARACTER O 300(comment sheva)<br />
(CHARWD R 333)<br />
(CHARDP R 215) )</font> </dd>
</dl>
<p> to</p>
<dl>
<dd><font face="courier new,courier"> (CHARACTER O 300(comment sheva)<br />
(CHARWD R 0)<br />
(CHARDP R 215) )</font> </dd>
</dl>
</li>
<li> Run</li>
</ol>
<dl>
<dt>
</dt>
<dd><font face="courier new,courier"> vptovf tmp.vpl tmp.vfm htimes.tfm</font> </dd>
</dl>
</li>
<li> If you don&#8217;t have the times/arial/courier fonts (or you don&#8217;t want to use them as default fonts), you need to edit the file `ttfheb.sty&#8217;</li>
<li> Run `su&#8217; to get root access.</li>
<li> Move the file ttfheb.sty to the directory of the Hebrew latex files (it should be `TEXMF/tex/generic/babel/hebrew/&#8217;. If it is not, you can find this directory with `<font face="courier new,courier">locate rlbabel.def</font>&#8216;.)</li>
<li> Run
<dl>
<dt>
</dt>
<dd><font face="courier new,courier"> sh install TEXMF</font> </dd>
</dl>
<p> If you are unable to use this script, perform the following steps manually:</p>
<ol>
<li> Create a directory called `<font face="courier new,courier">TEXMF/fonts/truetype/hebrew/</font>&#8216;,<br />
and move the .ttf files to this directory.</li>
<li> Create a directory called `<font face="courier new,courier">TEXMF/fonts/tfm/truetype/hebrew/</font>&#8216;,<br />
and move the .tfm files into this directory.</li>
<li> Move the .enc files and `hebrew.map&#8217; to `<font face="courier new,courier">TEXMF/fonts/map/pdftex/</font>&#8216;</li>
<li>while in the <font face="courier new,courier">TEXMF/fonts/map/pdftex/ </font>directory run:
<dl>
<dt>
</dt>
<dd><font face="courier new,courier">updmap-sys &#8211;enable Map hebrew.map<br />
</font></dd>
</dl>
<p><font face="courier new,courier"><br />
</font></li>
<li> Run
<dl>
<dd><font face="courier new,courier"> mktexlsr TEXMF</font> </dd>
</dl>
</li>
</ol>
</li>
<li> The final test: as a regular user run
<dl>
<dt>
</dt>
<dd><font face="courier new,courier"> pdftex test.tex<br />
pdfelatex test2.tex</font></dd>
</dl>
</li>
</ol>
<p>To make a LaTeX document use the TrueType fonts, add the line `\usepackage{ttfheb}&#8217; to the preamble (see `test2.tex&#8217;).</p>
<h4> UPDATES:</h4>
<p>18/03/2007: added the new ttfheb.sty file by <strong>Artyom Tonkikh </strong>and fixed some typos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2006/12/08/using-hebrew-truetype-fonts-with-pdftex/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.430 seconds -->

