TeXShop (Mac)

TeXShop is a free, open-source, macOS-only TeX environment written by Richard Koch. Editor and PDF preview sit side by side in one window, and it is bundled with MacTeX, installed into /Applications/TeX/. It is also the original on which the later TeXworks was modeled. This page focuses on the two things that matter most at the start: the typeset configuration (which engine compiles your document) and SyncTeX, for moving between source and PDF.

What TeXShop is

TeXShop is a macOS-only application that Richard Koch, a mathematician at the University of Oregon, has developed since around the year 2000; its license is GPLv2 (free software). It does not bundle LaTeX itself — it works by launching the commands of a separately installed TeX distribution (pdflatex, lualatex, latexmk, and so on) behind the scenes. On a Mac, MacTeX installs that TeX engine (TeX Live) and TeXShop together, so its great convenience is that you can start using it with no extra setup.

MacTeX-2026 carries TeX Live 2026 and places its GUI applications — TeXShop along with TeX Live Utility, LaTeXiT, BibDesk, and hintView — in the /Applications/TeX/ folder (the TeX engine itself lives under /usr/local/texlive/2026/). MacTeX-2026 supports macOS 11 Big Sur and later, on both Intel and Apple Silicon, and the current TeXShop (v5.57, October 2025) runs from High Sierra through Tahoe — a long-settled, dependable choice. For macOS 26 Tahoe specifically, TUG also ships a special TeXShop 5.58 with Liquid Glass support, released alongside MacTeX-2026 on March 2, 2026.

TeXShop is also known as the editor that the later, cross-platform TeXworks was directly modeled on. The two share the same straightforward feel — source on the left, PDF on the right, one Typeset button up top to compile — so learning TeXShop carries over almost unchanged to TeXworks.

Typeset configuration

The heart of TeXShop is the Typeset button at the top of the window. Press it (or ⌘T) and the document is compiled with the current engine, with the PDF appearing on the right. To clear intermediate files before recompiling, use ⌥⌘T (Trash AUX and Typeset). Which engine compiles your document is chosen from the pop-up menu immediately to the right of the Typeset button.

What this pop-up lists are engines. By default you can pick LaTeX (which makes a PDF by the latexdvipsps2pdf route), pdfLaTeX, LuaLaTeX, XeLaTeX, and more. These are backed by real files: TeXShop reads the .engine files in the ~/Library/TeXShop/Engines/ folder and shows each one as a menu entry. In other words, every engine is a short shell script, free for you to add to or modify.

Especially handy is the family of engines that call the build tool latexmk. With pdflatexmk, lualatexmk, and xelatexmk, latexmk automatically handles the reruns needed for bibliography, index, and cross-references, so a single typeset finishes the PDF. By contrast, an engine that does not use latexmk (such as plain LuaLaTeX) may need you to press Typeset two or three times before cross-references and the table of contents settle. Inside TeXShop these *latexmk engines initially sit in Engines/Inactive/Latexmk/; to use one, move it up into Engines/ and restart TeXShop.

The engine you pick in the pop-up is a temporary choice for that document. To make an engine the default, open TeXShop → Preferences → Typeset and set the engine you want (pdfLaTeX or LuaLaTeX, say) under “Default Command.” From then on, new documents compile with that engine.

Three settings to settle on a Mac

After installing MacTeX and TeXShop, you can start writing immediately. For Japanese reports and theses, though, it pays to settle encoding, default engine, and rerun handling before the manuscript grows.

  • In the Source tab, set the default encoding to Unicode (UTF-8).
  • In the Typeset tab, choose the everyday engine: LuaLaTeX for a new Japanese project, or the upLaTeX family for inherited templates.
  • For documents with a table of contents, cross-references, or bibliography, use a latexmk engine to automate reruns.
  • When a manuscript needs different settings, pin them with % !TEX TS-program and % !TEX encoding at the top of the file.

A stable Mac manuscript baseline

Because TeXShop works immediately with MacTeX, it is easy to start writing without thinking about configuration. For a long Japanese manuscript, spending the first few minutes on a baseline pays back later: make the entry file, engine, and encoding explicit, and use a latexmk engine to automate reruns.

latex
% !TEX TS-program = lualatexmk
% !TEX encoding = UTF-8 Unicode
\documentclass{ltjsarticle}
\begin{document}
\section{はじめに}
本文を書き始めます。
\end{document}
  • For a new Japanese manuscript, choose early between a LuaLaTeX route and an upLaTeX route.
  • If the document has a table of contents, cross-references, or bibliography, use lualatexmk, pdflatexmk, or a similar engine rather than a one-shot engine.
  • If an inherited template assumes upLaTeX, follow that template instead of forcing a LuaLaTeX migration.
  • Before splitting child files out, confirm that main.tex alone produces a PDF once.

Per-file directives (the % !TEX lines)

To pin down the engine or character encoding per document, the % !TEX lines (magic comments) placed at the top of a file are convenient. To LaTeX they are mere comments (everything after % is ignored), but TeXShop reads them and adjusts its behavior. Three are in common use:

DirectiveWhat it does
% !TEX rootNames the parent file this one is included into, so typesetting a child split out via \input/\include builds the master
% !TEX TS-programNames the engine (program) that compiles this document; % !TEX program works too
% !TEX encodingNames this document’s character encoding; it overrides the default save encoding

For instance, placing this single line at the top of a document makes just that document compile with LuaLaTeX, regardless of the pop-up selection. The value is simply an engine name (the name of a .engine in Engines/):

latex
% !TEX TS-program = lualatex
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\begin{document}
Hello, \LaTeX!
\end{document}

Encoding deserves care. Current TeXShop ships with a factory default encoding of IsoLatin9, so saving Japanese as-is garbles it. It is safest either to change the default to “Unicode (UTF-8)” in the encoding section of the Preferences → Source tab, or to write % !TEX encoding = UTF-8 Unicode into each file as above.

Engine setup for Japanese

For Japanese there are two main roads. One is LuaLaTeX: it handles Unicode directly and can use the system’s fonts, which makes it the straightforward choice for a fresh start. Just pick LuaLaTeX in the pop-up (or lualatexmk, which runs to completion automatically). To make new documents always use Japanese LuaLaTeX, set the “Default Command” described above to LuaLaTeX.

The other is upLaTeX + dvipdfmx, long the standard for Japanese. TeXShop provides engines that call ptex2pdf (the Lua script that ships with TeX Live) for the pTeX and upTeX families, as well as engines that drive upLaTeX → dvipdfmx through latexmk. The body of such a .engine is roughly the single line below; including -synctex=1 makes the SyncTeX described next work, too:

terminal
#!/bin/sh
ptex2pdf -l -u -ot "-synctex=1 -file-line-error" "$1"

Here ptex2pdf -l -u means “compile with upLaTeX, then make a PDF with dvipdfmx,” and -ot passes extra options to the engine. Adding -file-line-error makes errors appear as “file:line,” which makes jumping to the cause easier. Keep Japanese documents in UTF-8 as well, and — per the previous section — setting the default encoding to UTF-8 keeps things trouble-free.

SyncTeX (forward and inverse search)

SyncTeX maps source lines to positions in the PDF and back. With it working, you get forward search — jumping from the line you are on in the source to the matching place in the PDF — and inverse search, jumping back from a spot in the PDF to the corresponding source line. It pays off when proofreading: the hunt for “which line produced this paragraph” simply disappears.

In modern TeXShop the standard engines already include -synctex=1, so SyncTeX is on by default (only when you use a homemade engine do you need to remember to include -synctex=1, as in the example above). The synchronization file (.synctex.gz) is produced automatically when you typeset.

The gesture is wonderfully simple — ⌘-click, in either direction. ⌘-click on text in the preview to jump back to the source line that produced it (inverse search). Conversely, ⌘-click in the source to jump to the corresponding position in the PDF (forward search). Even in long manuscripts or multi-file projects, you can line up what you are looking at with its source in an instant.