<?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>t-square &#187; LaTeX</title>
	<atom:link href="http://www.timteatro.net/tag/latex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.timteatro.net</link>
	<description>Pursuit of Inspiration, Imagination and Science.</description>
	<lastBuildDate>Mon, 01 Oct 2012 20:52:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>TeXLive 2012 on Ubuntu 12.04</title>
		<link>http://www.timteatro.net/2012/10/01/tex-live-2012-on-ubuntu-12-04/</link>
		<comments>http://www.timteatro.net/2012/10/01/tex-live-2012-on-ubuntu-12-04/#comments</comments>
		<pubDate>Mon, 01 Oct 2012 06:32:26 +0000</pubDate>
		<dc:creator>Tim Teatro</dc:creator>
				<category><![CDATA[Software & FOSS]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.timteatro.net/?p=1109</guid>
		<description><![CDATA[After years of wrestling with the out-of-date TeXLive packages with Ubuntu and Fedora, I started simply using the official TeXLive packages. It is easy and highly pleasurable to have completely up to date packages and a full set of package maintenance tools.]]></description>
				<content:encoded><![CDATA[<p>
After years of wrestling with the out-of-date TeXLive packages with Ubuntu and Fedora, I started simply using the official TeXLive packages. It is easy and highly pleasurable to have completely up to date packages and a full set of package maintenance tools.
</p>
<p>
Manually installing TeX Live is pretty simple. The hardest part is tricking Ubuntu&#8217;s package manager into knowing that TeX Live is installed without it having to have the copy from the repos.
</p>
<p>
To start, just download the small gzip <a href="http://www.tug.org/texlive/acquire-netinstall.html">from here</a>. Unpack it and change directory into it in a terminal.<br />
<code>sudo apt-get install perl-tk</code><br />
which you&#8217;ll need for the installer GUI. Now, run the installer:<br />
<code>sudo ./install-tl --gui</code>
</p>
<p>
Once you&#8217;re in the installer, go through the list of options. If you don&#8217;t know what they do, you probably don&#8217;t need to bother with it. The main one to look out for are A4 vs. Letter paper. I do generate the simlinks, but if you don&#8217;t can manually edit your PATH variable later. Hit the <i>install</i> button and go make yourself a sandwich. You&#8217;ll be a while.
</p>
<p>
At the end of the install, you&#8217;ll get the following message</p>
<blockquote><p>
    Add /usr/local/texlive/2012/texmf/doc/man to MANPATH.<br />
    Add /usr/local/texlive/2012/texmf/doc/info to INFOPATH.<br />
    Most importantly, add /usr/local/texlive/2012/bin/x86-linux<br />
    to your PATH for current and future sessions.
</p></blockquote>
<p>Note, you&#8217;ll get a message which reflects your architecture. (x86_64, for example.)
</p>
<p>
So, if you didn&#8217;t opt in to have the symlinks generated for you, you&#8217;ll have to add those directories to the path variable. Edit your bashrc:<br />
<code> gedit ~/.bashrc</code><br />
and added the following lines:</p>
<pre class="brush: plain; title: ; notranslate">
export PATH=$PATH:/usr/local/texlive/2012/bin/i386-linux
export MANPATH=$MANPATH:/usr/local/texlive/2012/texmf/doc/man
export INFOPATH=$INFOPATH:/usr/local/texlive/2012/texmf/doc/info
</pre>
</p>
<p>
Now, install a few more packages:<br />
<code>sudo apt-get install tex-common texinfo lmodern perl-tk</code><br />
Be sure to restart the terminal (or <code>source ~/.bashrc</code>) before you try using anything.
</p>
<p>
Now, if you try to bring anything from the repositories that depends on TeX Live, apt is going to pull over Ubuntu&#8217;s crappy copy. To avoid this, I created a meta package which checks off all of the TeX Live packages but doesn&#8217;t install anything.
</p>
<p>
I got the following from <a href="http://blogs.ethz.ch/ubuntu/2011/03/14/tex-live-2010-installation/">schlasim&#8217;s ubuntu blog</a>. First, paste and execute the following lines one at a time:</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install equivs
mkdir /tmp/tl-equivs &amp;&amp; cd /tmp/tl-equivs
equivs-control texlive-local
</pre>
<p>Now, edit the file texlive-local (<code>gedit texlive-local</code>), which was just created by the equivs-control program. Paste in the following lines:</p>
<pre class="brush: plain; title: ; notranslate">
Section: misc
Priority: optional
Standards-Version: 3.6.2
 
Package: texlive-local
Version: 2012-1~1
Maintainer: you 
Provides: biblatex, biblatex-dw, cm-super, cm-super-minimal, context, dvipng,
 feynmf, fragmaster, lacheck, latex-beamer, latex-cjk-all, latex-cjk-chinese,
 latex-cjk-chinese-arphic-bkai00mp, latex-cjk-chinese-arphic-bsmi00lp,
 latex-cjk-chinese-arphic-gbsn00lp, latex-cjk-chinese-arphic-gkai00mp,
 latex-cjk-common, latex-cjk-japanese, latex-cjk-japanese-wadalab,
 latex-cjk-korean, latex-cjk-thai, latex-cjk-xcjk, latexmk, latex-sanskrit,
 latex-xcolor, lcdf-typetools, lmodern, luatex, musixlyr, musixtex, pgf,
 preview-latex-style, prosper, ps2eps, psutils, purifyeps, t1utils, tex4ht,
 tex4ht-common, tex-gyre, texlive, texlive-base, texlive-base-bin,
 texlive-base-bin-doc, texlive-bibtex-extra, texlive-binaries, texlive-common,
 texlive-doc-base, texlive-doc-bg, texlive-doc-cs+sk, texlive-doc-de,
 texlive-doc-el, texlive-doc-en, texlive-doc-es, texlive-doc-fi,
 texlive-doc-fr, texlive-doc-it, texlive-doc-ja, texlive-doc-ko,
 texlive-doc-mn, texlive-doc-nl, texlive-doc-pl, texlive-doc-pt,
 texlive-doc-ru, texlive-doc-si, texlive-doc-th, texlive-doc-tr,
 texlive-doc-uk, texlive-doc-vi, texlive-doc-zh, texlive-extra-utils,
 texlive-fonts-extra, texlive-fonts-extra-doc, texlive-fonts-recommended,
 texlive-fonts-recommended-doc, texlive-font-utils, texlive-formats-extra,
 texlive-games, texlive-generic-extra, texlive-generic-recommended,
 texlive-humanities, texlive-humanities-doc, texlive-lang-african,
 texlive-lang-all, texlive-lang-arab, texlive-lang-arabic,
 texlive-lang-armenian, texlive-lang-croatian, texlive-lang-cyrillic,
 texlive-lang-czechslovak, texlive-lang-danish, texlive-lang-dutch,
 texlive-lang-finnish, texlive-lang-french, texlive-lang-german,
 texlive-lang-greek, texlive-lang-hebrew, texlive-lang-hungarian,
 texlive-lang-indic, texlive-lang-italian, texlive-lang-latin,
 texlive-lang-latvian, texlive-lang-lithuanian, texlive-lang-manju,
 texlive-lang-mongolian, texlive-lang-norwegian, texlive-lang-other,
 texlive-lang-polish, texlive-lang-portuguese, texlive-lang-spanish,
 texlive-lang-swedish, texlive-lang-tibetan, texlive-lang-ukenglish,
 texlive-lang-vietnamese, texlive-latex3, texlive-latex-base,
 texlive-latex-base-doc, texlive-latex-extra, texlive-latex-extra-doc,
 texlive-latex-recommended, texlive-latex-recommended-doc, texlive-luatex,
 texlive-math-extra, texlive-metapost, texlive-metapost-doc, texlive-music,
 texlive-omega, texlive-pictures, texlive-pictures-doc, texlive-plain-extra,
 texlive-pstricks, texlive-pstricks-doc, texlive-publishers,
 texlive-publishers-doc, texlive-science, texlive-science-doc, texlive-xetex,
 texpower, texpower-manual, thailatex, tipa, ttf-freefont, ttf-gfs-artemisia,
 ttf-gfs-baskerville, ttf-gfs-bodoni-classic, ttf-gfs-didot,
 ttf-gfs-didot-classic, ttf-gfs-gazis, ttf-gfs-neohellenic, ttf-gfs-olga,
 ttf-gfs-porson, ttf-gfs-solomos, ttf-gfs-theokritos, ttf-sil-gentium, xindy,
 xindy-rules
Architecture: all
Description: My local installation of TeX Live 2011.
 A full &quot;vanilla&quot; TeX Live 2011

http://tug.org/texlive/debian#vanilla

</pre>
<p>Now, finish off by executing the last two lines:</p>
<pre class="brush: plain; title: ; notranslate">
equivs-build texlive-local
sudo dpkg -i texlive-local_2011-1~1_all.deb
</pre>
</p>
<p>
You should now be able to maintain your own TeX Live installation. You can update or install packages as you see fit, and you don&#8217;t have to deal with out of date packages causing you frustration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.timteatro.net/2012/10/01/tex-live-2012-on-ubuntu-12-04/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>TeXtext for Math in Inkscape</title>
		<link>http://www.timteatro.net/2010/08/05/textext-for-math-in-inkscape/</link>
		<comments>http://www.timteatro.net/2010/08/05/textext-for-math-in-inkscape/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 16:42:27 +0000</pubDate>
		<dc:creator>Tim Teatro</dc:creator>
				<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[Software & FOSS]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://www.timteatro.net/?p=552</guid>
		<description><![CDATA[Recent versions of Inkscape have functionality for creating math from LaTeX code, but its functionality is limited. If you want a more powerful system which creates an editable (and re-editable) latex object with support for loading custom packages and definitions, then you want  <a href="http://pav.iki.fi/software/textext/">TeXtext</a> [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.timteatro.net/wp-content/uploads/2010/08/textext_for_math_in_inkscape.png" alt="" title="textext_for_math_in_inkscape" width="200" height="240" class="alignleft size-full wp-image-554" />Recent versions of Inkscape have functionality for creating math from LaTeX code, but its functionality is limited. If you want a more powerful system which creates an editable (and re-editable) latex object with support for loading custom packages and definitions, then you want  <a href="http://pav.iki.fi/software/textext/">TeXtext</a>. See the screenshot below.</p>
<h3>Update:</h3>
<p>As of the new Inkscape 0.48, the LaTeX extension seems to work very well. I didn&#8217;t see anything that let me put in place a custom preamble, but you can load packages. So for most tasks, the packaged LaTeX extension that comes with Inkscape 0.48 works very well!</p>
<hr />
<br/></p>
<p>Installation is straightforward. You&#8217;ll need to have a TeX distribution installed. I usually have the full TeX Live metapackage from my distro. In the case of Ubuntu, it&#8217;s just<br />
<code><br />
sudo apt-get install texlive-full<br />
</code><br />
Now you can go through the business of installing TeXtext. Start by installing the dependencies, which are</p>
<ul>
<li>Pstoedit with its plot-svg back-end compiled in, or,</li>
<li>Pstoedit and Skconvert, or,</li>
<li>Pdf2svg (the one by David Barton &#038; Matthew Flaschen, not the one by PDFtron) and </li>
<li>lxml Python library</li>
</ul>
<p><div id="attachment_557" class="wp-caption alignright" style="width: 160px"><a href="http://www.timteatro.net/wp-content/uploads/2010/08/textext_screenshot.png"><img src="http://www.timteatro.net/wp-content/uploads/2010/08/textext_screenshot-150x150.png" alt="" title="textext_screenshot" width="150" height="150" class="size-thumbnail wp-image-557" /></a><p class="wp-caption-text">Screenshot of TeXtext in action.</p></div><br />
Again in Ubuntu, this can be done with<br />
<code><br />
sudo apt-get install pstoedit pdf2svg python-lxml<br />
</code><br />
I find that just having pstoedit doesn&#8217;t work, despite the fact that the plot-svg driver works fine. Now, <a href="http://pav.iki.fi/software/textext/">download</a> and extract the TeXtext files, and place them in <code>~/.config/inkscape/extensions/</code>.</p>
<p>To install under Windows, check out the instructions on the <a href="http://pav.iki.fi/software/textext/">TeXtext website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.timteatro.net/2010/08/05/textext-for-math-in-inkscape/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>GNUPLOT+TikZ For Stunning LaTeX Plots.</title>
		<link>http://www.timteatro.net/2010/07/18/gnuplottikz-for-stunning-latex-plots/</link>
		<comments>http://www.timteatro.net/2010/07/18/gnuplottikz-for-stunning-latex-plots/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 03:54:42 +0000</pubDate>
		<dc:creator>Tim Teatro</dc:creator>
				<category><![CDATA[Headline]]></category>
		<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[GNUPLOT]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://www.timteatro.net/?p=402</guid>
		<description><![CDATA[GNUPLOT has a range of terminals that work with LaTeX, including a LaTeX terminal. If you're using system fonts and XeLaTeX, then the pdf terminal can do a very nice job, but if you're using fonts in your document that are installed with LaTeX, then only one terminal can suit my standards: the <em>TikZ terminal</em>.]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.timteatro.net/wp-content/uploads/2010/07/GNUPLOT_tikz_plot_perspective.jpg" alt="GNUPLOT with tikz" title="GNUPLOT_tikz_plot_perspective" width="200" height="312" class="alignleft size-full wp-image-406" /> When it comes to graphics in my publications and presentations, I have incredibly high standards. I do most of my documents and slides in LaTeX. So when I create plots, I demand that plotting software that has sophisticated integration with LaTeX and the ability to create stunning and clean visuals. For me, that software is without a doubt <a href="http://www.gnuplot.info" target="_blank">GNUPLOT</a>.</p>
<p>GNUPLOT has a range of terminals that work with LaTeX, including a LaTeX terminal. If you&#8217;re using system fonts and XeLaTeX, then the pdf terminal can do a very nice job, but if you&#8217;re using fonts in your document that are installed with LaTeX, then only one terminal can suit my standards: the <em>TikZ terminal</em>.</p>
<p><a href="http://sourceforge.net/projects/pgf/" target="_blank">PGF and TikZ</a> are a macro package and syntax layer (respectively) for creating graphics in LaTeX. The TikZ syntax is sophisticated and human readable. If you do a lot of presentation work with LaTeX, then it&#8217;s well worth your time to learn the basics. But we don&#8217;t need to know anything more about them to use the TikZ terminal in GNUPLOT.</p>
<p>The GNUPLOT installed by your distribution&#8217;s package manager probably doesn&#8217;t have this terminal. You&#8217;ll probably need to compile GNUPLOT from scratch, being careful to link to the LUA libraries since the TikZ terminal is built on the LUA terminal. This isn&#8217;t so bad, and I have written a <a href="http://www.timteatro.net/2010/07/17/compiling-gnuplot-from-cvs-with-ubuntu/" target="_blank">tutorial to walk you through compiling the CVS version of GNUPLOT</a>.</p>
<h2> Standalone vs. Copy-and-Paste Output </h2>
<p>The TikZ terminal has two modes of output. The standalone mode prints out a document that can be simply run through pdfLaTeX producing a pdf file that can be imported into your LaTeX document. The default mode of the terminal, however, prints out the text to generate the plot within a <i>tikzpicture</i> environment.</p>
<p>Both of these are useful depending on the size of your document and the number of plots you have. Compiling these plots within your document can take quite a bit of LaTeX&#8217;s memory, so if you have more than a few plots, you can actually exhaust the limit of TeX&#8217;s memory. You can expand TeX&#8217;s memory (not recommended), but this results in documents which take several minutes to compile. So make your choice.</p>
<h2>Working with Standalone Output</h2>
<p>So let&#8217;s try this out. From the command-line, make a new directory, <i>cd</i> into it, and run GNUPLOT. Type in the following code:</p>
<pre class="brush: plain; title: ; notranslate">
set term tikz standalone color solid size 5in,3in
set output &quot;sin.tex&quot;
set xrange [0:2*pi]
plot sin(x) with lines
exit
</pre>
<p>That code switches the terminal to tikz in standalone mode with colour and solid lines, and defines the plot size to be 5&#8243;x3&#8243;. Next, we set the destination of the output to be the file &#8220;sin.tex&#8221;. Then we set the range of the plot to be between zero and two-pi, and finally, we plot sin(x). Remember to <i>exit</i> GNUPLOT so that it finishes its output to sin.tex. Here is a listing of the sin.tex output file:</p>
<pre class="brush: plain; title: ; notranslate">
\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}

\usepackage[utf8x]{inputenc}

\usepackage{gnuplot-lua-tikz}
\pagestyle{empty}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{2mm}


\begin{document}

\begin{tikzpicture}[gnuplot]
%% generated with GNUPLOT 4.5p0 (Lua 5.1.4; terminal rev. 97, script rev. 96a)
%% Sat 17 Jul 2010 09:00:38 PM EDT
\gpsolidlines
\gpcolor{gp lt color border}
\gpsetlinetype{gp lt border}
\gpsetlinewidth{1.00}
\draw[gp path] (1.196,0.616)--(1.376,0.616);
\draw[gp path] (12.147,0.616)--(11.967,0.616);
\node[gp node right] at (1.012,0.616) {-1};
\draw[gp path] (1.196,1.279)--(1.376,1.279);
\draw[gp path] (12.147,1.279)--(11.967,1.279);
\node[gp node right] at (1.012,1.279) {-0.8};
\draw[gp path] (1.196,1.943)--(1.376,1.943);
\draw[gp path] (12.147,1.943)--(11.967,1.943);
\node[gp node right] at (1.012,1.943) {-0.6};

...

  --(8.386,1.171)--(8.497,1.060)--(8.607,0.961)--(8.718,0.874)--(8.829,0.798)--(8.939,0.736)%
  --(9.050,0.686)--(9.160,0.650)--(9.271,0.626)--(9.382,0.616)--(9.492,0.620)--(9.603,0.636)%
  --(9.713,0.666)--(9.824,0.710)--(9.935,0.766)--(10.045,0.834)--(10.156,0.916)--(10.267,1.009)%
  --(10.377,1.115)--(10.488,1.231)--(10.598,1.359)--(10.709,1.496)--(10.820,1.644)--(10.930,1.801)%
  --(11.041,1.967)--(11.151,2.140)--(11.262,2.321)--(11.373,2.508)--(11.483,2.701)--(11.594,2.898)%
  --(11.705,3.100)--(11.815,3.306)--(11.926,3.514)--(12.036,3.723)--(12.147,3.933);
\gpcolor{gp lt color border}
\gpsetlinetype{gp lt border}
\draw[gp path] (1.196,7.251)--(1.196,0.616)--(12.147,0.616)--(12.147,7.251)--cycle;
%% coordinates of the plot area
\gpdefrectangularnode{gp plot 1}{\pgfpoint{1.196cm}{0.616cm}}{\pgfpoint{12.147cm}{7.251cm}}
\end{tikzpicture}
%% gnuplot variables
\end{document}
</pre>
<p>Now, run <i>pdflatex sin.tex</i>, which should produce the file sin.pdf. You can open sin.pdf to check it out, and notice that the font is Knuth&#8217;s Computer Modern Roman, which is the default in TeX/LaTeX. If you want to, you can now use the standard <i>\includegraphics{sin.pdf}</i> from the <i>graphicx</i> package from within a LaTeX document to include this plot in your document.</p>
<p>If, however, you use fonts other than the default, you need to take one more step to be sure that you use those fonts when compiling your standalone plots. The TikZ terminal accepts the <i>header</i> option which allows us to specify some extra code in the preamble of the standalone document. For example, I often use the <a href="http://www.ctan.org/tex-archive/help/Catalogue/entries/txfonts.html" target="_blank">txfonts</a> package, so in gnuplot, I would have</p>
<pre class="brush: plain; title: ; notranslate">
set term tikz standalone color solid size 5in,3in header &quot;\\usepackage{txfonts}&quot;
</pre>
<p>Notice the double backslash (\\) above. This is because we need to escape the slash and other special characters. Take a look at the resulting output, and notice on line 4, we have our new font specification.</p>
<pre class="brush: plain; title: ; notranslate">
...
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{2mm}
\usepackage{txfonts}


\begin{document}
...
</pre>
<h2>Non-Standalone Output</h2>
<p>If you don&#8217;t specify <i>standalone</i> to the terminal, then by default it will output code that you can simply output to a tex file, and <i>\include{file.tex}</i> in your document, or straight copy and paste directly into your document. If you do this, you will need to include, in the preamble of your document:</p>
<pre class="brush: plain; title: ; notranslate">
 \usepackage{gnuplot-lua-tikz}
</pre>
<p>Let&#8217;s try an example. We can use the example from the last section to generate sin.tex, but <em>without</em> the standalone declaration:</p>
<pre class="brush: plain; title: ; notranslate">
gnuplot&gt; set term tikz color solid size 5in,3in
Terminal type set to 'tikz'
Options are 'color solid'
gnuplot&gt; set output &quot;sin.tex&quot;
gnuplot&gt; set xr [0:2*pi]
gnuplot&gt; plot sin(x) with lines
gnuplot&gt; exit
</pre>
<p>Now execute the above code in GNUPLOT, then create another .tex document with the following code.</p>
<pre class="brush: plain; title: ; notranslate">
\documentclass{article}
   \usepackage{gnuplot-lua-tikz}

\begin{document}
Hello World!

There is a plot up top!
\begin{figure}
   \include{sin}
   \caption{TikZ plot from GNUPLOT!}
\end{figure}
\end{document}
</pre>
<p>Compile this code with LaTeX or pdfLaTeX and you should get a document which says Hello world, and has the floating figure.</p>
<h2>Final Words</h2>
<p>Of course, the terminal can handle much more complicated figures, but this should get you started. If you&#8217;d like more resources and tools for TikZ, <a href="http://www.texample.net/tikz/resources/" target="_blank">click here</a>.</p>
<div class="clearfloat"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.timteatro.net/2010/07/18/gnuplottikz-for-stunning-latex-plots/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>
