TransWikia.com

Is there a way to make difference tables in LaTeX? (Photo in post)

TeX - LaTeX Asked by Ibrahim Shanqiti on February 13, 2021

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

2 Answers

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.

Correct answer by cmhughes on February 13, 2021

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.

Answered by Don Hosek on February 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP