How to Install LaTeX with MiKTeX and TeXmaker
At a glance
- 1. Install a distribution
Install MiKTeX on Windows, or choose a TeX distribution such as TeX Live for your operating system.
- 2. Install an editor
Install TeXmaker separately; it provides an interface for writing and compiling LaTeX files.
- 3. Check configuration
Make sure TeXmaker can find the compiler supplied by your distribution.
- 4. Compile a test
Create a small .tex file and compile it to confirm the installation works.
To use LaTeX, you need software that turns a .tex source file into a PDF. A TeX distribution provides the compiler and LaTeX packages; an editor helps you write and compile the source. MiKTeX is a distribution, while TeXmaker is an editor, so installing only one may not be enough.
On Windows, MiKTeX plus TeXmaker is a common setup. The steps below install both and test that they work together. If you already have a TeX distribution, you can skip its installation and add only an editor.
1. Install a TeX distribution
Download and install MiKTeX from its official website. Follow the installer prompts. If the installer asks whether it may install missing packages automatically, allowing it to do so is convenient for most new users: the first time you compile a document that uses a package not yet installed, MiKTeX can fetch it.
Use the same Windows account for installation and for running TeXmaker when possible. If MiKTeX offers separate user and system installation choices, either can work; a system installation makes the tools available to multiple accounts, while a user installation is limited to your account.
A distribution is not just the LaTeX language itself. It includes programs such as pdflatex and a large collection of packages. Installing packages later is normal, so an initial installation need not contain every package you might ever use.
2. Install TeXmaker
Download TeXmaker from its official download page and install it. TeXmaker is a graphical editor; it does not replace MiKTeX or provide the full set of LaTeX compilers and packages by itself.
You can also use another editor, such as TeXstudio, or an editor with a LaTeX extension. The editor is a matter of preference. The essential requirement is that it can call the compiler from your installed distribution.
3. Create and compile a test document
Open TeXmaker, create a new file, and enter this minimal example:
\documentclass{article}
\begin{document}
Hello, LaTeX!
\end{document}
Save it as hello.tex in a folder where you can find the output. In TeXmaker, choose the PDFLaTeX command and run it (the menu or toolbar button may vary by version). A successful run should produce hello.pdf in the same folder. Open the PDF to verify that it contains “Hello, LaTeX!”.
If compilation fails because the compiler cannot be found, check that TeXmaker’s PDFLaTeX command points to the right executable, or that MiKTeX’s executable directory is on the system PATH. Restarting TeXmaker after installing MiKTeX can help it use an updated system environment.
4. Choose a distribution for another operating system
The MiKTeX-plus-TeXmaker instructions above are mainly for Windows. On macOS, MacTeX is a common TeX Live distribution; on Linux, TeX Live is widely available through the operating system’s package manager or from its official project. TeXmaker is available on multiple operating systems, but you still need a distribution installed separately.
Do not install multiple distributions unless you have a reason to. If you do, your editor may run a compiler from a different distribution than the one where you installed a package. That can make it appear that a package is missing even though it exists somewhere on the computer.
Common installation problems
- The editor opens, but compilation fails. An editor alone cannot compile documents. Install a TeX distribution and make sure the editor is configured to use it.
- A
.styfile is missing. This usually means the package is not installed in the active distribution. Use MiKTeX’s package tools or its automatic package installation, then compile again. - The PDF is not updated. Check the compiler’s output for errors. LaTeX can leave an older PDF in place when the latest compilation fails.
- The document compiles from a terminal but not from TeXmaker, or vice versa. The two may be using different executable paths or distributions. Check TeXmaker’s command settings and the system’s active TeX installation.
- A package download is blocked. Check the internet connection, proxy settings, and distribution package manager. Installing a missing package is a normal part of maintaining a LaTeX setup.
For most beginners on Windows, installing MiKTeX first, then TeXmaker, and successfully compiling the test file is enough to confirm a working installation.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.