 Hello and welcome to the second screencast on LeyTech. In this video we're going to set up your very first LeyTech document. Just a simple document that just works with some basic text. In the process of doing this, we're going to learn about how to find a good text editor for your LeyTeching needs, how a basic LeyTech document is structured, entering text and how LeyTech handles basic text formatting such as white spaces, how LeyTech goes about compiling, and then practicing compiling LeyTech source to a PDF document, and then finally running through some basic debugging tasks in the case of errors. Now before we go on, you first need to have access to a LeyTech system. The first video in this series gave some places to go to access LeyTech. Once you have access to LeyTech, either on the web or on your own machine, you can continue. Before we make a document, we need something with which to make it. As discussed in the first video, LeyTech documents are written as plain text and are then compiled into PDFs. You need a text editor for typing out LeyTech source code. A text editor is a program that allows you to type in input from the white keyboard without any special formatting. Fortunately, most LeyTech installations come with text editors, especially designed to work with LeyTech. MiKtec, the LeyTech distribution for Windows, comes with a program called TecWorks. TecWorks is also available for Mac and for Linux. MiKtec, for Macs, comes with a program called TecShop that is simple and full-featured. Other good text editors for the Mac include TextMate and Text Wrangler. ScribTech, the web-based LeyTech system, has its own editor built in. All of these programs have a feature called syntax highlighting, which means that special LeyTech commands you use are highlighted in different colors, so you can tell them apart from regular text. Before moving on, find or install a text editor for your LeyTech installation and open it up. For all the screencasts you see in this series, I'll be using the editor TextMate on a Mac. Other text editors will look slightly different, but the basic operations will be more or less the same. Here we are in a blank text editor. Let's jump right down and start making a new LeyTech document. The first thing we have to do is tell LeyTech what kind of document we are starting. So in the first line, type slash document class curly brace article close curly brace. This is the first example of a LeyTech command. The slash mark tells LeyTech that what's about to follow is a command and not just text to typeset. The command document class article loads a preset collection of page and style formats that would be suitable for an article. There are other classes available such as exam, letter, or even poster. The curly braces indicate the input to the command document class, which we often call the argument of the command. Now that LeyTech knows what kind of document we want, we need to tell LeyTech to begin the document. So type slash begin open curly brace document close curly brace. Here again we see some standard syntax, a slash to indicate a command, the command itself, and then curly braces with the argument inside. Now put in a couple of spaces and type slash end curly brace document close curly brace. This is a special kind of command called an environment, which we'll discuss in a later video. But all LeyTech documents must include the document class command in the first line, a begin document line, and an end document line. Everything that comes before the begin document line is referred to as the preamble of the document, and later we'll be putting special document-wide commands up there. The document itself will go here in the middle. Let's make our document just a single sentence, hello world. Now save the file to a convenient directory. I'll just use my desktop. You can call the file whatever you want as long as you use the extension dot t-e-x. Now we're ready to typeset this document and create a PDF. How this works will depend on the text editor you are using. In TechWorks there's a green go button in the upper left corner of the screen. Make sure the adjoining pull down menu is set to PDF-LayTech and not PDF-Tech. In TechShop on the Mac there's a button in the upper left corner of your screen that says typeset. In ScribTech there's a button that says compile. Whatever method works for you click the button or execute the command to typeset. If we've done everything right there should be a moment when LayTech compiles the document and then the output is produced. This is probably a PDF output, but it might also be called a file called a DVI file. The difference isn't important right now as long as we have something that looks like this. If you got an error message rewind and make sure that you typed everything in exactly as it was stated with no extra spaces or the wrong kind of parentheses and try again. So now we've successfully typeset a document using LayTech. Notice that if you check the directory where you saved your text source file there are now several documents among which are the Tech file, a file with a .aux extension, a file with a .log extension and the PDF file we're reviewing. The files other than the aux and log files are not necessary to keep around. Sometimes the .log file is useful because it contains a transcript of the system procedure that took place when the source document was compiled. Let's see what happens if I put another sentence underneath this one. I'll type nice to meet you and compile. Notice that the hard return I typed into the text editor is not produced in the PDF but if I put two spaces in between and compile then there's a line break. Just remember that there's no formatting in a text editor. LayTech commands will take care of the formatting. And so what you type is not necessarily going to be what you see in the output. Finally, if you make a mistake when typing a LayTech document and everyone will at some point LayTech will do its best to tell you what the problem is. For example, suppose I accidentally used a parenthesis instead of a curly brace in the document command. First of all, note that the syntax highlighting may help. I see that the text is not the right color here and the color could help me track down the error before it happens. But if I still don't catch it and compile anyway, LayTech will do a pretty good job telling me what the problem is. Here, for example, it shows the place where I put the parentheses and even though the error message is below are kind of cryptic, I can at least see the problem. Or if I misspell the word document and try to compile, LayTech tells me in what line the error occurred and tries to tell me what the error is. That's it for now. In the next screencast, we'll start adding mathematics into our document and seeing how text and math can live together. See you then.