<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Wojno: Tag latex</title>
    <link>http://christopher.wojno.com/articles/tag/latex</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Exploration through Code</description>
    <item>
      <title>Mac Latex-mk</title>
      <description>&lt;p&gt;I really like the LaTeX typesetting system. It makes nice looking documents. It&amp;#8217;s a bit of a pain to use, however. On FreeBSD, there is a &lt;span class="caps"&gt;LIFE&lt;/span&gt;-SAVING port called &amp;#8220;latex-mk,&amp;#8221; which is a set of &lt;em&gt;maintained&lt;/em&gt; make files that will do all the heavy-lifting for you. It&amp;#8217;s only released for FreeBSD and NetBSD, but I&amp;#8217;ll walk you through how to install it on Darwin (Mac). I make no warrantees here. You accept all responsibility for following these instructions or deviating from these instructions. I am not responsible for lost data or damaged property, etc.&lt;/p&gt;


	&lt;h1&gt;Installation&lt;/h1&gt;


	&lt;h2&gt;Getting LaTeX and latex-mk&lt;/h2&gt;


	&lt;p&gt;First, you need the latex package for Mac: &lt;a href="http://tug.org/mactex/"&gt;MacTex&lt;/a&gt;. Install that the usual way (or read their instructions if you get lost, no sense me repeating them). Once you have that installed, grab the &lt;a href="http://latex-mk.sourceforge.net/"&gt;latex-mk&lt;/a&gt; file. You&amp;#8217;ll have to dig around a big, look under &amp;#8220;Obtaining&amp;#8221; if that link still exists. You&amp;#8217;ll see a SourceForge download. Download this file:      latex-mk-1.9.1.tar.gz. I&amp;#8217;m sure these instructions will work for future versions too, though I make no guarantees.&lt;/p&gt;


	&lt;h2&gt;Uncompressing/Unarchiving&lt;/h2&gt;


	&lt;p&gt;Go ahead and unzip the latex-mk. Crack open a terminal (Finder &amp;gt; Applications &amp;gt; Utilities &amp;gt; Terminal.app). Change to the latex-mk directory:&lt;/p&gt;


&lt;pre&gt;cd ~/Downloads/latex-mk-1.9.1&lt;/pre&gt;

	&lt;p&gt;If the version has changed, cd to that. Remember, you must unzip it first. Apple&amp;#8217;s archiver should handle it. But you can always do a &amp;#8220;tar -xzf latex-mk-1.9.1.tar.gz&amp;#8221; if you&amp;#8217;re old fashioned like me.&lt;/p&gt;


	&lt;h2&gt;Configuration&lt;/h2&gt;


	&lt;p&gt;Like most packages, you need to run the configuration program. Do this from the latex-mk-1.9.1 directory (you should still be there).&lt;/p&gt;


&lt;pre&gt;sh ./configure&lt;/pre&gt;

	&lt;p&gt;You will see lots of text fly by. If you get errors, sorry, this tutorial is over. Drop me a line, maybe I&amp;#8217;ll be able to help or point you in the right direction. If you see it create lots of little files, then you&amp;#8217;re golden.&lt;/p&gt;


	&lt;h2&gt;Compile&lt;/h2&gt;


	&lt;p&gt;Type:&lt;/p&gt;


&lt;pre&gt;make&lt;/pre&gt;

	&lt;p&gt;And, after a very short time, it will complete.&lt;/p&gt;


	&lt;h2&gt;Install&lt;/h2&gt;


	&lt;p&gt;Type&lt;/p&gt;


&lt;pre&gt;sudo make install&lt;/pre&gt;

	&lt;p&gt;Sudo will ask for an administrator&amp;#8217;s password. Enter it. If you don&amp;#8217;t trust this package, you can always install by hand&amp;#8230; But I&amp;#8217;m not going over that. Once this is done, latex-mk is now installed and ready for use.&lt;/p&gt;


	&lt;h2&gt;Cleaning up&lt;/h2&gt;


	&lt;p&gt;Type:&lt;/p&gt;


&lt;pre&gt;make clean distclean&lt;/pre&gt;

	&lt;p&gt;That will remove any installation files. You may also simply delete the latex-mk-1.9.1 folder. You should delete the zip file from which you got the latex-mk-1.9.1 folder; you no longer need it.&lt;/p&gt;


	&lt;h3&gt;Testing&lt;/h3&gt;


	&lt;p&gt;Let&amp;#8217;s take it for a spin. Assuming you have MacTex installed already:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Create a new folder somewhere, I&amp;#8217;ll call it: &amp;#8220;Test&amp;#8221; &lt;/li&gt;
		&lt;li&gt;cd to &amp;#8220;Test&amp;#8221; &lt;/li&gt;
		&lt;li&gt;Create a new latex document, say, &amp;#8220;test.tex&amp;#8221; and type or copy in the following:&lt;/li&gt;
	&lt;/ul&gt;


&lt;pre&gt;%test.tex:
\documentclass[]{article}
\begin{document}
\LaTeX
\end{document}
&lt;/pre&gt;

&lt;ul&gt;&lt;li&gt;Now create a new file called &amp;#8220;Makefile&amp;#8221; and put the following into it:&lt;/li&gt;&lt;/ul&gt;

&lt;pre&gt;#Makefile
NAME = test
TEXSRCS = test.tex
BIBTEXSRCS = 
TGIFDIRS = tgif_figs

include /usr/local/share/latex-mk/latex.gmk
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;At the command prompt, type: &amp;#8220;make pdf&amp;#8221;&lt;/li&gt;
&lt;li&gt;You&amp;#8217;ll see it build the file. When it finishes, open finder and go to your &amp;#8220;Test&amp;#8221; folder. You&amp;#8217;ll see a shiny new &amp;#8220;Test.pdf&amp;#8221; so go ahead, click it! You&amp;#8217;ll see the strangely formatted LaTeX logo.&lt;/li&gt;
&lt;/ul&gt;

	&lt;p&gt;Congratulations. You just &amp;#8220;ported&amp;#8221; a FreeBSD application to Mac. Aren&amp;#8217;t command line applications grand?&lt;/p&gt;


	&lt;h1&gt;Why Latex-mk?&lt;/h1&gt;


	&lt;p&gt;Latex-mk takes care of lots of details when creating LaTeX documents. It keeps your bibliography up to date automatically and will re-run the latex processor to ensure all your citations and cross references are up to date and shiny. Otherwise, you have to run latex 2-3 time every change to ensure your references will be linked. Your new friend is &amp;#8220;make pdf&amp;#8221; as it enables one-stop generation shopping.&lt;/p&gt;


	&lt;h2&gt;More Information&lt;/h2&gt;


	&lt;p&gt;The make file can do much more. You should see what it can do by going to the &lt;a href="http://latex-mk.sourceforge.net"&gt;latex-mk site&lt;/a&gt; for instructions.&lt;/p&gt;</description>
      <pubDate>Sun, 30 Dec 2007 11:27:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:4edcce25-e0eb-4085-9e32-59bc7c43b6d0</guid>
      <author>Christopher Wojno</author>
      <link>http://christopher.wojno.com/articles/2007/12/30/mac-latex-mk</link>
      <category>How-Tos</category>
      <category>freebsd</category>
      <category>port</category>
      <category>mac</category>
      <category>latex</category>
      <category>makefile</category>
      <category>mk</category>
    </item>
  </channel>
</rss>
