previous   Step-by-Step ExamplesLettuce on Toast   next


A House

This example illustrates the basics. The aim is to create a simple image of a house (shown in Figure 11.3).

  1. The main part of the house will be constructed from a rectangle, so select the rectangle tool .

  2. Let's make it a yellow brick house, so use Settings->Styles... to select a yellow fill colour .

  3. Click where you want the bottom left hand corner to go, and move (not drag) the mouse to the opposite corner (Figure 11.1(a)). Click to complete the rectangle. You will only see the fill colour once the rectangle has been completed (Figure 11.1(b)).

    Figure 11.1: House Example-- creating a rectangle: (a) rectangle under construction, (b) completed rectangle.
    Image house1a.png
    (a)
    Image house1b.png
    (b)

  4. Next do the roof. Let's make the roof using a triangle. For this you will need to use the closed line path tool . Select this tool using either the closed line button or the Tools->Closed Line menu item.

  5. Let's make it a red roof, so use Settings->Styles... to select a red fill colour .

  6. Click on each of the three vertices that form the triangle (Figure 11.2(a)). To complete the , double click when you click on the third vertex, or click on the third vertex and then press Enter, or use the finish path button. You will only see the fill colour once the path has been completed (Figure 11.2(b)).

    Figure 11.2: House Example-- creating a triangle: (a) triangle under construction, (b) completed triangle.
    Image house2a.png
    (a)
    Image house2b.png
    (b)

  7. Lastly comes the door and windows. These are all rectangles, so follow the same procedure as above. Let's make the door black and the windows white. Remember to set the fill colour before creating the rectangles (Figure 11.3).

Figure 11.3: House Example--Completed Image
Image housefinal.png

To save the picture, select the File->Save As... menu item (Figure 11.4).

Figure 11.4: House Example--Saving the Image
Image housesave.png

To include the image in a LaTeX document, select the File->Export... menu item, and save it as a LaTeX file (click on the File of Type and select pgf environment (*.tex, *.ltx), and name the file e.g. house.tex Figure 11.5.) To include it in your LaTeX document, remember to use the pgf package:

\usepackage{pgf}

and to include the image use \input, e.g.:

\begin{figure}
\centering
\input{house}
\caption{A House}
\end{figure}

Figure 11.5: House Example--exporting the image to a LaTeX file.
Image housesavetex.png


previous   Step-by-Step ExamplesLettuce on Toast   next