2

Is there a way to make something like the following in LaTeX? enter image description here

2 Answers 2

5

Perhaps a simple array environment would work here:

screenshot of array environment, 7 columns, 3 rows

\documentclass{article}
\begin{document}

\[
    \begin{array}{*{7}{c}}
        a_0 &         & a_1          &                   & a_2          &         & a_3 \\
            & a_1-a_0 &              & a_2-a_1           &              & a_3-a_2 &     \\
            &         & a_2-3a_4+a_0 &                   & a_3-2a_2+a_1 &         &     \\
            &         &              & a_3-3a_2+3a_1-a_0 &              &         &
    \end{array}
\]
\end{document}

I'd recommend taking a look at What are good learning resources for a LaTeX beginner?

If you wish to fix the overful hbox warning then you can, for example, adjust arraycolsep as follows:

\[
    \setlength{\arraycolsep}{4pt}%<----------- NEW BIT
    \begin{array}{*{7}{c}}
        a_0 &         & a_1          &                   & a_2          &         & a_3 \\
            & a_1-a_0 &              & a_2-a_1           &              & a_3-a_2 &     \\
            &         & a_2-3a_4+a_0 &                   & a_3-2a_2+a_1 &         &     \\
            &         &              & a_3-3a_2+3a_1-a_0 &              &         &
    \end{array}
\]

See Redefine \arraycolsep for particular environments, for example. Other options include using the geometry package to adjust your paper dimensions.

2
  • +1 You might want to additionally mention how one could decrease the value of \arraycolsep in order to get rid of the overfull box warning.
    – leandriis
    Dec 27, 2020 at 15:43
  • @leandriis good idea, many thanks :) I hope that the edit works :)
    – cmhughes
    Dec 27, 2020 at 15:55
3

I would do this with an array environment. Seven columns all centered. First row leave columns 2,4,6 empty. Second row 1,3,5,7 empty, third row you're only filling in columns 3 and 5 and fourth row just column 4.

You must log in to answer this question.

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