2

I'm trying to reproduce this math thingy in LaTeX: Pascal's triangle

What I've currently done is this: Pascal's triangle my result

\documentclass[oneside,12pt,pointednumbers]{scrartcl}
\usepackage[ngerman]{babel} %Deutsche Sprachunterstützung
\usepackage[utf8]{inputenc} %Umlaute
\usepackage{amsmath}

\newcommand{\vtwo}[2]{\left(\begin{array}{c} #1 \\ #2 \end{array}\right)}
\newcommand{\vthree}[3]{\left(\begin{array}{c} #1 \\ #2 \\ #3 \end{array}\right)}

\begin{document}
\begin{align*}
\begin{array}{ccc}
\vtwo{0}{0} && 1 \\
\vtwo{1}{0} \vtwo{1}{1} && 1 \hspace{5mm} 1 \\
\vtwo{2}{0} \vtwo{2}{1} \vtwo{2}{2} &=& 1 \hspace{5mm} 2 \hspace{5mm} 1 \\
\vtwo{3}{0} \vtwo{3}{1} \vtwo{3}{2} \vtwo{3}{3} && 1 \hspace{5mm} 3 \hspace{5mm} 3 \hspace{5mm} 1 \\
\dots && \dots
\end{array}
\end{align*}
\end{document}

But my text is much bigger than in the model. I think, that's because the model was set in \textstyle, but when I declare my math box to use \textstyle as well, nothing changes:

\begin{document}
\begin{align*}
\textstyle
\begin{array}{ccc}
\vtwo{0}{0} && 1 \\

or

\begin{document}
\begin{align*}
\begin{array}{ccc}
\textstyle\vtwo{0}{0} && 1 \\

look all the same.

What's the reason for this behavior? Why does \textstyle not work? Any ideas are greatly appreciated ;)

9
  • The array is always set in \textstyle so adding it again makes no difference. Jan 7, 2016 at 19:53
  • you might be better using smallmatrix from amsmath package Jan 7, 2016 at 19:54
  • 3
    Why not \binom{5}{3} from amsmath for example ??? That's the command designed to typeset binomial coefficients (which is the case here apparently, reproducing Pascal's triangle)
    – user31729
    Jan 7, 2016 at 19:56
  • Isn't there also a tbinom forcing a small size?
    – daleif
    Jan 7, 2016 at 20:00
  • @DavidCarlisle If the array is already set in \textstyle, and \textstyle obviously doesn't do the trick, what style is used in the model?
    – LukeLR
    Jan 11, 2016 at 21:32

2 Answers 2

2

A possible solution with \binom (wrapped in \vtwo), but I am not happy with the \hspace commands right now.

I also increased the vertical stretching a little bit (\arraystretch)

\documentclass[oneside,12pt]{scrartcl}
\usepackage[ngerman]{babel} %Deutsche Sprachunterstützung
\usepackage[utf8]{inputenc} %Umlaute
\usepackage{mathtools}

\newcommand{\vtwo}[2]{\binom{#1}{#2}}%left(\begin{array}{c} #1 \\ #2 \end{array}\right)}
%\newcommand{\vthree}[3]{\left(\begin{array}{c} #1 \\ #2 \\ #3 \end{array}\right)}

\newcommand{\myspace}{6mm}

\begin{document}
\begin{align*}
\renewcommand{\arraystretch}{1.2}
\begin{array}{ccc}
\vtwo{0}{0} && 1 \\
\vtwo{1}{0} \vtwo{1}{1} && 1 \hspace{\myspace} 1 \\
\vtwo{2}{0} \vtwo{2}{1} \vtwo{2}{2} &=& 1 \hspace{\myspace} 2 \hspace{\myspace} 1 \\
\vtwo{3}{0} \vtwo{3}{1} \vtwo{3}{2} \vtwo{3}{3} && 1 \hspace{\myspace} 3 \hspace{\myspace} 3 \hspace{\myspace} 1 \\
\dots && \dots
\end{array}
\end{align*}
\end{document}

enter image description here

3
  • Thank you very much, using \binom really does the trick. If you dislike the use of \hspace for this purpose, what could be a better solution?
    – LukeLR
    Jan 11, 2016 at 21:36
  • @LukeLR: I don't have a better way right now than to use \hspace ;-) Perhaps using all in an alignat environment, but that's another alignment again
    – user31729
    Jan 11, 2016 at 22:07
  • Okay, I'll tell you if I find something ;) (But I don't believe so)
    – LukeLR
    Jan 12, 2016 at 17:28
3

See if the \binom from asmath gives desired result:

enter image description here

\documentclass[oneside,12pt,pointednumbers]{scrartcl}
\usepackage[ngerman]{babel} %Deutsche Sprachunterstützung
\usepackage[utf8]{inputenc} %Umlaute
\usepackage{amsmath}

\newcommand{\vtwo}[2]{\;\binom{#1}{#2}\;} 

    \begin{document}
\begin{align*}
    \renewcommand{\arraystretch}{1.5}%1.2
\begin{array}{ccc}
\vtwo{0}{0} && 1 \\
\vtwo{1}{0} \vtwo{1}{1} && 1 \hspace{5mm} 1 \\
\vtwo{2}{0} \vtwo{2}{1} \vtwo{2}{2} &=& 1 \hspace{5mm} 2 \hspace{5mm} 1 \\
\vtwo{3}{0} \vtwo{3}{1} \vtwo{3}{2} \vtwo{3}{3} && 1 \hspace{5mm} 3 \hspace{5mm} 3     \dots && \dots
\end{array}
\end{align*}
    \end{document}

Edit: After then, when submit the first version of answer,, I recognize, that it is the same as Christian Hupfer answer. Now I slightly modify it.

7
  • Glad you undeleted!
    – user31729
    Jan 7, 2016 at 20:14
  • @ChristianHupfer, I have mess with access to SE again. The image upload take to long time. Meanwhile I see, that the first version (I prepare two), is the same as your. Now I upload second version, slightly modified, however, essentially still equivalent to yours. So I anounce in my answer, that I will delete my answer ... after your kind comment I'm confused, what to do ..
    – Zarko
    Jan 7, 2016 at 20:20
  • Now, you made a different solution: You added \; before and after the \binom command ;-) (Keep it)
    – user31729
    Jan 7, 2016 at 20:22
  • @ChristianHupfer, thank you for encouraging me to keep my answer alive.
    – Zarko
    Jan 7, 2016 at 20:33
  • Thank you for your answer, \binom was the right idea. I'll accept @ChristianHupfer's answer, since he was first and fair in encouraging you to keep your question, but your answer is equally good. What does the \; thingy do you added before and after the \binom-command?
    – LukeLR
    Jan 11, 2016 at 21:38

You must log in to answer this question.

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