28. Generating output from a LaTeX project

After creating a LaTeX file, it needs to be built using the TeX distribution to generate an output PDF file. Lets look at how to generate an example output file from a LaTeX .tex file.

## Example HellowWord.tex file

Here is an example Hello World file. You can type the following in a LaTeX editor and save the file as HelloWorld.tex.

## Build the file

Next, build the file on the command line or in a LaTeX editor such as TeXworks. See Selecting a LaTeX distribution and editor for more information.

In TeXworks, for example, select the build option pdfLaTeX+MakeIndex+BibTex from the Build menu, then click Build (the arrow next to the dropdown menu).

Alternately, open a terminal (MAC) or Command Prompt (Windows) and change to the directory where you saved the file. Then run the following command twice to build the file and to generate a table of contents:

## Completed build saved in root directory

In the directory containing HelloWorld.tex you will find a whole bunch of new files in there. Find the file HelloWorld.pdf and open it in a pdf viewer. You should see the following output.