Practice LaTex Document

  1. In TeXworks, open a new file. Copy and paste all the preamble material (before the \begin{document} statement) from "Stoudt Sample Document" into this new file and save it with the name "practice1.tex". If you do not have line numbers in your document (Did you set it as the default?), from the top menu select Format, then Line Numbers.
  2. Type

    \begin{document}
    leave a few spaces, and type
    \end{document}
    so you do not forget.

  3. One of the things I did when I decided to re-learn TeX was to see if I could reproduce pages from math books. Let's try that now. Do be aware that introductory textbooks tend to have a lot of color and flash. It is not our goal to reproduce that sort of thing.

  4. Download the sample page. This is a page from College Algebra: Concepts and Contexts, by Stewart, Redlin, Watson, and Panman, Brooks/Cole (Cengage), 2001. You will notice a few things. We have a section title, a definition, two examples, math symbols, bold text, aligned equations, and side by side equations with their reasons. You will find how to do each of these in the "Stoudt Sample Document.tex" document. See if you can find each of them.

  5. I'll get you started. Between the beginning and the end of the document commands, start with
    \section*{Quadratic Functions in Standard Form}
    In example 4 we saw that the function $f(x)=3(x-4)^{2}-1$ can be expresed in the general form of a quadratic function.  
    This is an example of a quadratic function in standard form according to the following definition.
    \begin{definition}[Standard Form of a Quadratic Equation]
    A quadratic function $f(x)=ax^{2}+bx+c$ can be expressed in the \textbf{standard form}
    \[
    f(x)=a(x-h)^{2}+k
    \]
    by completing the square.
    \end{definition}
    
    Now press the green compile button.

  6. In the document, you will see a few things. The definition is not in a fancy box (although you could do that in LaTeX, I won't) and the definition has a number, which I do not want. Let's go back to that later. For the next part, I need an example and a solution. My preamble already has \newtheorem{example}{Example}[section] for examples, but nothing for solutions. So I will create a new proclamation and add it to my list in the preamble.
    \newtheorem*{solution}{Solution}
    
    Note the "*" means I do not want it numbered. When I begin a new solution it will start with the word "Solution," just like for a theorem or definition.

  7. Type in the following:
    \par
    The next example shows how ``completing the square'' allows us to express a quadratic function in standard form.
    \begin{example}[Expressing Quadratic Functions in Standard Form]
    Express the quadratic function $f(x)=x^{2}+16x+24$ in standard form.
    \begin{solution}
    To get $f$ in standard form we ``complete the square'' by
    \end{solution}
    \end{example}
    
    Now press the green compile button. You will notice that the example is not numbered the way I want it. We can fix that later. The are no brackets under the square term (you can do that in LaTeX but we won't bother). There is no change of color (I do not care about that), but everything else looks good.

  8. Finish typing in the page and then we will fix the numbering.

  9. Since we do not want to number our definitions, in the preample, replace "\newtheorem{definition}{Definition}[section]" with "\newtheorem*{definition}{Definition}." The "*" states that we do not want it numbered. Try it and see the change.

  10. To fix the example numbering, we need to remove the section counter, and start the numbering at 5. To remove the section counter, replace "%\newtheorem{example}{Example}[section]" with "\newtheorem{example}{Example}." In this way, the section number is not included. To start the numbering at 5, add "\setcounter{example}{4}" right before your example. The next example will then be numbered 5. Try both of these and see the changes.

  11. If you wish to see my finished version, you can download it here.
Well, this should get you started. Stop by my office with your PC and I'll be happy to help with any questions you might have.

Back to Dr. Stoudt's home page.