Skip to content
EasyLaTeXDocs

Create and Compile Your First LaTeX Document

Create a project in EasyLaTeX, edit main.tex, and compile to produce your first PDF. Compilation runs on the platform; you do not need a TeX installation on your computer.

Create a Project and Choose a Compiler

  1. Create a blank project and open or create main.tex.
  2. Select main.tex as the main file. The file currently open in the editor is not necessarily the compilation entry point.
  3. In the editor settings, select pdflatex (pdfLaTeX) as the compiler.
  4. Paste the complete example below into main.tex, wait for it to save, and compile.

Minimal Document

latex
\documentclass[a4paper,12pt]{article}

\begin{document}

Hello, LaTeX!

\end{document}

After compilation, the PDF preview should display “Hello, LaTeX!”. The article class supplies the basic layout and pdfLaTeX generates the PDF.

Edit the Body and View the Result

Write between \begin{document} and \end{document}. A blank line starts a new paragraph:

latex
\begin{document}

This is the first paragraph. LaTeX handles line wrapping and trailing spaces automatically.

This is the second paragraph. A blank source line starts a new paragraph.

\end{document}

Wait for changes to save, compile again, and wait for the current job to finish. The source editor and PDF preview are separate: changes appear in the PDF only after a new compilation completes.

Understand the Structure

PartPurpose
\documentclass{article}Selects the basic article layout
PreambleBetween \documentclass and \begin{document}; contains packages and global settings
\begin{document}Starts the body
\end{document}Ends the body

For an existing template, keep its main file, class, and required settings. Do not replace the entire template with this minimal example.

Troubleshoot a Failed Compilation

Characters Are Missing or Unsupported

Confirm the project's compiler setting and try the unmodified example first. These English examples use pdfLaTeX. For another writing system, use a compatible template and the appropriate platform compiler and font configuration. The editor's display font is not the PDF's typesetting font.

A .cls, .sty, or Other File Is Not Found

Check the project file tree, filename capitalization, and relative paths. Upload custom class and style files supplied with your template. If the unchanged minimal example reports a missing standard class, retain the project identifier and compilation log and contact platform support.

The PDF Does Not Update

Check the selected main file and current compilation status. Clicking compile first saves the current edit. Wait for queued or running jobs to finish; a failed job may leave the last successful PDF in the preview. After compilation, open the toolbar's Bug panel and inspect the errors and Original Log. For errors with a filename and line number, use Locate to position to jump to the source. Fix the first error, then compile again.

Complete Example

latex
\documentclass[a4paper,12pt]{article}

\title{My First  LaTeX Document}
\author{Your Name}
\date{\today}

\begin{document}

\maketitle

This is my first paragraph. I can now use  LaTeX to write documents.

This is the second paragraph. Edit the source and recompile to update the  PDF.

\end{document}