<?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; amsmath</title>
	<atom:link href="http://www.guyrutenberg.com/tag/amsmath/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>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>
	</channel>
</rss>

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

