TransWikia.com

Latexmk: too many tabulars

TeX - LaTeX Asked on July 29, 2021

I have a tabular that contains multiple tabulars. I’m doing this to generate a math worksheet. Here is an example:

begin{tabular}{cccccccccccccccc}
begin{tabular}{rr}&phantom{00}3times&phantom{00}4hline&12end{tabular}&
begin{tabular}{rr}&phantom{00}1times&phantom{00}7hline&7end{tabular}&
begin{tabular}{rr}&phantom{00}6times&phantom{00}1hline&6end{tabular}&
.
.
.
begin{tabular}{rr}&phantom{0}11times&phantom{00}1hline&11end{tabular}
end{tabular}

I’m using LatexMK to render, but it doesn’t want to do its job when the number of tabulars reaches around 50. How do I make it work?
As far as I can tell, it doesn’t throw any errors. That might be because of my fiddling with the files, though.
Overleaf seems to handle it just fine.

2 Answers

I guess that you need to do something like this:

documentclass{article}

newdimenmulw  mulw=3em
defmul #1x#2=#3#4 {vbox{hbox tomulw{hfil$#1$ }hbox tomulw{$timeshfil#2$ }%
   smallskiphrulesmallskip hbox tomulw{hfil$#3#4$ }}hskip1em plus.3emrelax}

begin{document}

noindent
mul 3 x 4 = 12
mul 1 x 7 = 7
mul 1 x 6 = 6
mul 5 x 5 = 25
mul 1 x 1 = 1

end{document}

Answered by wipet on July 29, 2021

Similarly as is in @wipet's answer (+1) but more elementary with use of the makecell:

documentclass{article}
usepackage{makecell}

begin{document}
[setlengtharraycolsep{12pt}
    begin{array}{*{10}{c}}
makecell[tr]{ 3  times 4  hline = 12 }&
makecell[tr]{ 1  times 7  hline = 7  }&
makecell[tr]{ 1  times 6  hline = 6  }&
makecell[tr]{ 5  times 5  hline = 25 }&
makecell[tr]{ 1  times 1  hline = 1  }&
%
makecell[tr]{ 3  times 4  hline = 12 }&
makecell[tr]{ 1  times 7  hline = 7  }&
makecell[tr]{ 1  times 6  hline = 6  }&
makecell[tr]{ 5  times 5  hline = 25 }&
makecell[tr]{ 1  times 1  hline = 1  }
    end{array}
]
end{document}

enter image description here

Answered by Zarko on July 29, 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