text editor texstudio - joaomlourenco/novathesis GitHub Wiki
TeXstudio
TeXstudio is a fully-featured, open-source LaTeX editor that offers an integrated PDF viewer, advanced syntax highlighting, and live document statistics. To make it truly powerful, we will configure it to use latexmk, which automates the "compile-multiple-times" process for bibliographies and cross-references.
Requirements
-
Perl: Since
latexmkis a Perl script, you must have Perl installed. -
Linux/macOS: Usually pre-installed.
-
Windows: Install Strawberry Perl.
-
TeXstudio: Download and install the latest version from texstudio.org.
Configuring LaTeXmk (Essential)
By default, TeXstudio might try to run pdflatex manually. Switching to latexmk is highly recommended because it detects if you need to run biber or makeindex and repeats the build until all references are resolved.
- Open Options > Configure TeXstudio.
- Go to the Build tab.
- Locate Default Compiler and change it to Latexmk.
- (Optional) If you want to use modern engines like XeLaTeX or LuaLaTeX via latexmk:
- Click the Commands tab.
- Find the Latexmk line and modify the command.
- For XeLaTeX, it should look like:
latexmk -pdf -pdflatex="xelatex -synctex=1 %%O %%S" %%P - For standard pdfLaTeX, the default is usually sufficient:
latexmk -pdf -silent -synctex=1 %f
Usage Highlights
1. The "Magic" Build Button
Simply press F5 (Build & View). TeXstudio will call latexmk, which handles the heavy lifting. The PDF will appear in the internal viewer on the right.
2. Integrated PDF Viewer
- Synchronize:
Ctrl + Clickin the PDF to jump to the code, orCtrl + Clickin the code to jump to the PDF location. - Magnifier: Hover over the PDF to see a zoomed-in view of small text or equations.
3. Structure and Symbols
The left sidebar automatically parses your document. You can jump to any \section or \label instantly. The Symbols panel allows you to click-to-insert thousands of LaTeX mathematical characters.
Advanced Features
| Feature | Key Benefit |
|---|---|
| Live Inline Preview | Highlight a piece of code (like an equation) to see a tooltip preview without compiling the whole file. |
| Bibliography Support | TeXstudio parses your .bib file; typing \cite{ will show a searchable list of all your entries. |
| Clean Auxiliary Files | Go to Tools > Clean Auxiliary Files to wipe the clutter (.aux, .log, .out) that LaTeX generates. |
Spell Check & Grammar
Unlike VS Code, TeXstudio has built-in spell checking.
- Dictionaries: Go to Options > Configure TeXstudio > General > Dictionaries to point to your OpenOffice dictionary files (
.dic). - LanguageTool (Grammar): To get advanced grammar checking (similar to LTeX in VS Code), go to Options > LanguageCheck.
- You can link it to a local or remote LanguageTool server to catch "passive voice" or "wordy" sentences.
Note for MiKTeX users: If
latexmkfails with a "script not found" error, open the MiKTeX Console and ensure thelatexmkpackage is actually installed.