(Disclosure: Written by the Equalang team, makers of the translation tools mentioned in this guide.)
Paste a .tex section into a generic translator and hit Recompile in Overleaf. Within seconds, the log fills with ! Undefined control sequence, half your citations turn into [?], and \ref{eq:loss} stops pointing to Equation 4 because the key got translated into \ref{eq:verlust}.
Before you write a regex script to patch the wreckage, check which job you are actually doing. Almost everyone looking for a LaTeX translation workflow falls into one of two lanes, and picking the wrong one wastes hours.
| Your goal | Starting file | Main risk to avoid | Recommended route |
|---|---|---|---|
| Read someone else's paper | Compiled PDF | Fighting missing .sty/.cls packages from arXiv tarballs |
Translate the PDF directly with formula optimization |
| Submit your own paper to a journal | Overleaf .tex project |
Broken \cite{}/\ref{} keys, altered \newcommand macros |
Flatten with latexpand, lock preamble, lint with chktex
|
| Share a draft for non-TeX co-author review |
.tex converted to DOCX |
Manual equation re-typing in Word | Convert via pandoc, translate DOCX, port edits back |
Path A: Reading Someone Else's Paper? Skip .tex Surgery
If you only need to understand an arXiv preprint or conference paper, do not download the .tar.gz source archive. Author tarballs often omit custom journal .cls files, pin outdated .bbl bibliographies, or assume a specific TeX Live release. Compiling someone else's source just to read it in another language is unnecessary friction.
Translate the compiled PDF instead. Equalang Document Translation does not accept raw .tex files, because readers rarely need to rebuild TeX source just to read a paper. Upload the compiled PDF, turn on Optimize math formulas, and review the original beside the translation. Equalang uses usage-based pay-as-you-go billing with an upfront usage quote before starting and no recurring monthly subscription, and failed or canceled jobs are not billed. Turning on formula optimization keeps inline fractions (1/m, 2m) and numbered display equations intact rather than flattening them into broken plain text.
Two shortcuts save even more time for readers:
- Check open-access editions first: Search the paper's DOI or title on Equalang Plaza. Once signed in, you can read and download originals at no charge, preview the first 20% of any available translation side by side with synced scrolling at no charge, and download the full edition at one-tenth of a standard full-document translation job.
- Stay inside your reference manager: If you organize papers in Zotero 7–10 on Windows or macOS, install the Equalang Zotero plugin. Right-click any PDF attachment, enable Optimize formula layout in PDFs in the confirmation dialog, and keep the bilingual PDF attached to the same library entry.
For a deeper look at reading arXiv preprints in HTML versus bilingual PDF, see our comparison of arXiv HTML, ar5iv, and bilingual PDFs.
Path B: Translating Your Own .tex Manuscript for Submission
When a journal requires compilable .tex source, you cannot bypass the source tree. The goal is to separate translatable prose from compiler instructions before any translator touches the file. Run these four steps in order.
1. Flatten Multi-File Overleaf Projects With latexpand
Overleaf projects usually split chapters across ./sections/intro.tex, ./sections/method.tex, and ./tables/ablation.tex via \input{...} or \include{...}. Translating those files one by one invites inconsistent terminology and makes cross-file \label{} checks tedious.
First, snapshot your working project in Git (or download a full Overleaf ZIP backup). Then flatten the .tex files into a single buildable file with latexpand, which ships with TeX Live:
git checkout -b translation-work
latexpand --keep-comments ./main.tex > ./main_flat.tex
latexpand inlines \input and \include targets while leaving your .bib file and figure paths untouched. If your comments hold old drafts you do not want translated, drop --keep-comments so latexpand strips them automatically. Verify that ./main_flat.tex compiles cleanly on its own before translating a single sentence.
2. Lock the Preamble and Switch the Compiler Engine
Everything between \documentclass{...} and \begin{document} is compiler configuration, not prose. Never send the preamble to a translator. If a tool alters \newcommand{\loss}{\mathcal{L}_{\text{KL}}} or translates an option inside \usepackage[...]{...}, compilation fails on line 1.
Edit the preamble manually for your target language instead:
-
Translating into Chinese, Japanese, or Korean: Switch Overleaf's compiler from pdfLaTeX to XeLaTeX or LuaLaTeX under Menu -> Settings -> Compiler. Add
\usepackage{xeCJK}(or\usepackage[UTF8]{ctex}for Chinese documents) right before\begin{document}. Leaving pdfLaTeX active triggers! Package inputenc Error: Unicode character ... not set up for use with LaTeX. -
Translating from Chinese into English: Replace
ctexartorctexrepwitharticleor the target journal's.clsfile. Remove\usepackage{xeCJK}if the submission system enforces pdfLaTeX.
3. Protect Immutable Keys, Paths, and Math Macros
Once the preamble is locked, work strictly on the body inside \begin{document} ... \end{document}. Every LaTeX manuscript mixes prose with rigid identifiers that must match your .bib database, file tree, or macro table character for character.
| LaTeX construct | Example | Translate it? | What breaks if altered |
|---|---|---|---|
| Citation keys |
\cite{vaswani2017attention}, \citep{...}
|
Never | Renders [?] and Citation undefined
|
| Labels & cross-refs |
\label{eq:kl}, \ref{fig:arch}, \eqref{eq:kl}
|
Never | Renders ?? and broken hyperref jumps |
| File & figure paths | \includegraphics{./figs/overview.pdf} |
Never | Fatal File not found compile error |
| Custom macro calls |
\loss, \R, \ie
|
Never | ! Undefined control sequence |
| Math environments |
$x_i$, \begin{align}...\end{align}
|
Only \text{...} prose |
Broken delimiters or invalid math tokens |
| Captions & headings |
\section{...}, \caption{...}
|
Yes (prose only) | Keep nested \label{...} untouched |
Keep one subtle detail in mind for tables and captions: translate the human-readable words inside \caption{...} and table cells, while leaving column separators (&), line breaks (\\), \multicolumn, \toprule, and any nested \label{...} unchanged.
After translating the body into ./main_translated.tex, do not rely on visual scanning alone to verify every citation and reference key. Extract and diff all keys between the original and translated files in five seconds:
grep -oE '\\(cite[a-z]*|label|ref|eqref|autoref)\{[^}]+\}' ./main_flat.tex | sort -u > ./keys_orig.txt
grep -oE '\\(cite[a-z]*|label|ref|eqref|autoref)\{[^}]+\}' ./main_translated.tex | sort -u > ./keys_trans.txt
comm -3 ./keys_orig.txt ./keys_trans.txt
An empty output from comm -3 confirms every citation, label, and reference key survived untouched. Any printed line flags the exact key that was mutated or dropped.
4. Compile, Catch Silent [?] Warnings, and Run chktex
Overleaf often finishes building a PDF even when citations or references fail—it simply prints [?] or ?? in the margin and buries the warning in the raw log. Always scan the .log output (or run pdflatex / xelatex locally) for these exact warnings:
grep -E "LaTeX Warning: (Reference|Citation)|Undefined control sequence" ./main_translated.log
Next, run chktex to catch stray punctuation, broken spacing before \ref{}, or mismatched braces introduced during translation:
chktex -q ./main_translated.tex
Finally, if you are handing ./main_translated.tex to a co-author for review—or checking that no equation block went missing—generate a structural diff with latexdiff:
latexdiff ./main_flat.tex ./main_translated.tex > ./diff.tex
Unless a journal explicitly demands separate chapter files, keep the clean single-file ./main_translated.tex for submission—most editorial systems accept or prefer a flattened .tex upload.
Frequently Asked Questions
Should I translate my .bib file along with the .tex manuscript?
No. Keep .bib entries in their original bibliographic language, and never alter entry keys such as vaswani2017attention. If a journal asks for English translations of non-English titles, add a note field or bracketed translation inside title only where the style guide requires it.
Why does pdflatex throw ! Package inputenc Error after translating into English?
Stray full-width punctuation left over from Chinese or Japanese editing (,, 。, (, ), ;) or invisible non-breaking spaces will choke pdflatex. Find every non-ASCII character in ./main_translated.tex with one command:
grep --color='auto' -P -n "[^\x00-\x7F]" ./main_translated.tex
Replace the flagged characters with standard ASCII equivalents and recompile.
What if my paper defines custom \newcommand macros that expand into prose?
Macros like \newcommand{\methodname}{FastAlign} are useful during translation because keeping \methodname untouched guarantees consistent naming across the paper. Check after translation whether the expanded phrase needs capitalization or pluralization adjustments in the target language.

Top comments (0)