LaTeX's strength is that it lasts for decades. The flip side: you sometimes inherit a preamble from another era — a lab template, an old model, a colleague's file. On a modern distribution, these deprecated packages trigger errors. Here is the replacement map to get an old document back on its feet.
The correspondence table
| Old (to replace) | Problem | Modern equivalent |
|---|---|---|
\usepackage[latin1]{inputenc} | broken accents / "Invalid UTF-8" (your files are UTF-8) | \usepackage[utf8]{inputenc} + \usepackage[T1]{fontenc} |
\usepackage{frenchle} / {french} | deprecated, unpredictable behavior | \usepackage[french]{babel} |
\usepackage{times} / {pslatex} | dated fonts, weak math rendering | \usepackage{newtxtext,newtxmath} / {lmodern} |
\usepackage{epsfig} / {psfig} | no longer handles current images (PNG/JPG/PDF) | \usepackage{graphicx} + \includegraphics |
\usepackage{subfigure} | deprecated, frequent conflicts | \usepackage{subcaption} |
{\bf ...}, {\it ...}, {\rm ...} | old font commands (fragile scope) | \textbf{...}, \textit{...}, \textrm{...} |
\usepackage{a4wide} | deprecated | \usepackage[margin=2.5cm]{geometry} |
\usepackage{fancyheadings} | renamed long ago | \usepackage{fancyhdr} |
Pitfall #1: accents (latin1 vs UTF-8)
This is by far the most common error on old preambles. Today your files are saved in UTF-8, but the old preamble declares latin1: accents turn into gibberish (é, è) or LaTeX stops on "Invalid UTF-8 byte sequence". The fix:
% Instead of: \usepackage[latin1]{inputenc}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
Pitfall #2: fontspec and the wrong compiler
fontspec (system fonts) and you compile with pdfLaTeX, you get this message. Two ways out: switch compiler (XeLaTeX or LuaLaTeX), or, if you don't need system fonts, replace fontspec with \usepackage{lmodern} + \usepackage[T1]{fontenc} and stay on pdfLaTeX. A clean modern preamble (try it)
When in doubt, start from a clean base. This one handles accents, French and images, and compiles with pdfLaTeX — test it below, with nothing to install:
The method
- Compile first and read the first error (the rest often follow from it).
- Spot the offending package in the message, then replace it using the table above.
- A package is missing ("File `xxx.sty' not found")? It may be deprecated: look for its modern replacement rather than installing it.
- Still stuck? Start from the minimal preamble above and reintroduce your needs one by one.
An AI can modernize the preamble — directly in your code
AI assistants (Claude, Gemini, ChatGPT…) know LaTeX very well: give them an old preamble and the error message, and they spot the deprecated packages and suggest replacements. The usual drawback is the back-and-forth — copying your code to the AI, then pasting its answer back into the editor.
sarmate.net removes this round-trip with its MCP server: you connect the AI directly to your online editor. It reads your files, compiles them, analyzes the error log and fixes the code in place, with no copy-paste. You stay in control: nothing is changed without your approval.
Test your old preamble online
Full editor, instant compilation (pdfLaTeX/XeLaTeX/LuaLaTeX), nothing to install.
Open the online editor