Install LaTeX on Mac with Brew

latexThis post will show you how to install LaTeX easily on a Mac with the package manager Homebrew.

You can directly install MacTex or BasicTex from https://tug.org/mactex/ and follow the instructions from 3 to 4. But I prefer brew for its ease.

1. First you should install Homebrew;
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

You may look at brew.sh for newer or additional installation methods. After you have installed brew you can easily search for packages with

brew search wget

or install found packages by

brew install wget

You may use brew for installing various packages, command line tools, applications etc.

2. There is a small twist while installing MacTex or BasicTex packages. Because they are supplied at the Homebrew Cask repository. Cask is a community contributed repository for large binaries and applications. So you should add cask command before installing MacTex or BasicTex.

brew cask install basictex
to install basictex or
brew cask install mactex
for mactex.

MaxTex is more than a GB and BasicTex is around 90MBs. There are many packages that you will never use in MacTex thus I prefer the BasicTex.

3. Now you will need a simple text editor to write LaTeX. Then simply use the command line to convert your raw latex code to pdf. You may also use a latex editor like TexMaker if you prefer a GUI. MacTex readily comes with some tex editors.

4. As BasicTex is very lightweight it is missing some essential packages. If you get errors like “multirow.sty not found” while compiling tex then you should install the missing modules. The package tlmgr is used to install the missing modules.

For example;

sudo tlmgr install multirow

tlmgr comes with BasicTex.

I have used the following resources to summarize the installation process and install latex myself on El Capitan.

  1. http://www.pydanny.com/setting-up-latex-on-mac-os-x.html
  2. http://www.bilalakil.me/getting-started-and-productive-with-latex-basictex-on-os-x-terminal/
  3. http://tex.stackexchange.com/questions/974/why-is-the-mactex-distribution-so-large-is-there-anything-smaller-for-os-x

Mac OS X 10.8 Mountain Lion SVN Kurulumu

Kısa bir süre önce sistemimi OSX 10.8 Mountain Lion sürümüne güncelledim. Bakalım bu güncellemeyle beraber ne bozulacak diye beklerken çok fazla geçmeden svnX‘in çalışmadığını farkettim.

SVX Unable to Locate svn binary

svnX’ın çalışmama sebebi Mac OS X 10.8 sürümünde svn kütüphanelerinin yüklü gelmemesi.

Bu sorunu aşabilmek için iki yöntem var.

  1. XCode kurduktan sonra XCode’un içerisinden Command Line Tools’u kurmak
  2. Mac OS X 10.8 için yalnızca Command Line Tools’u kurmak

1inci yöntemi uygulamak isterseniz yaklaşık 1.5 GB indirmek zorunda kalacaksınız. Eğer iOS uygulama geliştiricisi değilseniz bu sizin için zaman ve yer kaybı demek.

2inci yöntem için ise yaklaşık 200 MB indirerek XCode ile gelen paketi ayrıca kurmuş olacaksınız. Ancak bu paketi indirmek için Apple Developer ID’nizin olması gerekiyor.

Command Line Tools paketini indirmek için “Downloads for Apple Developers” sayfasını kullanabilirsiniz.

Kurulum tamamlandıktan sonra kütüphane dizinini ve svn sürümünü komut satırından öğrenebilirsiniz.


MacBook-Pro:~ $ which svn
/usr/bin/svn

MacBook-Pro:~ $ svn --version
svn, version 1.6.18 (r1303927)
compiled Nov  2 2012, 23:47:41