Day049 — LaTeX on Mac

Jacky Tsang
3 min readOct 4, 2018

--

It is a document of how I set up LaTeX on Mac.

Download LaTeX

Since I am using Mac, I downloaded MacTeX.

I download through torrent, which is much faster than direct download. After having on local disk, double-click the downloaded .pkg file to start installing. The installation process is straightforward and I don’t think there is something to be aware of.

Development setup

what configuration i use on mac

  1. Install Sublime Text 3
  2. Install Package Control on Sublime
  3. Install LaTeXTools from Package Control
  4. Install Skim
  5. Sync between Sublime Text and Skim (Perference->Sync tab->set Preset as Sublime Text)
  6. Open a .tex file (create one if you don’t have) in Sublime
  7. Press cmd+B to build
  8. A pdf preview will be shown
  9. (Optional) Move Sublime to the left, and pdf view to the right to see both documents at the same time

Everytime you press cmd+B to build Skim will auto-refresh to show the result.

Perference->Sync tab->set Preset as Sublime Text
split screen is the way to go

There is something to be aware of when writing the .tex doc.

\label has to be put behind \includegraphics and \caption.

Wrong:

\begin{document}

\begin{figure}
\label{fig:cats}
\includegraphics[width=\linewidth]{cats.jpg}
\caption{cats.}
\end{figure}

Figure \ref{fig:cats} shows cats.

\end{document}

Warning message will be shown and

Package caption Warning: \label without proper reference on input line 47.
LaTeX Warning: Reference `fig:boat1' on page 4 undefined on input line 52.
LaTeX Warning: There were undefined references.
\ref does not take effect

Correct:

\begin{document}

\begin{figure}
\includegraphics[width=\linewidth]{cats.jpg}
\caption{cats.}
\label{fig:cats}
\end{figure}

Figure \ref{fig:cats} shows cats.

\end{document}
\ref{fig:cats} shows correctly

--

--

No responses yet