LaTeX for your thesis in 3 10 16 a lot of easy painful steps
I’ve spent about 8 10 way too many hours now trying to get a usable environment for writing my thesis. I’m going to try using LaTeX … god help me.
update
This is getting ridiculously long … I’m writing all this not so much to be read but for the benefit of search engines and people out there who might be trying similar things …
Hopefully I will be able to post a concise summary at some point.
First: install fink. The install went fine, but I could not for the life of me get my path environment variables set up correctly. I have no idea. I’ve been using the “infamous” (as I’ve seen it called) OS X directions for customizing tcsh for a while. I’m not a *NIX/shell guy any more than necessary; I’m not sure how it all fits together and so haven’t been able to figure out what’s going wrong, despite following Fink’s own recommendations on the topic. At any rate, after a few hours of trying, I stupidly couldn’t get fink’s /sw/bin to show up in my path. A great big WTF.
2: But that’s okay, because I eventually broke down and used FinkCommander, a GUI app which apparently knows to look in /sw/bin without the path environment variable. (Alternatively, I could have just typed the full path to fink. This, for those who don’t know, would be analogous to getting up and walking to the TV to change the channel instead of spending several hours looking for the remote control, which is what I did. Using FinkCommander is then kind of like asking your manservant to change the channel for you. He had been standing there the whole time blinking at you as you tore apart your living room looking for the &%*#ing remote.)
3: Install teTeX via Fink. I don’t know if this is the best distribution for my purposes or not. It’s all so confusing!
4: My intention is to try to get this to work using TextMate. I like TextMate because it’s lightweight, has tabs, will treat a directory as a “project” and you can do directory-wide text searches. Also it’s got a ton of modules and plug-ins, including the ability to syntax-highlight, compile, and display LaTeX. So after setting the TM_LATEX_COMPILER flag to /sw/bin/pdflatex in TextMate’s preferences (NOT in your shell environment!), I get TextMate to successfully compile and display some simple LaTeX file I found somewhere on the web. Yay!
5: Now, to use the power of the internets to steal leverage someone else’s hard work. Surely there are “thesis” LaTeX templates out there? Oh yes. Yes there are. My school doesn’t have specific formatting requirements for theses, so I’m free to pick one I like. I find Classic Thesis by André Miede and think it’s quite lovely. (Here is its pdf documentation using its own template. Pretty, no? It also appears to be well-organized and thought-through in terms of file management.)
6: Okay! So now if TextMate will compile Classic Thesis’ default sources into the same pdf, I’ll be set to go! Load up the example .tex file into TextMate, hit command-R and … it fails, of course.
! LaTeX Error: File `beramono.sty' not found.
7: A simple google for beramono.sty finds me the file itself in a repository that mirrors some of the file structure in my LaTeX install. Ookay … so mkdir /sw/share/texmf-dist/tex/latex/bera and copy the file in … and no go.
! LaTeX Error: File `beramono.sty' not found.
8: It appears that beramono.sty is part of a larger package for a Bera font family. Perhaps beramono.sty depends on the rest of the package. While I could try to reconstruct the package in bits and pieces by hand, there must be some way to get the whole thing at once, right? There are these things with a .tpm extension that seem to put a bunch of related files together … so what utility will take a .tpm file and fetch everything I need for me?
9: Searching for “latex tpm” and the like is not the most rewarding experience you’re likely to have today. Despite the wealth of information about LaTex out there, it took me 20 minutes to figure out that TPM stands for TeX Package Management.
10: Searching for “TeX Package Management” is considerably more rewarding. Okay, there’s this thing called a MiKTeX Package Manager that was originally written for Windows boxes, but folks have done some work porting it to Unix-like systems.
So this is where I am now. I’m going to try building the “MiKTeX Tools” project so that I can get this Bera font thing so I can compile an example thesis template so I can start to write my thesis. Will report back …
update
11:
% ./configure MIKTEX_INSTALLROOT=/sw/share/texmf
…
% make install
….
mkdir: /usr/local/lib/miktex: Permission denied
Sigh.
% sudo make install
…
This takes a while.
12: The build did not seem to install into /sw/share/texmf, but into /usr/local/bin. My paths are still screwed up so without the remote, I get up and change the channel by hand:
% /usr/local/bin/initexmf -u
…
% sudo /usr/local/bin/mpm --update-db
…
% /usr/local/bin/mpm --list | more
Ah! There it is: my bera package!
13: % sudo /usr/local/bin/mpm --install=bera
Package "bera" has been successfully installed.
14:Open “ClassicThesis.tex” in TextMate, compile, and …
! LaTeX Error: File `beramono.sty' not found.
Crap. So mpm installed a bera into /sw/share/texmf/fonts, but apparently nothing into /sw/share/texmf-dist/tex/latex/, which is where the other .sty files are living that ClassicThesis.sty uses, nor /sw/share/texmf-dist/doc/fonts, which you might expect from looking at the bera.tpm file.
Blah blah blah blah.
15: You can download the entire bera directory as a zip from this page. This zip, it turns out, includes most file structure already present below textmf-dist in my install — perhaps the necessary files that mpm did not install? So I copy all of those files by hand. Load ClassicThesis.tex, compile, and
! LaTeX Error: File `beramono.sty' not found.
Sigh.
16: At this error the log file also says Type X to quit or , which leads me to believe that TextMate is halting on errors on my behalf, whereas I might be able to trudge through them using the command line. So try pdflatex directly instead of through TextMate. Indeed, there are lots and lots of errors, but I eventually push through and a pdf file is written to disk.
Unfortunately, all those errors weren’t harmless: the file loses its TOC, several references, typefaces, and other things.
At this point, I’m giving up for the day …
update: Thursday 10 am
- I uninstalled MiKTex-Tools and re-installed them using ./configure MIKTEX_INSTALLROOT=/sw/share/texmf-dist. This flag determines where mpm installs your packages (not where mpm and friends is itself installed), and this is where (for whatever reason), my pdflatex and friends is looking for resources.
mpm --install=bera successfully installs the bera package into /sw/share/texmf-dist.
Still, pdflatex from either TextMate or the command line can’t find beramono.sty.
The author has made the bera font optional in the style, so unsetting the flag for beramono (\DeclareOption{beramono}{\setboolean{beramono}{false}} ) allows me to now compile the tex file without fatal errors and it all looks right except for the missing font (the default serif font is being used) and the fact that the bibliography entries are not being found.
update: Thursday 12:45 pm
I have uninstalled teTeX via Fink and installed the MacTeX distribution, which includes BibDesk, TeXShop, and LaTeXiT.
LaTeXiT. Looks like a teenster’s myspace profile name. Seriously people, this whole mixed capitalization thing has GOT TO STOP.
I uninstalled MiKTeX tools again and reinstalled them to point to MacTeX’s preferred home in /usr/local/bin. Downloaded the bera package again.
I am still having the same problems: LaTeX can’t find beramono.sty. The bibliography isn’t working so citations show up as [?].
Found this page wherein the author (using MiKTeX on OS X Tiger — which is my setup) says he had to issue sudo texhash before his newly-installed MiKTeX packages were noticed by LaTeX. I’ve tried this without luck: beramono.sty is still not found.
WRT to the bibliography, I’ve tried LaTeX-ing Bibliography.tex, but it complains about the first line, which is \manualmark: undefined control sequence.
A little googling suggests \manualmark may be defined by a package called koma. mpm --list | grep koma yields a package called koma-script. So even though mpm’s packages are apparently still unnoticed by LaTeX, I’ve installed that, too.
The saga continues …
update: Saturday 10:40 am
Attempting to move MiKTeX’s install root to ~/Library/texmf. Hoping TeXShop might be able to find its packages there.
update: Sunday 4:30 pm
Okay, I have things set up satisfactorily enough for my purposes. Things might be a bit messy with all the installing and uninstalling, and I’m not convinced it’s not currently working by some bit of luck. I’m going to have to re-create my environment on my desktop machine so I’ll try to get it all down to the shortest path and will post a quick summary.
- MiKTeX didn’t like being in ~/Library/texmf: I got strange errors when running initexmf and mpm. *shrug* It now (theoretically) installs to /usr/local/teTeX/bin/texmf.local. This is apparently where local modifications to the package tree want to live anyway.
- I got LaTeX to stop complaining about missing beramono.sty (texhash eventually worked, I guess?) but the font still wasn’t being used in the right place. The default roman style was being used. I eventually just commented out the lines that loaded the beramono package and I guess this means I’m letting LaTeX use its default teletype (\texttt) font, which looks fine to me. Certainly good enough, for chrissake.
- The bibliography is finally being built correctly. The thing to do (and I know this is probably obvious to anyone who actually knows LaTeX) is to run BibTeX on the master .tex file (not Bibliography.tex, as I was doing), since it loads the packages needed everywhere else, and then — and this is kind of awesome — run a full LaTeX build on the whole thing … twice. Or maybe three times if that doesn’t work.
So. I am now writing my thesis using this lovely template! It should just be a matter of putting my content in place of the filler content in the template and learning just enough LaTeX to markup italics. =)
Whew. Sheesh!
January 10th, 2007 at 5:50 pm
Forgive me if I’m being overly simplistic, but do none of the Mac OS implementations work?
http://www.macdevcenter.com/pub/a/mac/2004/02/03/latex.html
January 10th, 2007 at 5:52 pm
I guess my question is why you are using LaTeX and not some other TeX front end that is more happy to be on a Mac.
January 11th, 2007 at 8:36 am
I’d seen those, yes. Except for one or two, they all require an underlying install of TeX/LaTeX anyway … which is working on my machine. I’m just using TextMate as a front-end, rather than those other apps.
The issue at this point isn’t getting LaTeX to work; it’s getting that template what it needs to work. It may be that one of those apps would help, but seems unlikely. I’ll try them if nothing else pans out.
January 14th, 2007 at 2:39 pm
Have you tried just placing the beramono.sty file in your current work directory? That has often worked for me, but maybe this is more complicated that? It sounds like a path issue to me.
Sorry to hear about your tex troubles. I’ve used tetex on my Mac with no major problems, although I’m not familiar with your style package or TextMate.
Good luck!
January 14th, 2007 at 4:30 pm
Hey Tim!
Yeah, at some point I tried dumping all the bera’s package contents into the working directory. I think that actually did do the trick, insofar as it stopped complaining about the missing file, but the font was still not being used in the document. I am now in the same situation with the package installed in the correct (and less messy) place — the file is found but the font is not being used! So I dunno. I’ve given up on that font and am just using the default mono-spaced font, which is fine.
Still, the OCD geek in me wants to know how to get it working the right way … =)
February 14th, 2007 at 3:24 pm
Hi,
just stumbled over your odyssey with LaTeX and classicthesis. I apologize for the problems you’ve had with that “extravaganza” font Bera Mono, it’s definitely not a standard one (but free and very nice). Maybe I’ll put a switch in the release to more a more standard typewriter font accessible for the style. Again, sorry for the hassle.
Good luck with your thesis,
Andr\’e
February 14th, 2007 at 3:55 pm
Thanks for stoppy by, André. I’m sure if I actually knew how TeX worked beforehand, this wouldn’t have been such an oddessy. At any rate the thesis will look great, thanks to your hard work.
=)
February 25th, 2007 at 11:06 pm
Yup, I googled my way here, looking for: latex, textmate, and thesis. Have bookmarked it, hoping you will continue your saga.
To write my undergraduate papers I am using: MacTex, TextMate, apacite, BibDesk.
University of Washington has their thesis class files here:
http://staff.washington.edu/fox/tex/thesis.shtml
July 18th, 2007 at 8:32 am
eric,
Thanks a lot for posting this description… I had exactly the same issues, having started the process knowing two things for certain:
1) I was going to use LaTeX rather than Word to write my thesis
2) I wanted my thesis to look good - I dig André’s style lots and was/am determined to use it and/or a derivative (my uni has a few requirements that must be met…).
Anyway, I got to your point 9 and then decided to can it, having wasted the best part of 2 days tearing my hair out. LaTeX is great when it works, but I simply cannot understand how the whole system is put together, it’s absolutely infuriating. I mean, I’m doing a PhD in computational methods for engineering at a good university and I work day in, day out with big fat codes, and sys-admin, on Unix systems - I should be able to figure this out, no?! It kills me….
Anyway, thanks again for the tips - I’ll check them out and see how it goes.
One thought did occur to me… I really like MacTeX’s way of using system wide OS X fonts natively. Maybe I’ll tweak André’s style to be able to use this - this might make life a lot easier for others working on OS X.
Dan