3

New guy here, I am just trying to study LaTeX from the very beginning. I am using TexShop on a Mac, and now I am reading George Grätzer's Short Course.

Here's my question, when I type Binomial coefficients or Matrices in TexShop, I get an error. What's my problem?

This is my code

\documentclass[11pt, oneside]{article}      
\usepackage{geometry}                       
\geometry{letterpaper}                          
%\geometry{landscape}                       
%\usepackage[parfill]{parskip}           
\usepackage{graphicx}               
                            %convert eps --> pdf in  pdflatex       
\usepackage{amssymb}

\title{Brief Article}
\author{The Author}
%\date{}                            

\begin{document}
\maketitle
%\section{}
%\subsection{}


\[
   \binom{ \frac{n^{2} - 1}{2} }{n + 1}
\]

 \[
                 \begin{matrix}
                   a + b + c & uv    & x - y & 27\\
                   a + b     & u + v & z     & 134
                 \end{matrix}
\]


\end{document}  
8
  • Add a % character in that line where you state 'convert eps --> ' etc. That is a comment line
    – user31729
    Feb 17, 2014 at 4:14
  • @Christian Dear Sir, could you be a little more specific? Feb 17, 2014 at 4:14
  • Sorry, I pressed the Enter key too fast...
    – user31729
    Feb 17, 2014 at 4:15
  • @Christian No,that's a mistake, in the origin TexShop, it has % Feb 17, 2014 at 4:19
  • I meant, it should be a comment line.
    – user31729
    Feb 17, 2014 at 4:20

1 Answer 1

7

Add the line \usepackage{amsmath} in the preamble. amssymb is meant for special symbols.

\documentclass[11pt, oneside]{article}      
\usepackage{geometry}                       
\geometry{letterpaper}                          
%\geometry{landscape}                       
%\usepackage[parfill]{parskip}           
\usepackage{graphicx}               
%                            convert eps --> pdf in  pdflatex        
\usepackage{amsmath}         % Add this line!!!!!
\usepackage{amssymb}

\title{Brief Article}
\author{The Author}
%\date{}                            

\begin{document}
\maketitle
%\section{}
%\subsection{}

\[
   \binom{ \frac{n^{2} - 1}{2} }{n + 1}
\]

 \[
                 \begin{matrix}
                   a + b + c & uv    & x - y & 27\\
                   a + b     & u + v & z     & 134
                 \end{matrix}
\]

\end{document}
3
  • Thank you, Sir, it works! By the way, I think they should tell a newbie to add this line in the first place. Feb 17, 2014 at 4:21
  • Perhaps you used an oldfashioned documentation or some illdesigned template; nevertheless, it is important, that it works now.
    – user31729
    Feb 17, 2014 at 4:25
  • 1
    @AveMaleficum -- gratzer makes this recommendation: "Use the amsart document class for all your articles." (first steps in latex, p.xvi) amsart automatically loads amsmath and incorporates amsthm and amsfonts so the user has no need to load them explicitly. otherwise, amsart differs from article mainly in the structure of the front matter; the body of an article is, for all practical purposes, able to be switched between amsart and article with no requirements other than loading the aforementioned packages. Feb 17, 2014 at 14:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .