<?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; LaTeX</title>
	<atom:link href="http://www.guyrutenberg.com/category/latex/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>Expectation Symbol in LaTeX</title>
		<link>http://www.guyrutenberg.com/2011/11/19/expectation-symbol-in-latex/</link>
		<comments>http://www.guyrutenberg.com/2011/11/19/expectation-symbol-in-latex/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 19:14:06 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[LyX]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=900</guid>
		<description><![CDATA[After looking for a builtin expectation symbol in LaTeX, and coming up with none, I&#8217;ve defined one. Just add: % Expectation symbol \DeclareMathOperator*{\E}{\mathbb{E}} to your LaTeX preamble and you&#8217;re done. You&#8217;ll also need to add \usepackage{amsmath} or in LyX to tick &#8220;Use AMS math package&#8221; under Document->Settings->Math Options. Using the starred version of \DeclareMathOperator makes [...]]]></description>
			<content:encoded><![CDATA[<p>After looking for a builtin expectation symbol in LaTeX, and coming up with none, I&#8217;ve defined one. Just add:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #2C922C; font-style: italic;">% Expectation symbol</span>
<span style="color: #800000; font-weight: normal;">\DeclareMathOperator*</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\E</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\mathbb</span>{E</span><span style="color: #E02020; ">}}</span></pre></div></div>

<p>to your LaTeX preamble and you&#8217;re done. You&#8217;ll also need to add <code>\usepackage{amsmath}</code> or in LyX to tick &#8220;Use AMS math package&#8221; under Document->Settings->Math Options.</p>
<p>Using the starred version of <code>\DeclareMathOperator</code> makes sure subscripts goes beneath the symbol in display mode.</p>
<p><a href="http://www.guyrutenberg.com/wp-content/uploads/2011/11/expectation-symbol.png"><img src="http://www.guyrutenberg.com/wp-content/uploads/2011/11/expectation-symbol.png" alt="" title="expectation-symbol" width="390" height="88" class="aligncenter size-full wp-image-901" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2011/11/19/expectation-symbol-in-latex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaTeX for TiddlyWiki &#8211; A MathJax Plugin</title>
		<link>http://www.guyrutenberg.com/2011/06/25/latex-for-tiddlywiki-a-mathjax-plugin/</link>
		<comments>http://www.guyrutenberg.com/2011/06/25/latex-for-tiddlywiki-a-mathjax-plugin/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 14:05:31 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[MathJax]]></category>
		<category><![CDATA[TiddlyWiki]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=825</guid>
		<description><![CDATA[Some time ago I came across MathJax, a nifty, Javascript based engine for displaying TeX and LaTeX equations. It works by &#8220;translating&#8221; the equation to MathML or HTML+CSS, so it works on all modern browsers. The result isn&#8217;t a raster image, like in most LaTeX solutions (e.g. MediaWiki), so it&#8217;s scales with the text around [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I came across <a href="http://www.mathjax.org/">MathJax</a>, a nifty, Javascript based engine for displaying TeX and LaTeX equations. It works by &#8220;translating&#8221; the equation to MathML or HTML+CSS, so it works on all modern browsers. The result isn&#8217;t a raster image, like in most LaTeX solutions (e.g. MediaWiki), so it&#8217;s scales with the text around it. Furthermore, it&#8217;s quite easy to integrate as it doesn&#8217;t require any real installation, and you could always use MathJax&#8217;s own CDN, which makes things even simpler.</p>
<p><div id="attachment_829" class="wp-caption aligncenter" style="width: 469px"><a href="http://www.guyrutenberg.com/wp-content/uploads/2011/06/mathjax1.png"><img src="http://www.guyrutenberg.com/wp-content/uploads/2011/06/mathjax1.png" alt="TiddlyWiki with the MathJaxPlugin" title="TiddlyWiki with the MathJaxPlugin" width="459" height="219" class="size-full wp-image-829" /></a><p class="wp-caption-text">A tiddler with LaTeX equations.</p></div><span id="more-825"></span></p>
<p>I quickly realized MathJax will be a perfect fit for TiddlyWiki which is also based on pure Javascript. It will allow me to enter complex formulas in tiddlers and still be able to carry my wiki anywhere with me, independent of a real TeX installation. I searched the web for an existing MathJaX plugin for TiddlyWiki but I came up empty handed (I did find some links, but they referenced pages that no longer exist). So I regarded it as a nice opportunity to begin writing some plugins for TiddlyWiki and created the MathJaxPlugin which integrates MathJax with TiddlyWiki.</p>
<p>As I don&#8217;t have an online TiddlyWiki, you&#8217;ll won&#8217;t be able to import the plugin, instead you&#8217;ll have to install it manually (which is pretty simple).</p>
<p>Start by creating a new tiddler named <code>MathJaxPlugin</code>, and tag with <code>systemConfig</code> (this tag will tell TiddlyWiki to execute the JS code in the tiddler, thus making it a plugin. Now copy the following code to the tiddler content:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/***
|''Name:''|MathJaxPlugin|
|''Description:''|Enable LaTeX formulas for TiddlyWiki|
|''Version:''|1.0.0|
|''Date:''|Jun 25, 2011|
|''Source:''|http://www.guyrutenberg.com/2011/06/25/latex-for-tiddlywiki-a-mathjax-plugin|
|''Author:''|Guy Rutenberg|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.5.0|
&nbsp;
Currently the plugin supports the following delemiters:
* &quot;&quot;&quot;$$&quot;&quot;&quot;..&quot;&quot;&quot;$$&quot;&quot;&quot; - Inline equations
* &quot;&quot;&quot;\(&quot;&quot;&quot;..&quot;&quot;&quot;\)&quot;&quot;&quot; - Inline equations
* &quot;&quot;&quot;\[&quot;&quot;&quot;..&quot;&quot;&quot;\]&quot;&quot;&quot; - Display equations
***/</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//{{{</span>
config.<span style="color: #660066;">extensions</span>.<span style="color: #660066;">MathJax</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
  mathJaxScript <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;</span><span style="color: #339933;">,</span>
  <span style="color: #006600; font-style: italic;">// uncomment the following line if you want to access MathJax using SSL</span>
  <span style="color: #006600; font-style: italic;">// mathJaxScript : &quot;https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;,</span>
  displayTiddler_old <span style="color: #339933;">:</span> story.<span style="color: #660066;">displayTiddler</span><span style="color: #339933;">,</span>
  displayTiddler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>TiddlerName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    config.<span style="color: #660066;">extensions</span>.<span style="color: #660066;">MathJax</span>.<span style="color: #660066;">displayTiddler_old</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    MathJax.<span style="color: #660066;">Hub</span>.<span style="color: #660066;">Queue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;Typeset&quot;</span><span style="color: #339933;">,</span> MathJax.<span style="color: #660066;">Hub</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
jQuery.<span style="color: #660066;">getScript</span><span style="color: #009900;">&#40;</span>config.<span style="color: #660066;">extensions</span>.<span style="color: #660066;">MathJax</span>.<span style="color: #660066;">mathJaxScript</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    MathJax.<span style="color: #660066;">Hub</span>.<span style="color: #660066;">Config</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
      extensions<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;tex2jax.js&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
      <span style="color: #3366CC;">&quot;HTML-CSS&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> scale<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span> <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    MathJax.<span style="color: #660066;">Hub</span>.<span style="color: #660066;">Startup</span>.<span style="color: #000066;">onload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    story.<span style="color: #660066;">displayTiddler</span> <span style="color: #339933;">=</span> config.<span style="color: #660066;">extensions</span>.<span style="color: #660066;">MathJax</span>.<span style="color: #660066;">displayTiddler</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
config.<span style="color: #660066;">formatters</span>.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;mathJaxFormula&quot;</span><span style="color: #339933;">,</span>
	match<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span>[|<span style="color: #000099; font-weight: bold;">\\</span>$<span style="color: #000099; font-weight: bold;">\\</span>$|<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span>(&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #006600; font-style: italic;">//lookaheadRegExp: /(?:\\\[|\$\$)((?:.|\n)*?)(?:\\\]|$$)/mg,</span>
	handler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>w<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>w.<span style="color: #660066;">matchText</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>[&quot;</span><span style="color: #339933;">:</span> <span style="color: #006600; font-style: italic;">// displayed equations</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">lookaheadRegExp</span> <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/\\\[((?:.|\n)*?)(\\\])/mg</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;$$&quot;</span><span style="color: #339933;">:</span> <span style="color: #006600; font-style: italic;">// inline equations</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">lookaheadRegExp</span> <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/\$\$((?:.|\n)*?)(\$\$)/mg</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>(&quot;</span><span style="color: #339933;">:</span> <span style="color: #006600; font-style: italic;">// inline equations</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">lookaheadRegExp</span> <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/\\\(((?:.|\n)*?)(\\\))/mg</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">default</span><span style="color: #339933;">:</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">lookaheadRegExp</span>.<span style="color: #660066;">lastIndex</span> <span style="color: #339933;">=</span> w.<span style="color: #660066;">matchStart</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> lookaheadMatch <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">lookaheadRegExp</span>.<span style="color: #660066;">exec</span><span style="color: #009900;">&#40;</span>w.<span style="color: #660066;">source</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>lookaheadMatch <span style="color: #339933;">&amp;&amp;</span> lookaheadMatch.<span style="color: #660066;">index</span> <span style="color: #339933;">==</span> w.<span style="color: #660066;">matchStart</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			createTiddlyElement<span style="color: #009900;">&#40;</span>w.<span style="color: #660066;">output</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;span&quot;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>lookaheadMatch<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			w.<span style="color: #660066;">nextMatch</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">lookaheadRegExp</span>.<span style="color: #660066;">lastIndex</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//}}}</span></pre></div></div>

<p>After saving the tiddler, reload the wiki and the MathJaxPlugin should be active. You can test it by creating a new tiddler with some equations in it:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">This is an inline equation $$P(E)   = {n \choose k} p^k (1-p)^{ n-k}$$ and this is a displayed equation:
\[J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}\]</pre></div></div>

<p>Which should result in the tiddler that appears in the above image.</p>
<p>Update 20110819: Removed debugging code from the plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2011/06/25/latex-for-tiddlywiki-a-mathjax-plugin/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>\lyxframeend Undefined when Using Beamer with Lyx</title>
		<link>http://www.guyrutenberg.com/2009/07/22/lyxframeend-undefined-when-using-beamer-with-lyx/</link>
		<comments>http://www.guyrutenberg.com/2009/07/22/lyxframeend-undefined-when-using-beamer-with-lyx/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 14:40:14 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Beamer]]></category>
		<category><![CDATA[Errors]]></category>
		<category><![CDATA[LyX]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=411</guid>
		<description><![CDATA[I&#8217;m using LyX for the first time with Beamer. Making the title page was smooth. But when I&#8217;ve tried adding a new frame (using BeginFrame) I was confronted with the following error \lyxframeend {}\lyxframe{Outline} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using LyX for the first time with Beamer. Making the title page was smooth. But when I&#8217;ve tried adding a new frame (using BeginFrame) I was confronted with the following error</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"> \lyxframeend
                 {}\lyxframe{Outline}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.</pre></div></div>

<p>After comparing my document to example (working) beamer documents I&#8217;ve found out that you must have an EndFrame command after your last frame.Too bad it wasn&#8217;t documented anywhere I&#8217;ve found as this little thing drove me crazy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/07/22/lyxframeend-undefined-when-using-beamer-with-lyx/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<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>Displaying Non-Builtin Math Macros in LyX</title>
		<link>http://www.guyrutenberg.com/2009/05/13/displaying-non-builtin-math-macros-in-lyx/</link>
		<comments>http://www.guyrutenberg.com/2009/05/13/displaying-non-builtin-math-macros-in-lyx/#comments</comments>
		<pubDate>Wed, 13 May 2009 18:15:54 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[LyX]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=335</guid>
		<description><![CDATA[I believe LyX is a great tool for writing LaTeX document. It makes writing formulas very easy and it allows you to see the formula as you are writing, as opposed to seeing only LaTeX code. However LyX doesn&#8217;t support every LaTeX package and the macros it defines. Sure it doesn&#8217;t stop you from using [...]]]></description>
			<content:encoded><![CDATA[<p>I believe LyX is a great tool for writing LaTeX document. It makes writing formulas very easy and it allows you to see the formula as you are writing, as opposed to seeing only LaTeX code. However LyX doesn&#8217;t support every LaTeX package and the macros it defines. Sure it doesn&#8217;t stop you from using these macros in your formulas, but it doesn&#8217;t display nicely, you see the name of the macro instead of a schematic preview.</p>
<p>While LyX doesn&#8217;t support many of the great packages out there like mathtools (which I really hope it will someday), you can add some support to your documents. At the beginning of the document insert a comment, via Insert->Note->Comment. Inside the newly created comment insert a math-macro via Insert->Math->Macro. In the name part, put the name of the command you want to add support for. In the second box (caption LyX), use existing LyX commands to mimic how the macro will look like. For example, this is what it looks like for the <code>\coloneqq</code> macro (from the great <code>mathtools</code> package):<br />
<img src="http://www.guyrutenberg.com/wp-content/uploads/2009/05/math-macro.png" alt="math-macro" title="math-macro" width="279" height="67" class="aligncenter size-full wp-image-336" /></p>
<p>After adding the math macro in the comment, when you will use the macro inside formulas it will display nicely:<br />
<img src="http://www.guyrutenberg.com/wp-content/uploads/2009/05/math-macro2.png" alt="math-macro2" title="math-macro2" width="336" height="108" class="aligncenter size-full wp-image-339" /></p>
<p>A little explanation how things work. When you define a math macro in LyX, LyX does two things:</p>
<ol>
<li>Inserts LaTeX code to create the macro.</li>
<li>Displays the macro nicely when editing the document.</li>
</ol>
<p>While the latter is desirable, the former is problematic. If LyX inserts LaTeX code to define the existing macro, it will cause errors. So when you put the LyX macro in the comment environment, the code LyX generates gets ignored and only the second, desirable, outcome is achieved.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/05/13/displaying-non-builtin-math-macros-in-lyx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drawing Finite Automata and State Machines</title>
		<link>http://www.guyrutenberg.com/2008/11/09/drawing-finite-automata-and-state-machines/</link>
		<comments>http://www.guyrutenberg.com/2008/11/09/drawing-finite-automata-and-state-machines/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 16:05:51 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Graphviz]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=158</guid>
		<description><![CDATA[I had to draw couple of Finite Automata and Turing Machines for some university assignments. Usually I would have done it using Inkscape (as it is my favorite tool for creating figures for my LaTeX documents), but doing it manually is pretty tedious work. Inkscape diagram tool is currently sub par, so everything have to [...]]]></description>
			<content:encoded><![CDATA[<p>I had to draw couple of Finite Automata and Turing Machines for some university assignments. Usually I would have done it using Inkscape (as it is my favorite tool for creating figures for my LaTeX documents), but doing it manually is pretty tedious work. Inkscape diagram tool is currently sub par, so everything have to be done by hand. It&#8217;s OK if you need to draw one State Machine  once in a while, but not suitable for larger quantities. I&#8217;ve also tried using Dia, but it also required lots of manual tweaking and tuning.</p>
<p>To my surprise, <a href="http://www.graphviz.org/">Graphviz</a> (and especially the <code>dot</code> utility) turned out to be the (almost) perfect tool for the job. It lets you describe the graph in a simple text-based way, and it handles the graph layout by himself. This is somewhat like LaTeX but for graphs (you concentrate on content not layout).</p>
<p>My Finite Automata needed no manual tweaking and resulted in a very nice graphs. For more complicated State Machines it&#8217;s sometimes necessary to do some manual tuning. The commands I found most useful to tweak the graph were:</p>
<ul>
<li>Grouping nodes to be in the same level  &#8211; <code>{ rank="same"; "q1"; "q2"; "q3"}</code>. The other options for <code>rank</code> can affect how the group is positioned relative to the other nodes in the graph (<code>source</code>, above all, <code>sink</code> bellow all).</li>
<li>Adding weight to edges &#8211; <code>q1 -&gt; q2 [weight="10"]</code>. This affects the cost of strecting the edge. The higher the weight the straighter the edges will be.</li>
<li> Adding invisible edges &#8211; <code>q1 -&gt; q3 [style="invis"]</code>. This allowed me to control the order of the nodes in the same rank (height).</li>
</ul>
<p>Last but not least Graphivz can generate the graphs in variety for formats including eps, pdf and svg (which allows post-processing with inkscape).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2008/11/09/drawing-finite-automata-and-state-machines/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>LaTeX Error: Command \textquotedbl unavailable in encoding HE8</title>
		<link>http://www.guyrutenberg.com/2008/10/12/latex-error-command-textquotedbl-unavailable-in-encoding-he8/</link>
		<comments>http://www.guyrutenberg.com/2008/10/12/latex-error-command-textquotedbl-unavailable-in-encoding-he8/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 17:08:48 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Errors]]></category>
		<category><![CDATA[LyX]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=115</guid>
		<description><![CDATA[I was testing today the SVN version of LyX 1.6.0 and 1.5.7. Due to a change in the way the double quotation mark (&#8220;) is handled, adding it to Hebrew text resulted in the following LaTeX error: LaTeX Error: Command \textquotedbl unavailable in encoding HE8 This could be solved by adding the following line to [...]]]></description>
			<content:encoded><![CDATA[<p>I was testing today the SVN version of <a href="http://www.lyx.org">LyX</a> 1.6.0 and 1.5.7. Due to a change in the way the double quotation mark (&#8220;) is handled, adding it to Hebrew text resulted in the following LaTeX error:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">LaTeX Error: Command \textquotedbl unavailable in encoding HE8</pre></div></div>

<p><span id="more-115"></span></p>
<p>This could be solved by adding the following line to your LaTeX preamble:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">let</span><span style="color: #800000; font-weight: normal;">\textquotedbl</span>=&quot;</pre></div></div>

<p>This line will define the <code>\textquotedb</code> to be the double quotation mark, and the document will compile look the same as it looked in older versions of LyX.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2008/10/12/latex-error-command-textquotedbl-unavailable-in-encoding-he8/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Equality-at and Relation-at LaTeX Macros.</title>
		<link>http://www.guyrutenberg.com/2008/04/19/equality-at-and-relation-at-latex-macros/</link>
		<comments>http://www.guyrutenberg.com/2008/04/19/equality-at-and-relation-at-latex-macros/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 05:36:30 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=51</guid>
		<description><![CDATA[These are two useful LaTeX macros for creating equality-at and (the more general) relation-at signs. These macros depend on the mathtools package. As with all other macros you should add them to you preamble in order to use. The general macro is the \relat. It takes two arguments, the relation and an expression where the [...]]]></description>
			<content:encoded><![CDATA[<p>These are two useful LaTeX macros for creating equality-at and (the more general) relation-at signs. These macros depend on the mathtools package. As with all other macros you should add them to you preamble in order to use.</p>
<p>The general macro is the <code>\relat</code>. It takes two arguments, the relation and an expression where the relation takes place (the &#8220;at&#8221;). The equality-at macro, <code>\eqat</code> is a specific case of <code>\relat</code>. I&#8217;ve created it because it is commonly used and only requires passing the &#8220;at&#8221; argument.<br />
<span id="more-51"></span><br />
Here is the LaTeX code for the macros.</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;">\relat</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">2</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\mathrel</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\bigg</span>|_<span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\mathrlap</span>{#2</span><span style="color: #E02020; ">}}</span><span style="color: #800000; font-weight: normal;">\mathrlap</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">#1</span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\hphantom</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">{</span><span style="color: #2020C0; font-weight: normal;">}_{#2</span><span style="color: #E02020; ">}}}}</span>
<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;">\eqat</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">1</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\mathrel</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\bigg</span>|_<span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\mathrlap</span>{#1</span><span style="color: #E02020; ">}}</span><span style="color: #800000; font-weight: normal;">\mathrlap</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">=</span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\hphantom</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">{</span><span style="color: #2020C0; font-weight: normal;">}_{#1</span><span style="color: #E02020; ">}}}}</span></pre></div></div>

<p>This is a basic example of how to use the macros. It should also give you an idea how they look.</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;">documentclass<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;">pagestyle</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">empty</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;">mathtools</span><span style="color: #E02020; ">}</span>
&nbsp;
<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;">\relat</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">2</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\mathrel</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\bigg</span>|_<span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\mathrlap</span>{#2</span><span style="color: #E02020; ">}}</span><span style="color: #800000; font-weight: normal;">\mathrlap</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">#1</span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\hphantom</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">{</span><span style="color: #2020C0; font-weight: normal;">}_{#2</span><span style="color: #E02020; ">}}}}</span>
<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;">\eqat</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">1</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\mathrel</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\bigg</span>|_<span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\mathrlap</span>{#1</span><span style="color: #E02020; ">}}</span><span style="color: #800000; font-weight: normal;">\mathrlap</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">=</span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\hphantom</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">{</span><span style="color: #2020C0; font-weight: normal;">}_{#1</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>
&nbsp;
<span style="color: #E02020; ">\[</span><span style="color: #C08020; font-weight: normal;">
<span style="color: #800000; font-weight: normal;">\Delta</span>=<span style="color: #E02020; ">\</span><span style="color: #800000;">left</span><span style="color: #E02020; ">[</span><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;">array</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">cc</span><span style="color: #E02020; ">}</span> P <span style="color: #E02020; ">&amp;</span> Q<span style="color: #E02020; ">\\</span> f' <span style="color: #E02020; ">&amp;</span> g'<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;">array</span></span><span style="color: #E02020; ">}\</span><span style="color: #800000;">right</span></span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\eqat</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\Gamma</span></span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">left</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;"><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;">array</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">cc</span><span style="color: #E02020; ">}</span> -2t <span style="color: #E02020; ">&amp;</span> 4t<span style="color: #E02020; ">\\</span> 1 <span style="color: #E02020; ">&amp;</span> -2<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;">array</span></span><span style="color: #E02020; ">}\</span><span style="color: #800000;">right</span></span><span style="color: #E02020; ">]</span>
<span style="color: #E02020; ">\]</span>
<span style="color: #E02020; ">\[</span><span style="color: #C08020; font-weight: normal;">
<span style="color: #800000; font-weight: normal;">\cos</span> x <span style="color: #800000; font-weight: normal;">\relat</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\leq</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">x=\<span style="color: #800000;">frac</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\pi</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">3</span><span style="color: #E02020; ">}}</span> <span style="color: #E02020; ">\</span><span style="color: #800000;">frac</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\sqrt</span>{@</span><span style="color: #E02020; ">}}{</span><span style="color: #2020C0; font-weight: normal;">2</span>}
\</span><span style="color: #E02020; ">]</span>
&nbsp;
<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>

<p>And the output for the example is<br />
<a href='http://www.guyrutenberg.com/wp-content/uploads/2008/04/relat-example.png'><img src="http://www.guyrutenberg.com/wp-content/uploads/2008/04/relat-example.png" alt="" title="relat-example" width="235" height="100" class="alignnone size-full wp-image-53" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2008/04/19/equality-at-and-relation-at-latex-macros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

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

