Text FormattingError with choose Function

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
speedyhenry1234
Posts: 2
Joined: Sun Mar 18, 2012 8:57 pm

Error with choose Function

Post by speedyhenry1234 »

Hello All,

I am new here so i hope i have posted this in the right place.

I am currently doing a dissertation project using LaTeX. The first 15 pages worked well and looked good in the DVI format albeit with a few errors. Unfortunately last night I did something so that now, the choose function doesn't format correctly. Instead of being numerator over denominator in brackets, it now shows numerator then open brackets then denominator in brackets with no numerator. This is not a fault with the code as this is the same code as works and shows up correctly in the earlier pages of the DVI document. Whatever I do after this 15th page the formatting does not come out right and provides me with countless errors even though, the choose function still shows up correctly with the same code used in the earlier pages! Please help so I can format the rest of my pages correctly, if anyone wants further details please ask!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Error with choose Function

Post by localghost »

speedyhenry1234 wrote:[…] The first 15 pages worked well and looked good in the DVI format albeit with a few errors. […]
The DVI format is not supposed for viewing the result because it is an intermediate format. Compile to PS or further to PDF and take a look at the output. Furthermore you should fix all errors.
speedyhenry1234 wrote:[…] if anyone wants further details please ask!
For an adequate problem description please provide a proper minimal example that shows the problem and is compilable out of the box. This example has to be a working one that is reduced to only relevant code.


Best regards and welcome to the board
Thorsten
speedyhenry1234
Posts: 2
Joined: Sun Mar 18, 2012 8:57 pm

Error with choose Function

Post by speedyhenry1234 »

Code: Select all

\documentclass{article}

\begin{document}
{n \choose k}
{n \choose k}
\end{document}
is what i have but it comes out n(k) with k being in the denominator position, with no numerator or n at the top
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Error with choose Function

Post by localghost »

The TeX macro \choose is only for math mode. Furthermore there is a better replacement by the amsmath package.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}   % loads »amsmath«

\begin{document}
  \[
    \binom{n}{k}
  \]
\end{document}
For more information about math typesetting take a look the excellent »Math mode« document.
Post Reply