# How to make the table fit better?

As you can probably see, it is far too long... or wide or whatever.

$$\begin{array} {|c|c|c|c|c|} \hline & \text{Equality} & eq(x,y): & \mathbb{R}\times\mathbb{R}\to\mathbb{B} & 1-|\operatorname{sgn}(x-y)| \\ \hline & \text{Digit At} & dat(x,b,i): & \mathbb{R}\times\mathbb{N}\times\mathbb{Z}\to\mathbb{N} & \left\lfloor\frac{|x|}{b^i}\right\rfloor\mod b \\ \hline & \text{Number of Digits} & nd(x,b): & \mathbb{N}\times\mathbb{N}\to\mathbb{N} & \lceil\log_b(x+1)\rceil \\ \hline & \text{Reverse} & rev(x,b): & \mathbb{N}\times\mathbb{N}\to\mathbb{N} & \sum_{i=0}^{nd(x,b)-1}dat(x,b,I)\cdot10^{nd(x,b)-i-1} \\ \hline & \text{Sum Digits} & sd(x,b): & \mathbb{N}\times\mathbb{N}\to\mathbb{N} & \sum_{i=0}^{nd(x,b)-1}dat(x,b,i)\\ \hline & \text{Look and Say Counter} & C_\lambda(x,i): & \mathbb{N}\times\mathbb{N}\to\mathbb{N} & sd(x\mod10^i,10) \\ \hline & \text{Unpadded Difference} & \delta(x): & \mathbb{N}\to\mathbb{N} & \sum_{i=0}^{nd(x,10)-2}10^i\cdot(1-eq(dat(x,10,i),dat(x,10,i+1))) \\ \hline & \text{Padded Difference} & \Delta(x): & \mathbb{N}\to\mathbb{N} & 10^{nd(x,10)}+10\cdot\delta(x)+1 \\ \hline & \text{Leftmost Index} & il(x,i): & \mathbb{N}\times\mathbb{Z}\to\mathbb{Z} & nd(x\mod10^{i+1},10)-1 \\ \hline & \text{Rightmost Index} & ir(x,i): & \mathbb{N}\times\mathbb{Z}\to\mathbb{Z} & nd(x,10)-nd\left(rev\left(\left\lfloor\frac{x}{10^{i+1}}\right\rfloor,10\right),10\right) \\ \hline & \text{Look and Say} & L(x): & \mathbb{N}\to\mathbb{N} & \sum_{i=0}^{nd(\Delta(x),10)-2}\left(dat(\Delta(x),10,i)\cdot\left(\left(ir(\Delta(x),i)-i\right)\cdot10^{1+2\cdot C_\lambda(\Delta(x),i)}+dat(x,10,i)\cdot10^{2\cdot C_\lambda(\Delta(x),i)}\right)\right) \end{array}$$


Can I make this fit better? Perhaps set a max width to each section and have it warp down when it hits that limiting size?

I previously asked this question here.

• – Mark Booth Nov 7 '16 at 12:07

It strikes me as similar to formatting problems I try to fix in posts, where "run-on equations" (equation chains) laid out in a single line may not wrap well. The worst case is that the mathematical expressions run over into the sidebar and are unreadable. The effect is somewhat dependent on the user's choice of Math Renderer (under Math Settings when you right-click on a MathJax expression).

An example of my editing to split such lines is A Formulation of the Riemann Hypothesis, in which I modified four of the run-on equations.

The MathJax Basic Tutorial and Quick Reference thread here on meta.Math.SE has several mentions of \begin{align} and begin{aligned}. My practice is to use \begin{align*} but I'm not conversant with the finer distinctions among these environments. However see this Answer for a suggestion on formatting a single expression into multiple lines and "columns" of a sort.

So at this point it is just a thought that the contents of the last column of your table could be more narrowly formatted using such an environment. Let me try my hand at demonstrating this for you.

\begin{array} {|c|c|c|c|c|} \hline & \text{Equality} & eq(x,y): & \mathbb{R}\times\mathbb{R}\to\mathbb{B} & 1-|\operatorname{sgn}(x-y)| \\ \hline & \text{Digit At} & dat(x,b,i): & \mathbb{R}\times\mathbb{N}\times\mathbb{Z}\to\mathbb{N} & \left\lfloor\frac{|x|}{b^i}\right\rfloor\mod b \\ \hline & \begin{aligned} \text{Number} \\ \text{of Digits}\end{aligned} & nd(x,b): & \mathbb{N}\times\mathbb{N}\to\mathbb{N} & \lceil\log_b(x+1)\rceil \\ \hline & \text{Reverse} & rev(x,b): & \mathbb{N}\times\mathbb{N}\to\mathbb{N} & \sum_{i=0}^{nd(x,b)-1}dat(x,b,I)\cdot10^{nd(x,b)-i-1} \\ \hline & \text{Sum Digits} & sd(x,b): & \mathbb{N}\times\mathbb{N}\to\mathbb{N} & \sum_{i=0}^{nd(x,b)-1}dat(x,b,i)\\ \hline & \begin{aligned} \text{Look and Say} \\ \text{Counter} \;\;\;\; \end{aligned} & C_\lambda(x,i): & \mathbb{N}\times\mathbb{N}\to\mathbb{N} & sd(x\bmod10^i,10) \\ \hline & \begin{aligned} \text{Unpadded} \\ \text{Difference} \end{aligned} & \delta(x): & \mathbb{N}\to\mathbb{N} & \begin{aligned} \sum_{i=0}^{nd(x,10)-2}10^i\cdot \left[ 1-eq(dat(x,10,i), \\ dat(x,10,i+1))\right] \end{aligned} \\ \hline & \begin{aligned} \text{Padded}\;\; \\ \text{Difference} \end{aligned} & \Delta(x): & \mathbb{N}\to\mathbb{N} & 10^{nd(x,10)}+10\cdot\delta(x)+1 \\ \hline & \begin{aligned} \text{Leftmost}\\ \text{Index} \;\;\; \end{aligned} & il(x,i): & \mathbb{N}\times\mathbb{Z}\to\mathbb{Z} & nd(x\bmod10^{i+1},10)-1 \\ \hline &\begin{aligned} \text{Rightmost}\\ \text{Index} \;\;\;\; \end{aligned} & ir(x,i): & \mathbb{N}\times\mathbb{Z}\to\mathbb{Z} & nd(x,10)-nd\left(rev\left(\left\lfloor\frac{x}{10^{i+1}}\right\rfloor,10\right),10\right) \\ \hline & \text{Look and Say} & L(x): & \mathbb{N}\to\mathbb{N} & \begin{aligned}\sum_{i=0}^{nd(\Delta(x),10)-2}\left[dat(\Delta(x),10,i)\cdot \\ \left( \left(ir(\Delta(x),i)-i\right)\cdot10^{1+2\cdot C_\lambda(\Delta(x),i)} \\ + dat(x,10,i)\cdot10^{2\cdot C_\lambda(\Delta(x),i)}\right)\right] \end{aligned} \\ \hline \end{array}

Above I have not only used the aligned environment in a few last column entries, I also applied the idea to the first (nonempty) column to split text across two lines for some entries. I used a few more tricks for spacing, such as replacing \mod with \bmod.

• I actually borrowed the basic format from the synthetic division comment of the division based answer with 13 likes on it. – Simply Beautiful Art Sep 2 '16 at 1:29