Got a .tex Package You Didn't Write? Find the Main File
Learn how to spot the entry .tex file and its included parts in a LaTeX package you didn't write, then prepare it for translation in OmniDoc.
If you searched for "what is LaTeX text," you may have a folder from a colleague, a journal or a former student and no idea which file holds the document. A LaTeX project is usually a set of plain-text files. Some contain the words you want to read, some contain formatting commands, and some pull in other files. Before you translate one, you need to know which file starts the document.
This guide is for anyone who received a LaTeX source package without writing it. You do not need to know LaTeX to do this. You only need to recognize a few commands and follow the links between files. Once you have found the main file, you can upload the package to OmniDoc for translation with the structure intact.
The short answer is to look for the one .tex file that declares the document class and holds the document body. Everything else is usually a supporting file or a section that the main file pulls in.
How do you identify the main .tex file in a LaTeX package? The short answer
Find the file that contains the \documentclass command, then confirm that it also contains \begin{document}. If several files look similar, use the table below to narrow it down.
| Your situation | What to do | Why |
|---|---|---|
The folder has one .tex file | Treat it as the main file and confirm it has \begin{document} | With only one source file, there is no other candidate for the entry point |
Several .tex files, and only one has \documentclass | Use that file as the main file | Only the entry file declares the document class |
The file names include main.tex or paper.tex | Check the contents before you rely on the name | Names are conventions, so a name can mislead you |
| Several files declare a document class | Start from the file with the title and \begin{document}, then follow its links | Templates and old drafts often leave extra copies behind |
| The package includes a compiled PDF | Match the PDF's title and section order to the source | The PDF shows you which source file produces the visible document |
Before you start
- Get the whole folder, not only the
.texfiles. Figures, bibliography files and style files are needed for references and images to resolve. Missing files are a common reason the output looks incomplete. - Extract any archive and keep the folder layout unchanged. Include paths are relative to the folder, so moving files around can break links that worked for the original author.
- Look for a compiled PDF if the sender included one. It shows you what the finished document should look like, which makes problems easier to spot later.
- Decide on the output format. OmniDoc can produce bilingual side-by-side output or a translation-only file. Bilingual output helps reviewers compare each passage with the source.
- Choose a style that matches the text. OmniDoc offers style options for academic, legal, medical, technical, business and literary text. A good style choice keeps terms consistent across the document.
Finding the main file in a LaTeX package, step by step
- Sort the files by type. Group the folder's contents into
.texsource files,.bibbibliography files,.styand.clsfiles, image files, and leftover build files such as.aux,.logand.out. The build files are generated by the compiler, so you can usually set them aside. - Search the
.texfiles for\documentclass. This command declares the document type, such as an article or a report. Only the entry file normally contains it, so a match here is the strongest signal you have. - Confirm the document body with
\begin{document}. Everything after this line, up to\end{document}, is the text that readers see. Text before it is the preamble, which holds settings and package loads. - Follow the include commands. Look in the main file for
\input{...}and\include{...}. Open each named file and note its path, since the name in the command must match a real file in the folder. Repeat the check for any file that includes others. - Check the bibliography link. Look for
\bibliography{...}or\addbibresource{...}in the main file. The name it points to should match a.bibfile in the package. If that file is missing, the citations will not resolve. - Note the custom style files.
.styand.clsfiles define packages and document classes. The original author wrote them to shape the layout, so keep them with the package even though they usually contain no text to translate. - Compare the structure with a PDF, if one is included. Match the title, the section headings and the order of the sections against the source. A mismatch usually means you have found a draft or an unused template rather than the file that produced the PDF.
- Upload the complete package to OmniDoc as a LaTeX source package. Keep the main file's name and location unchanged, and choose your output format. Because OmniDoc supports LaTeX source packages, the included parts travel with the main file.
Check the result
When the translation is ready, compare it with the source and look for the common failures.
| Check | How to see it | If it's wrong |
|---|---|---|
| Sections and structure | Compare the headings and their order with the source or the PDF | Missing sections usually mean an include path is broken. Confirm the file exists and the name matches its case exactly |
| Formulas | Compare a few equations with the source | Garbled math usually means the surrounding commands changed. Check the source directly and rerun the translation after fixing it |
| Figures and captions | Confirm each image and caption appears | Missing images usually mean the image file was left out or its path does not match. Add the file and upload again |
| Citations and reference list | Check that numbers and the reference list are complete | Question marks or missing entries usually mean the .bib file was not included or a citation key does not match |
| Terminology | Spot-check the key terms in each section | If terms vary, check the style option you chose. Correct any remaining differences in the source and upload again |
Machine translation can still mishandle specialized terms, so check any passage that matters for a decision, a submission or a legal reading against the source.
❓ FAQ
1. Do I need to know LaTeX to find the main file?
No. The checks in this guide rely on searching for a few commands, such as \documentclass, \begin{document} and \input. You are looking for patterns, not writing code.
2. What if no file contains \documentclass?
The package may be a fragment, such as a single section meant to be included in a larger project. Ask the sender for the full project, or check whether the main file was saved under a different name.
3. How is a LaTeX source file different from a Word document?
A Word document stores its text and formatting in a binary or XML structure that you edit visually. A LaTeX source file is plain text with commands that describe structure and layout. The commands are readable, but they are not the finished page.
4. Should I translate the .sty and .cls files?
Usually no. These files define how the document is laid out and which packages it uses. The readable text lives in the .tex files and the bibliography entries, so keep the style files with the package and leave them as they are.
📝 Summary
A LaTeX package is easier to translate once you know which file starts the document. Find the file with \documentclass and \begin{document}, follow its include and bibliography links, and keep the folder intact. After translation, check sections, formulas, figures and citations against the source.
Open OmniDoc to edit, convert or translate your LaTeX documents


