<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Shareef Dabdoub</title><link href="http://dabdoub.net/shareef" rel="alternate"></link><link href="http://dabdoub.net/shareef/feeds/all.atom.xml" rel="self"></link><id>http://dabdoub.net/shareef</id><updated>2012-05-19T18:30:00Z</updated><entry><title>Converting MATLAB to Python: Matrices</title><link href="http://dabdoub.net/shareef/converting-matlab-to-python-matrices.html" rel="alternate"></link><updated>2012-05-19T18:30:00Z</updated><author><name>Shareef M. Dabdoub</name></author><id>tag:dabdoub.net,2012-05-19:/shareef/converting-matlab-to-python-matrices.html/</id><summary type="html">&lt;p&gt;...&lt;/p&gt;
</summary></entry><entry><title>Horizontal centering for the HTML5 canvas element</title><link href="http://dabdoub.net/shareef/horizontal-centering-for-the-html5-canvas-element.html" rel="alternate"></link><updated>2012-05-19T18:30:00Z</updated><author><name>Shareef M. Dabdoub</name></author><id>tag:dabdoub.net,2012-05-19:/shareef/horizontal-centering-for-the-html5-canvas-element.html/</id><summary type="html">&lt;p&gt;Normally for a block-level element, centering it on the page can be achieved by the
following CSS:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
margin: 0px auto;
&lt;/pre&gt;
&lt;p&gt;which, using the shorthand property, tells the browser to set no margin for the top and
bottom, and to automatically calculate the left and right margins. The auto property has
the nice effect of centering the element within the parent (in the basic case, the browser
window).&lt;/p&gt;
&lt;p&gt;Unfortunately, applying this directly to the style of the canvas element does not work
to center it. The &lt;a class="reference external" href="http://jsfiddle.net/kq3n9/"&gt;solution&lt;/a&gt; is to wrap the canvas element in a div with the auto margin
property and set to the same width as the canvas element:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
&amp;lt;div style=&amp;quot;width: 200px; margin: auto;&amp;quot;&amp;gt;
    &amp;lt;canvas style=&amp;quot;width: 200px; height: 200px; margin: 0px auto; border: solid 1px; background-color: #AAA;&amp;quot;&amp;gt;&amp;lt;/canvas&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;p&gt;If you're worried about backwards compatibility (specifically IE5/Win) there is a
&lt;a class="reference external" href="http://bluerobot.com/web/css/center1.html"&gt;workaround&lt;/a&gt;.&lt;/p&gt;
</summary></entry><entry><title>Making TeXShop aware of the TEXINPUTS environment variable</title><link href="http://dabdoub.net/shareef/making-texshop-aware-of-the-texinputs-environment-variable.html" rel="alternate"></link><updated>2012-05-16T14:30:00Z</updated><author><name>Shareef M. Dabdoub</name></author><id>tag:dabdoub.net,2012-05-16:/shareef/making-texshop-aware-of-the-texinputs-environment-variable.html/</id><summary type="html">&lt;p&gt;Sorry, it can't be done.&lt;/p&gt;
&lt;p&gt;Not yet anyway, unless you want to contact &lt;a class="reference external" href="mailto:koch&amp;#64;math.uoregon.edu"&gt;Richard Koch&lt;/a&gt;, the primary
developer of &lt;a class="reference external" href="http://pages.uoregon.edu/koch/texshop/"&gt;TeXShop&lt;/a&gt;, and ask very nicely.&lt;/p&gt;
&lt;p&gt;So to back up a bit first, the basic problem we want to solve is this:
There are some TeX or BibTeX style files or just some common image or
other files that we want general include to when writing documents. It's
ugly and a hassle to copy those files alongside the current document
you're working on, so TeX provides the TEXINPUTS environment variable
that you can point to a directory or a list of directories that such
files exist in:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
export TEXINPUTS=&amp;quot;~/folder:/other_folder:&amp;quot;
&lt;/pre&gt;
&lt;p&gt;While this works great for compiling documents from the command line, or
environment variable-aware editors, unfortunately TeXShop does not check
environment variables.&lt;/p&gt;
&lt;p&gt;What you &lt;em&gt;can&lt;/em&gt; do, however, is make use of the Tex Directory Structure
(TDS) which &lt;em&gt;is&lt;/em&gt; supported by TeXShop. The official recommendation for the
TDS root is &lt;a class="reference external" href="http://tug.org/tds/tds.html#Rooting-the-tree"&gt;texmf&lt;/a&gt; (for &amp;quot;Tex and Metafont&amp;quot;). TeXShop expects this
directory to be under ~/Library. For our purposes, the relevant directory
structure should look like:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
~/Library/texmf
~/Library/texmf/tex
~/Library/texmf/tex/latex
&lt;/pre&gt;
&lt;p&gt;According to the &lt;a class="reference external" href="http://tug.org/mactex/faq/#qm04"&gt;tug.org mactex FAQ&lt;/a&gt;, TeX will search for your  files
in the tex/ directory and LaTeX will search the tex/latex folder. I
haven't tested this extensively, but TeXShop appears to have no problem
finding files/directories under either tex/ or tex/latex when compiling
with LateX. Note that you may have to create this directory structure
yourself.&lt;/p&gt;
&lt;p&gt;If you have an existing directory full of your common files that you don't
want to move, no problem! symlink!&lt;/p&gt;
&lt;pre class="literal-block"&gt;
&amp;gt; cd ~/Library/texmf/tex/latex
&amp;gt; ln -s ~/path/to/shared/files/dir shared
&lt;/pre&gt;
&lt;p&gt;This command will create a symbolic link (essentially a redirection),
which looks like a folder and acts like a folder, but actually points
somewhere else on the disk (to remove it the &lt;em&gt;rm&lt;/em&gt; command works).&lt;/p&gt;
</summary></entry></feed>