12.07.2015 Views

GLE User Manual - Fedora Project Packages GIT repositories

GLE User Manual - Fedora Project Packages GIT repositories

GLE User Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 CHAPTER 2. TUTORIAL(1, √ 2)Figure 2.1: Result of your first <strong>GLE</strong> script.size 8 2This specifies that the output will be 8cm wide and 2cm high.moving to somewhere on the page:Next we define a “current point” byamove 0.25 0.25The origin (0,0) is at the bottom left hand corner of the page. Suppose we wish to draw a line from thispoint 5 cm across and 1 cm up:size 8 2amove 0.25 0.25rline 5 1This is a relative movement as the x and y values are given as distances from the current point, alternativelywe could have used absolute coordinates:size 8 2amove 0.25 0.25aline 5.25 1.25To draw some text on the page at the current point, use the write command:write "Hi there"Or, alternatively, you could include arbitrary L A TEX expressions using the tex command:tex "$(1,\sqrt{2})$"Now we have constructed complete <strong>GLE</strong> script, which looks as follows:size 8 2 boxamove 0.25 0.25rline 5 1tex "$(1,\sqrt{2})$"Enter the above <strong>GLE</strong> script using a text editor and save it to disk (any editor that saves in UTF8 or ASCIIformat will work). The following assumes that you have saved the file under the name “test.gle” in thefolder C:\<strong>GLE</strong> on Windows, or /home/john/gle on a Unix-like operating system. Now open a commandprompt and go to the folder where you saved the file. Then, run <strong>GLE</strong> on the file.On Windows, you do this as follows (C:\> is the prompt):C:\> cd C:\<strong>GLE</strong>C:\<strong>GLE</strong>> gle test.gleOr on Unix:cd ~/glegle test.gle<strong>GLE</strong> produces by default an Encapsulated PostScript (.eps) file:<strong>GLE</strong> x.y.z [test.gle]-C-R-[test.eps]Try viewing the resulting “test.eps” with a PostScript viewer such as GhostView, and compare it tothe output shown in Fig. 2.1. You can also preview it with Q<strong>GLE</strong>, <strong>GLE</strong>’s graphical user interface. Afteryou’ve started Q<strong>GLE</strong>, enter the following command at the command prompt.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!