Written and maintained by CASRAI Editorial Board
Published
On this page
TeXworks is a free, open-source editor for writing LaTeX documents, with a built-in PDF viewer. This guide covers what it does, where to get it, and the three magic comments (root file, engine, bibliography file) that make thesis and multi-file paper projects work, plus the latexmk setup that automates BibTeX runs. Facts were read from the project’s own pages on 2026-11-12.
What TeXworks is used for in research
TeXworks is “an environment for authoring TeX (LaTeX, ConTeXt, etc) documents, with a Unicode-based, TeX-aware editor, integrated PDF viewer”, inspired by Dick Koch’s TeXShop. It is free and open-source under the GNU GPL v2 or later. Researchers use it to write papers, theses and reports in LaTeX and see the typeset PDF beside the source. It runs on Windows, GNU/Linux and other X11 systems, and macOS, and is built on Qt.
The normal workflow is PDF-centric, using pdfTeX and XeTeX as the typesetting engines. The latest release listed on the project homepage is TeXworks 0.6.11 (February 2026); earlier releases were 0.6.10 (February 2025) and 0.6.9 (February 2024).
Install or access
TeXworks is an editor, not a TeX system: you also need a TeX distribution to typeset. On Windows, TeX Live (since 2009) and MiKTeX (since version 2.8) both include TeXworks, so installing either gives you both. See our MiKTeX guide for that distribution.
To install it separately, use the downloads on the official project page, tug.org/texworks. Binaries are listed for a Windows installer, macOS disk images, and Linux as an AppImage, Flatpak, and packages for Arch, Debian, Fedora, Gentoo, openSUSE and Ubuntu. The source and bug tracker are on GitHub (TeXworks/texworks).
Step-by-step: set up a multi-file project with a root file, engine and bibliography
These settings are written as “magic comments”, lines at the top of a file that begin with % !TEX. They are documented on the TeXworks wiki page “Magic Comments”.
- Point chapter files at the root file. In each chapter or section file, put
% !TEX root = path/to/root_file.texat the start. Typesetting from a chapter then builds the whole document from the root. - Choose the engine per file. Add
% !TEX program = your_program. The value is the tool name as configured in TeXworks settings, not the executable name. - Declare the bibliography file for citation lookup. Add
% !TEX bibfile = file.bib; several files can be comma-separated (for examplefile1.bib, file2.bib). Then use the Edit menu command Insert Citations… to pick entries. TeXworks does not read the bibliography file from yourbibliographycommand, so this comment is required for that dialog. - Optional: set encoding and spellcheck language.
% !TEX encoding = your_encodingand% !TEX spellcheck = language_tag; the available languages are listed under Edit, Spelling. - Optional: add outline bookmarks. A comment such as
%: My bookmark labelcreates a bookmark, shown via Windows, Show, Tags.
Automate BibTeX and reruns with latexmk
The preconfigured typesetting tools include pdfLaTeX, ConTeXt (MKII), XeLaTeX, BibTeX and MakeIndex. To use latexmk instead, open Edit, Preferences…, then the Typesetting tab, and add a tool with the “+” button. The TeXworks wiki (“Advanced Typesetting Tools”) gives this setup:
- Program:
latexmk - Arguments, one per line:
-e,$pdflatex=q/pdflatex $synctexoption %O %S/,-pdf,$fullname - Tick “View PDF after running”.
Confirm latexmk is installed by running latexmk -v in a terminal. The variable $synctexoption expands to -synctex=1; other variables include $fullname, $basename, $suffix and $directory. For choosing a citation style once this works, see the LaTeX thesis template guide.
Output and how to read it
The result is a PDF in the integrated viewer, which is based on the Poppler library. TeXworks uses SyncTeX (by Jerome Laurens, supported by pdfTeX and XeTeX) to link source and preview: control-click in the source to find the matching position in the PDF, and vice versa. The 0.6 series adds continuous scrolling, a two-page spread mode, text selection and copying from the PDF, Alt+left arrow to go back after following a link, and character-level source/output synchronisation. A short manual is available from the Help menu.
Troubleshooting
| Symptom | Cause and fix (per project documentation) |
|---|---|
| Nothing typesets after a fresh install | TeXworks needs a separate TeX distribution unless you installed TeX Live or MiKTeX on Windows, which include it. |
| Typesetting a chapter file fails or builds only that chapter | Add % !TEX root = path/to/root_file.tex to the chapter file. |
| Insert Citations lists no entries | Add % !TEX bibfile = file.bib; it is not read from bibliography. |
| Wrong engine is used | Add % !TEX program = ... using the name defined in the Typesetting preferences. |
| latexmk tool does not run | Check it is installed with latexmk -v, and recheck the arguments entered in Preferences, Typesetting. |
Bugs can be reported on the project’s GitHub issues, and there is a mailing list at tug.org/mailman/listinfo/texworks.
Free alternatives
| Option | Type | CASRAI page |
|---|---|---|
| TeXstudio | Desktop LaTeX editor | TeXstudio guide |
| Overleaf and similar | Online collaborative LaTeX | Overleaf alternatives |
| Other viewers and editors | Various | LaTeX viewer options |
FAQ
Is TeXworks free?
Yes. It is free and open-source software under the GNU GPL v2 or later.
Does TeXworks include LaTeX?
No. It is an editor and viewer; typesetting uses a TeX distribution. TeX Live and MiKTeX for Windows bundle TeXworks.
Which engines does TeXworks use?
The normal workflow uses pdfTeX and XeTeX; pdfLaTeX, XeLaTeX, ConTeXt (MKII), BibTeX and MakeIndex are preconfigured.
Which platforms does it support?
Windows (7 to 11), GNU/Linux and other X11 systems, and macOS.
Sources
- TeXworks project homepage, tug.org/texworks (read 2026-11-12)
- TeXworks README, github.com/TeXworks/texworks (read 2026-11-12)
- TeXworks wiki: Magic Comments, and Advanced Typesetting Tools, github.com/TeXworks/texworks/wiki (read 2026-11-12)







