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.
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 latex → dvips → ps2pdf 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.
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:
| Directive | What it does |
|---|---|
% !TEX root | Names the parent file this one is included into, so typesetting a child split out via \input/\include builds the master |
% !TEX TS-program | Names the engine (program) that compiles this document; % !TEX program works too |
% !TEX encoding | Names 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/):
% !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:
#!/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.