<?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>The Linux Daily</title>
	<atom:link href="http://www.thelinuxdaily.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thelinuxdaily.com</link>
	<description>Tutorials, Guides, Tips, and Tricks from Everyday Experiences</description>
	<lastBuildDate>Tue, 03 Jan 2012 19:54:41 +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>Reinstalled WordPress</title>
		<link>http://www.thelinuxdaily.com/2011/12/reinstalled-wordpress/</link>
		<comments>http://www.thelinuxdaily.com/2011/12/reinstalled-wordpress/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 22:50:59 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.derekhildreth.com/tld/?p=2506</guid>
		<description><![CDATA[After many failed attempts at removing some bad code somewhere in one of my wordpress blogs, I decided to delete the entire wordpress installation and start with a fresh one. This time I&#8217;m using some security themed plugins and being much more selective on the themes that I include. Please bear with me as I [...]]]></description>
			<content:encoded><![CDATA[<p>After many failed attempts at removing some bad code somewhere in one of my wordpress blogs, I decided to delete the entire wordpress installation and start with a fresh one.  This time I&#8217;m using some security themed plugins and being much more selective on the themes that I include.  <del datetime="2011-12-11T02:05:30+00:00">Please bear with me as I try to get the site back to its original state.<br />
</del><br />
We should be pretty much good to go now.  I&#8217;m confident things will be smoother from here on out.  By the way, if any of you have any suggestions for beefing up security on a wordpress blog, please let me know in the comments!</p>
<p>Best Regards,<br />
Derek</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/12/reinstalled-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site Downtime</title>
		<link>http://www.thelinuxdaily.com/2011/11/site-downtime/</link>
		<comments>http://www.thelinuxdaily.com/2011/11/site-downtime/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 06:39:04 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2502</guid>
		<description><![CDATA[There was a major hardware failure at the hosting facilities over Thanksgiving weekend which took down (and wiped clean) everything on this site. Luckily, the staff were able to salvage the hard drive from the old server and transfer everything to the new hardware. This does take some time to transfer. We&#8217;re hoping that by [...]]]></description>
			<content:encoded><![CDATA[<p>There was a major hardware failure at the hosting facilities over Thanksgiving weekend which took down (and wiped clean) everything on this site.  Luckily, the staff were able to salvage the hard drive from the old server and transfer everything to the new hardware.  This does take some time to transfer.  We&#8217;re hoping that by tomorrow, things will be fully transferred and back to normal.  In the meantime, please forgive any oddities or speed issues as you browse.  They should be cleared up soon.  If you do find something that you need immediately, please feel free to use the comment form below.</p>
<p>Best Regards,<br />
Derek  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/11/site-downtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Thanksgiving!</title>
		<link>http://www.thelinuxdaily.com/2011/11/happy-thanksgiving/</link>
		<comments>http://www.thelinuxdaily.com/2011/11/happy-thanksgiving/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 14:00:26 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[thanksgiving]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2494</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://www.thelinuxdaily.com/wp-content/uploads/2011/11/tux_thanksgiving.gif"><img src="http://www.thelinuxdaily.com/wp-content/uploads/2011/11/tux_thanksgiving.gif" alt="" title="tux_thanksgiving" width="347" height="208" class="aligncenter size-full wp-image-2495" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/11/happy-thanksgiving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with Python Unit Testing (pyUnit)</title>
		<link>http://www.thelinuxdaily.com/2011/11/getting-started-with-python-unit-testing-pyunit/</link>
		<comments>http://www.thelinuxdaily.com/2011/11/getting-started-with-python-unit-testing-pyunit/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 14:00:17 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyunit]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2464</guid>
		<description><![CDATA[The following sections give quick, heavily commented, and ready-to-run examples that will give you a head start in creating a unit test framework in Python (pyUnit). First, we&#8217;ll take a look at a standalone module with several simple examples of unit tests. Then, we&#8217;ll take a look at a more complicated version that uses modules [...]]]></description>
			<content:encoded><![CDATA[<p>The following sections give quick, heavily commented, and ready-to-run examples that will give you a head start in creating a unit test framework in Python (<a href="http://pyunit.sourceforge.net/" target="_blank">pyUnit</a>).  First, we&#8217;ll take a look at a standalone module with several simple examples of unit tests.  Then, we&#8217;ll take a look at a more complicated version that uses modules and test suites.</p>
<p>Here&#8217;s the first example.  As long as you are running Python version 2.1 or greater, you can copy/paste this code, save it to <em>unittest.py</em>, and run it using <code>python unittest.py</code>.</p>
<pre>
'''This is a simple program to demonstrate how to create a unittest in
Python. For more information and documentation, please see the official
documentation page here: http://docs.python.org/library/unittest.html'''

import unittest #Include the pyUnit unittest framework

def add(a,b,c=0):
   '''A simple adding function to demo unittest'''
   return a+b+c

# The following is the class in which all functions will be ran by unittest
class AddTest(unittest.TestCase):
   ''' Main class for add testing; Can be added to a suite'''

   # The function &quot;setUp&quot; will always be ran in order to setup the
   # test environment before all the tests have run.
   def setUp(self):
      '''Verify environment is setup properly''' # Printed if test fails
      pass

   # The function &quot;tearDown&quot; will always be ran in order to cleanup the
   # test environment after all the tests have run.
   def tearDown(self):
      '''Verify environment is tore down properly''' # Printed if test fails
      pass

   # Functions beginning with &quot;test&quot; will be ran as a unit test.
   def test_positive_add(self):
      '''Verify that adding positive numbers works''' # Printed if test fails
      self.assertEqual(add(10,23,22), 55) # Test will fail if &quot;false&quot; (boolean)
      self.assertEqual(add(11,23), 34)
      self.assertEqual(add(1,1,17), 19)

   # Functions beginning with &quot;test&quot; will be ran as a unit test.
   # @unittest.skip(&quot;demonstrating skipping&quot;) # Skip this test (Python &gt;= 2.7)
   def test_negative_add(self):
      '''Verify that adding negative numbers works''' # Printed if test fails
      self.assertEqual(add(-12,23), 11)

   # Functions beginning with &quot;test&quot; will be ran as a unit test.
   # In this case, this test will be skipped.
   #@unittest.skip(&quot;demonstrating skipping&quot;)
   def test_negative_add_skip(self):
      '''Verify that adding negative numbers works''' # Printed if test fails
      self.assertEqual(add(-12,23), 11)

if __name__=='__main__':
   unittest.main()
</pre>
<p>For more complicated test suites and modularity, please take a look at the git repository I&#8217;ve setup on bitbucket.org.  Download the source, read the README file, and you&#8217;ll be able to have a working example of a testsuite (run with <code>python pyunit_intro/suite/test/unittest_run_all.py</code>).</p>
<p><a href="https://bitbucket.org/dhildreth/pyunit_intro" title="pyunit_intro on bitbucket.org" target="_blank">https://bitbucket.org/dhildreth/pyunit_intro</a></p>
<p>Source: Much of the code from above was done first in <a href="http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2010-introduction-to-unittest-a-k-a-pyunit-96-3379016" target="_blank">this great introductory presentation</a> given by Chander K. Ganesan at PyCon 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/11/getting-started-with-python-unit-testing-pyunit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find/Highlight Lines Longer Than 80 or &#8216;n&#8217; Characters in VIM</title>
		<link>http://www.thelinuxdaily.com/2011/11/findhighlight-lines-longer-than-80-or-n-characters-in-vim/</link>
		<comments>http://www.thelinuxdaily.com/2011/11/findhighlight-lines-longer-than-80-or-n-characters-in-vim/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 21:17:02 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2467</guid>
		<description><![CDATA[Here&#8217;s a quickie that will help you find lines longer than 80 characters (or any number of characters) within VIM. Open vim, and copy/paste the following: :/.{80,} You can use the regex anywhere, actually, but this is a good one to store in the useful command list. Or, create an alias for it in your [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quickie that will help you find lines longer than 80 characters (or any number of characters) within VIM.  Open vim, and copy/paste the following:</p>
<p></p>
<p><code>:/.{80,}</code></p>
<p>You can use the regex anywhere, actually, but this is a good one to store in the useful command list.  Or, create an alias for it in your .vimrc file for quick access.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/11/findhighlight-lines-longer-than-80-or-n-characters-in-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>For the U.S. Folks, Happy Labor Day</title>
		<link>http://www.thelinuxdaily.com/2011/09/for-the-u-s-folks-happy-labor-day/</link>
		<comments>http://www.thelinuxdaily.com/2011/09/for-the-u-s-folks-happy-labor-day/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 13:00:19 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[labor day]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2460</guid>
		<description><![CDATA[For many, Labor Day marks the end of summer and the beginning of fall and winter. Anybody else looking forward to this again? Be safe. Have fun. Oh, and get outside while you still can! Best Regards, Derek]]></description>
			<content:encoded><![CDATA[<p>For many, Labor Day marks the end of summer and the beginning of fall and winter.  Anybody else looking forward to this again?<br />
<p><a href="http://www.thelinuxdaily.com/2011/09/for-the-u-s-folks-happy-labor-day/"><em>Click here to view the embedded video.</em></a></p><br />
<p><a href="http://www.thelinuxdaily.com/2011/09/for-the-u-s-folks-happy-labor-day/"><em>Click here to view the embedded video.</em></a></p></p>
<p>Be safe.  Have fun.  Oh, and get outside while you still can!</p>
<p>Best Regards,<br />
Derek</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/09/for-the-u-s-folks-happy-labor-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Arrays and For Loops</title>
		<link>http://www.thelinuxdaily.com/2011/09/using-arrays-and-for-loops-in-the-shell/</link>
		<comments>http://www.thelinuxdaily.com/2011/09/using-arrays-and-for-loops-in-the-shell/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 13:00:38 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[space]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2455</guid>
		<description><![CDATA[Here&#8217;s how to setup an array and use it in a for loop. Open up the terminal and let&#8217;s get started&#8230; Step 1: Create an array This is easily done by surround space separated items in parenthesis. For example: files=( dir1/file1.php dir2/file2.php dir1/subdir/file3.php ) Note: Be aware of any spaces within the array items. If [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to setup an array and use it in a for loop.  Open up the terminal and let&#8217;s get started&#8230;</p>
<h3><span style="color: #800000;">Step 1: Create an array</span></h3>
<p>This is easily done by surround <strong>space</strong> separated items in parenthesis.  For example:</p>
<pre>files=( dir1/file1.php dir2/file2.php dir1/subdir/file3.php )</pre>
<p>Note: Be aware of any spaces within the array items.  If you have this, you&#8217;ll need to surround it in quotes.  See appendix at the end of this post.</p>
<h3><span style="color: #800000;">Step 2: Figure out what you want to do to each of the items in the array</span></h3>
<p>The next part is figuring out what you want to do to each of the items in the array.  Keep in mind, these items can be variables, filenames, text, numbers, whatever.  For example, I want to see how large each of these files are along with other information.  For this, I would run <code>ls -lh filename.php</code> </p>
<pre>Unix~ ls -lh dir1/file1.php
-rw-r--r-- 1 user group 2.7K May  4 16:47 dir1/file1.php
</pre>
<h3><span style="color: #800000;">Step 3: Iterate through the list of array items</span></h3>
<p>Finally, let&#8217;s perform the action from step 2 on all of the items in our array.  For this, the key is to use ${array[@]}, which says run through all (@ll) of the items in the array called &#8220;array&#8221;.  Going along with the contrived, simple example set in the previous steps, the final command is:</p>
<pre>for file in ${files[@]}; do ls -lh $file; done</pre>
<p>The output from the above command is:</p>
<pre>
Unix~ for file in ${files[@]}; do ls -lh $file; done
-rw-r--r-- 1 user group 2.7K May  4 16:47 dir1/file1.php
-rw-rw-r-- 1 user group 2.8K Aug 25 15:23 dir2/file2.php
-rw-r--r-- 1 user group 2.4K Mar  7 19:57 dir1/subdir/file3.php
</pre>
<h3><span style="color: #800000;">APPENDIX: Working with spaces in array items</span></h3>
<p>If you have spaces within your array items, be sure to surround them with quotes like such:</p>
<pre>test=( one &quot;two 2&quot; &quot;three 3 tree&quot; )</pre>
<p>On top of that, you&#8217;ll need to surround ${test[@]} in quotes like such:</p>
<pre>for i in &quot;${test[@]}&quot;; do echo $i; done</pre>
<p>Here&#8217;s what you&#8217;ll get:</p>
<pre>Unix~ for i in &quot;${test[@]}&quot;; do echo &quot;==&gt; $i&quot;; done
==&gt; one
==&gt; two 2
==&gt; three 3 tree
</pre>
<p>If you don&#8217;t use quotes, you&#8217;ll get this instead (BAD!):</p>
<pre>for i in ${test[@]}; do echo &quot;==&gt; $i&quot;; done
==&gt; one
==&gt; two
==&gt; 2
==&gt; three
==&gt; 3
==&gt; tree
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/09/using-arrays-and-for-loops-in-the-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove a File / Directory from a Tarball Without Extracting First</title>
		<link>http://www.thelinuxdaily.com/2011/08/remove-a-file-directory-from-a-tarball-without-extracting-first/</link>
		<comments>http://www.thelinuxdaily.com/2011/08/remove-a-file-directory-from-a-tarball-without-extracting-first/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 13:00:48 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tarball]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2435</guid>
		<description><![CDATA[If you have an extra folder or file within a tarball (.tar) file, you can remove it without extracting the entire tarball first. This can be really handy when you have a massive file that you don&#8217;t want to spend a lot of time extracting and re-archiving. Open up a terminal shell and follow along [...]]]></description>
			<content:encoded><![CDATA[<p>If you have an extra folder or file within a tarball (.tar) file, you can remove it without extracting the entire tarball first.  This can be really handy when you have a massive file that you don&#8217;t want to spend a lot of time extracting and re-archiving.  Open up a terminal shell and follow along with the example below.</p>
<p>We&#8217;ll first see what&#8217;s in the compressed tarball named sandbox.tar.gz by using the <code>--list</code> option of <code>tar</code>:</p>
<pre>
thelinuxdaily$ tar --list --file=sandbox.tar.gz
sandbox/
sandbox/delete_me/
sandbox/delete_me/hello.txt
sandbox/hello.txt
sandbox/hello2.txt
sandbox/hello3.txt
sandbox/save_me/
sandbox/save_me/hello.txt
</pre>
<p>Let&#8217;s try to delete the folder called <em>sandbox/delete_me</em> from the compressed tarball:</p>
<pre>
thelinuxdaily$ tar --delete --file=sandbox.tar.gz sandbox/delete_me
tar: Cannot update compressed archives
tar: Error is not recoverable: exiting now
</pre>
<p>See what happened?  That means we need to uncompress it.  In this case, it&#8217;s a .gz compression type, so we&#8217;ll use <code>gunzip</code> (if you were using bz2, you&#8217;d use <code>bunzip2</code>:</p>
<pre>
thelinuxdaily$ gunzip sandbox.tar.gz
</pre>
<p>Let&#8217;s try to delete the folder <em>sandbox/delete_me</em> again:</p>
<pre>
thelinuxdaily$ tar --delete --file=sandbox.tar sandbox/delete_me
</pre>
<p>We didn&#8217;t get an error message, so that&#8217;s good.  Let&#8217;s see if it&#8217;s gone by using <code>--list</code> again:</p>
<pre>
thelinuxdaily$ tar --list --file=sandbox.tar
sandbox/
sandbox/hello.txt
sandbox/hello2.txt
sandbox/hello3.txt
sandbox/save_me/
sandbox/save_me/hello.txt
thelinuxdaily$ gzip sandbox.tar
</pre>
<p>Excellent!  That&#8217;s what we needed to see.  If you have any other tips, feel free to use the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/08/remove-a-file-directory-from-a-tarball-without-extracting-first/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Happy 20th Birthday Linux!</title>
		<link>http://www.thelinuxdaily.com/2011/08/happy-20th-birthday-linux/</link>
		<comments>http://www.thelinuxdaily.com/2011/08/happy-20th-birthday-linux/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 17:06:20 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[20th]]></category>
		<category><![CDATA[birthday]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2437</guid>
		<description><![CDATA[It all started with an email to a mailing list about an operating system that wasn&#8217;t going to be &#8220;big and professional like gnu&#8221;. So, happy birthday to Linux as of 25 Aug 91 20:57:08 GMT. Thanks for the good times so far! Be sure to check out the special 20th anniversary page on The [...]]]></description>
			<content:encoded><![CDATA[<p>It all started with an <a href="http://www.thelinuxdaily.com/2010/04/the-first-linux-announcement-from-linus-torvalds/">email to a mailing list</a> about an operating system that wasn&#8217;t going to be &#8220;big and professional like gnu&#8221;.  So, happy birthday to Linux as of 25 Aug 91 20:57:08 GMT.  Thanks for the good times so far!</p>
<p>Be sure to check out the special 20th anniversary page on The Linux Foundation&#8217;s page here:</p>
<p>http://www.linuxfoundation.org/20th/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/08/happy-20th-birthday-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Build a .tex File to .pdf on Linux</title>
		<link>http://www.thelinuxdaily.com/2011/08/how-to-build-a-tex-file-to-pdf-on-linux/</link>
		<comments>http://www.thelinuxdaily.com/2011/08/how-to-build-a-tex-file-to-pdf-on-linux/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 13:00:16 +0000</pubDate>
		<dc:creator>Derek@TheDailyLinux</dc:creator>
				<category><![CDATA[Tutorials and Guides]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[tex]]></category>

		<guid isPermaLink="false">http://www.thelinuxdaily.com/?p=2411</guid>
		<description><![CDATA[Most of the guides I came across were just wildly all over the place, so I figured a short and simple guide that gets right to the point would be useful. Here&#8217;s how to set up Fedora 15 to build (compile might be another word) a .tex file into a .pdf file from the command [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the guides I came across were just wildly all over the place, so I figured a short and simple guide that gets right to the point would be useful.  Here&#8217;s how to set up Fedora 15 to build (compile might be another word) a .tex file into a .pdf file from the command line.  It can be applied to other Linux distributions as well.  There are GUIs to help with this, but it&#8217;s best to start with the basics.  So, fire up a terminal and let&#8217;s get started.</p>
<h3><span style="color: #800000;">Step 1: Install the TexLive Package</span></h3>
<p>The first thing we need to do is install the texlive package.</p>
<pre>su -c 'yum install -y texlive'</pre>
<h3><span style="color: #800000;">Step 2: Prepare a .tex Document</span></h3>
<p>Next, we&#8217;ll create a &#8220;hello world&#8221; type .tex file.  Fire up your favorite text editor and copy/paste the following (I enjoy using <code>vim</code> since I can stay in the command line while building the LaTeX file).  When you&#8217;re finished, save the file (I&#8217;ve saved it as &#8220;hello.tex&#8221;).</p>
<pre>
documentclass{book}

usepackage{lipsum}

begin{document}
chapter{Sample}

lipsum[1-4]
end{document}
</pre>
<h3><span style="color: #800000;">Step 3: Build the .tex Document Into a PDF File</span></h3>
<p>Finally, we&#8217;ll build (compile) the .tex source into a pretty PDF document using the command below:</p>
<pre>pdflatex hello.tex</pre>
<p>You&#8217;ll see something similar to this:</p>
<pre>
[dhildreth@drh hello_world]$ pdflatex hello.tex
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %&amp;-line parsing enabled.
entering extended mode
(./hello.tex
LaTeX2e &lt;2005/12/01&gt;
Babel &lt;v3.8h&gt; and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng
erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish,
 french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc
us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por
tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian, swedish,
turkish, ukenglish, ukrainian, loaded.
(/usr/share/texmf/tex/latex/base/book.cls
Document Class: book 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/bk10.clo))
(/usr/share/texmf/tex/latex/lipsum/lipsum.sty)
No file hello.aux.
Chapter 1.
[1{/usr/share/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] (./hello.aux) )&lt;/u
sr/share/texmf/fonts/type1/bluesky/cm/cmbx12.pfb&gt;&lt;/usr/share/texmf/fonts/type1/
bluesky/cm/cmr10.pfb&gt;&lt;/usr/share/texmf/fonts/type1/bluesky/cm/cmsl10.pfb&gt;
Output written on hello.pdf (2 pages, 22507 bytes).
Transcript written on hello.log.
[dhildreth@drh hello_world]$
</pre>
<p>Notice the text &#8220;Output written on hello.pdf (2 pages, 22507 bytes).&#8221;.  That means it worked.</p>
<h3><span style="color: #800000;">Step 4: View the New PDF File</span></h3>
<p>Now, all you need to do is view the generated PDF document.  Run the following command:</p>
<pre>evince hello.pdf</pre>
<p>Note, if you&#8217;re like me, you constantly flip between the source and the pdf.  If that&#8217;s the case, evince will automatically update the pdf every time you re-build using pdflatex.  Simply add &#8220;&#038;&#8221; on the end of the command above:</p>
<pre>evince hello.pdf &amp;</pre>
<p>This is what you should be seeing when completed:</p>
<p><iframe src="http://docs.google.com/gview?url=http://www.thelinuxdaily.com/wp-content/uploads/2011/07/hello.pdf&#038;embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe></p>
<h3><span style="color: #800000;">Alternative: Rubber</span></h3>
<p>I&#8217;d like to make a special note about the &#8216;rubber&#8217; utility.  It can take a lot of the guess work out of building LaTeX files and I strongly recommend using it over pdftex or pdflatex as mentioned above.  You can install and run the &#8216;rubber&#8217; utility with the following commands:</p>
<pre>su -c 'yum install -y rubber'
rubber --pdf hello.tex
</pre>
<h3><span style="color: #800000;">Conclusions</span></h3>
<p>I hope this helps you get started moving quickly in the right direction.  Comments and feedback are welcome.</p>
<p>A few difficulties I had when doing this for the first time were:</p>
<ul>
<li>&#8220;Where&#8217;s the &#8216;latex&#8217; package??&#8221;</li>
<ul>
<li>Turns out, texlive is the package to install these days.</li>
</ul>
<li> Undefined control sequence message:</li>
<pre>
[dhildreth@drh hello_world]$ pdftex small2e.tex
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %&amp;-line parsing enabled.
entering extended mode
(./small2e.tex
! Undefined control sequence.
l.11 documentclass
                   {article}        % Your input file must contain these two...

?
</pre>
<ul>
<li>Apparently, there&#8217;s a difference between pdflatex and pdftex.  Understand this when moving forward.  I would recommend using the command <code>rubber --pdf hello.tex</code> instead since it takes care of the decision for you (as well as offers many other benefits &#8212; <code>man rubber</code> for more info).</li>
</ul>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.thelinuxdaily.com/2011/08/how-to-build-a-tex-file-to-pdf-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

