This document provides a comprehensive guide to setting up a LaTeX environment using LuaTeX for efficient document editing and typesetting. We will explore two popular editor options: Emacs with AUCTeX and Kile.
Choose a TeX distribution that aligns with your operating system:
Linux:
- TeX Live (Recommended): Offers an extensive package collection and regular updates.
sudo dnf install texlive-babel-russian # Russian language support - Other Distributions: Explore options like TeXstudio or proTeXt based on your preferences.
Windows:
- MiKTeX: Popular choice with on-the-fly package installation. Download from https://miktex.org/download.
macOS:
- MacTeX: A complete TeX distribution tailored for macOS. Download from https://tug.org/mactex/.
The list of required packages is listed in LaTeX document, also you can use make to get erros about required packages. Install packages using your TeX distribution's package manager (e.g., tlmgr for TeX Live).
To search for some missing packages use:
tlmgr search --file mathrsfs.sty --globalTo install on fedora just add prefix texlive-:
sudo dnf install texlive-some-example-packageDoom Emacs:
- Install LaTeX: Refer to the Emacs package manager or official instructions (https://docs.doomemacs.org/v21.12/modules/lang/latex/).
- (Optional) Install pdf-tools: Enhance PDF interaction within Emacs.
Kile:
- Install Kile: Use your system's package manager or download from https://kile.org/.
- Kile Features: Enjoy a user-friendly interface with project management, syntax highlighting, code completion, and integrated PDF viewing.
- Compile: Use the appropriate command or keybinding (e.g.,
lualatexfor LuaLaTeX output). - Automate: Configure your editor to automatically build and view the generated PDF.
- Optimize: Utilize editor features and installed packages to streamline your LaTeX workflow.
- Comprehensive TeX documentation: https://www.tug.org/texlive/doc.html
- LaTeX community forums and support: https://tex.stackexchange.com/
- Package documentation and examples: Refer to package websites or CTAN (https://ctan.org/).
Just use:
sudo dnf install $(sed 's/^/texlive-/' pkg.txt)
cd src
biber main
lualatex main.texLatexmk is a powerful tool for automating LaTeX compilation. It can watch for changes in your files and automatically recompile your document, ensuring that the PDF output is always up-to-date. Here's how to use it:
- Installation: Install latexmk using your system's package manager.
- Basic Usage: Navigate to your LaTeX project directory in the terminal and run
latexmk -pdf yourfile.tex. This will compile your document and generate a PDF file. - Customization: Create a
.latexmkrcfile in your project directory to customize latexmk's behavior. You can specify options like the compiler to use, the output format, and the number of compilation runs. - Continuous Compilation: Use the
-pvcoption to enable continuous compilation. Latexmk will watch for changes in your files and automatically recompile your document.
Here are some additional advanced techniques you can use with latexmk:
- Specifying Dependencies: Use the
$dependencyvariable to specify dependencies between files. - Running External Tools: Use the
$postprocessvariable to run external tools after compilation, such as BibTeX or MakeIndex. - Using Custom Build Rules: Define custom build rules to handle specific file types or compilation steps.
By mastering latexmk, you can significantly improve your LaTeX workflow and make the compilation process more efficient.