About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Smile for the Camera: a new cybercrime short story ebook.


4.1 Using Simple Commands

[Typesetting all those TeX-related logos]Now let's try adding a few simple commands to our document. The command \LaTeX produces the ALT=LaTeX logo and the command \today prints the current date. LaTeX always ignores any spaces that follow a command name that consists of letters, as it uses the space to indicate the end of the command name. This means that if we want a space to occur immediately after the command, we need to explicitly say so using the command \␣ (recall from earlier indicates a space character). So, for example:

\LaTeX\␣logo

produces the output:

LaTeX logo

Some people when starting out can get a bit confused by this and read it as the entity “\LaTeX\” whereas it is in fact two commands: “\LaTeX” (print the LaTeX logo) followed “\ ” (print a space.)

Let's also try using a command that takes an argument. The command

\footnote{<text>}

takes one argument that specifies the text that should appear in the footnote. This command must be placed where you want the footnote marker to appear.

Exercise 2: Using Simple Commands

Edit the document you created in Exercise 1, so that it looks like the following: (You can download it if you like, but again it is better if you try typing it in yourself.)


\documentclass[12pt]{scrartcl}

\begin{document}

This is a simple \LaTeX\␣document. Here is the first paragraph.

Here is the second paragraph\footnote{with a footnote}. As you can see it's a rather short paragraph, but not as short as the previous one. This document was created on: \today.
\end{document}

Now LaTeX your document and view the result. (Remember to check Appendix B. Common Errors if you have a problem.) You should see the LaTeX logo, the footnote marker and the current date. If you scroll down to the bottom of the page, you should see the footnote.


This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs