Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}  
share|improve this question
    
Add a % character in that line where you state 'convert eps --> ' etc. That is a comment line –  Christian Hupfer Feb 17 at 4:14
    
@Christian Dear Sir, could you be a little more specific? –  Ave Maleficum Feb 17 at 4:14
    
Sorry, I pressed the Enter key too fast... –  Christian Hupfer Feb 17 at 4:15
    
@Christian No,that's a mistake, in the origin TexShop, it has % –  Ave Maleficum Feb 17 at 4:19
    
I meant, it should be a comment line. –  Christian Hupfer Feb 17 at 4:20

1 Answer 1

up vote 7 down vote accepted

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}
share|improve this answer
    
Thank you, Sir, it works! By the way, I think they should tell a newbie to add this line in the first place. –  Ave Maleficum Feb 17 at 4:21
    
Perhaps you used an oldfashioned documentation or some illdesigned template; nevertheless, it is important, that it works now. –  Christian Hupfer Feb 17 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. –  barbara beeton Feb 17 at 14:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.