1

I am using kbordermatrix to display data in my appendix, they are wrapped in equations.

As only one of these matrices seem to fit per page and they are positioned at the bottom of the pages, I have several pages with are empty at their top half. I wondered if there is a way to either put them on top or at least centered.

Here is one of the tables as example:

\documentclass{book}
\begin{equation}
\renewcommand{\kbldelim}{(}% Left delimiter
\renewcommand{\kbrdelim}{)}% Right delimiter
DPWM_{Zld\_rep 2} = \kbordermatrix{
    &pos\,1&pos\,2&pos\,3&pos\,4&pos\,5&pos\,6 \\
    AA & 4.98e-2 &3.62e-3 &1.31e-3 &1.52e-3 &1.37e-2 &1.37e-1\\
    AC & 1.62e-2 &9.04e-3 &1.37e-3 &3.34e-4 &1.74e-2 &1.67e-1\\
    AG & 3.42e-2 &7.32e-1 &4.58e-3 &1.72e-5 &6.45e-3 &2.21e-1\\
    AT & 1.79e-2 &1.58e-2 &1.83e-4 &1.97e-3 &1.34e-2 &9.28e-2\\
    CA & 3.38e-1 &4.73e-3 &8.41e-3 &7.04e-6 &6.64e-2 &4.91e-2\\
    CC & 2.13e-2 &3.91e-3 &2.04e-2 &1.17e-2 &5.48e-2 &3.89e-2\\
    CG & 3.50e-2 &4.62e-2 &1.14e-2 &1.66e-5 &3.47e-2 &3.80e-2\\
    CT & 3.93e-2 &4.38e-3 &4.35e-4 &1.88e-3 &4.88e-2 &4.16e-2\\
    GA & 6.34e-2 &2.69e-3 &2.32e-3 &2.30e-2 &3.41e-2 &1.79e-2\\
    GC & 2.66e-2 &1.56e-3 &2.21e-3 &1.12e-1 &3.05e-2 &4.14e-2\\
    GG & 3.39e-2 &7.59e-2 &9.27e-1 &5.75e-2 &1.49e-2 &2.34e-2\\
    GT & 2.50e-2 &4.63e-3 &3.90e-4 &7.89e-1 &2.21e-2 &2.96e-2\\
    TA & 2.16e-1 &5.47e-3 &1.26e-5 &1.25e-6 &4.67e-1 &2.67e-2\\
    TC & 2.09e-2 &1.62e-3 &1.14e-5 &9.06e-4 &8.05e-2 &2.85e-2\\
    TG & 2.66e-2 &8.53e-2 &2.00e-2 &9.71e-6 &4.96e-2 &2.13e-2\\
    TT & 3.59e-2 &3.29e-3 &4.07e-6 &3.32e-4 &4.52e-2 &2.58e-2\\
}
\end{equation}

Here is how it looks at the moment: enter image description here

6
  • Please tell us which document class you employ.
    – Mico
    Commented Dec 3, 2019 at 12:43
  • Thanks, I updated the question accordingly
    – MaxS
    Commented Dec 3, 2019 at 12:52
  • Try \raggedbottom at the start of that chapter.
    – Tiuri
    Commented Dec 3, 2019 at 13:03
  • @Tiuri that moved to to the top, very cool! Is there also a comparable function to put it central? if not, post it as an answer!
    – MaxS
    Commented Dec 3, 2019 at 13:06
  • 1
    Not in a similar way, AFAIK. To have it centered on a page, I would rather put each equation in a figure environment with the p! placement option.
    – Tiuri
    Commented Dec 3, 2019 at 13:07

1 Answer 1

1

To have the first equation not at the bottom of an empty page, you can add \raggedbottom to the specific chapter which disables the automatic vertical distribution of content on the page (which leads to this behaviour). To change back to the default setting for later chapters, use \flushbottom.

To have an equation vertically centered on its own page, I would suggest to put the equation inside a figure environment (or other float) with the p! positioning option.

The following example demonstrates the two possibilities:

\documentclass{book}
\usepackage{showframe}
\newcommand{\myarray}{\begin{array}{ccccccc}
    &pos\,1&pos\,2&pos\,3&pos\,4&pos\,5&pos\,6 \\
    AA & 4.98e-2 &3.62e-3 &1.31e-3 &1.52e-3 &1.37e-2 &1.37e-1\\
    AC & 1.62e-2 &9.04e-3 &1.37e-3 &3.34e-4 &1.74e-2 &1.67e-1\\
    AG & 3.42e-2 &7.32e-1 &4.58e-3 &1.72e-5 &6.45e-3 &2.21e-1\\
    AT & 1.79e-2 &1.58e-2 &1.83e-4 &1.97e-3 &1.34e-2 &9.28e-2\\
    CA & 3.38e-1 &4.73e-3 &8.41e-3 &7.04e-6 &6.64e-2 &4.91e-2\\
    CC & 2.13e-2 &3.91e-3 &2.04e-2 &1.17e-2 &5.48e-2 &3.89e-2\\
    CG & 3.50e-2 &4.62e-2 &1.14e-2 &1.66e-5 &3.47e-2 &3.80e-2\\
    CT & 3.93e-2 &4.38e-3 &4.35e-4 &1.88e-3 &4.88e-2 &4.16e-2\\
    GA & 6.34e-2 &2.69e-3 &2.32e-3 &2.30e-2 &3.41e-2 &1.79e-2\\
    GC & 2.66e-2 &1.56e-3 &2.21e-3 &1.12e-1 &3.05e-2 &4.14e-2\\
    GG & 3.39e-2 &7.59e-2 &9.27e-1 &5.75e-2 &1.49e-2 &2.34e-2\\
    GT & 2.50e-2 &4.63e-3 &3.90e-4 &7.89e-1 &2.21e-2 &2.96e-2\\
    TA & 2.16e-1 &5.47e-3 &1.26e-5 &1.25e-6 &4.67e-1 &2.67e-2\\
    TC & 2.09e-2 &1.62e-3 &1.14e-5 &9.06e-4 &8.05e-2 &2.85e-2\\
    TG & 2.66e-2 &8.53e-2 &2.00e-2 &9.71e-6 &4.96e-2 &2.13e-2\\
    TT & 3.59e-2 &3.29e-3 &4.07e-6 &3.32e-4 &4.52e-2 &2.58e-2\\
    GT & 2.50e-2 &4.63e-3 &3.90e-4 &7.89e-1 &2.21e-2 &2.96e-2\\
    TA & 2.16e-1 &5.47e-3 &1.26e-5 &1.25e-6 &4.67e-1 &2.67e-2\\
    TC & 2.09e-2 &1.62e-3 &1.14e-5 &9.06e-4 &8.05e-2 &2.85e-2\\
    TG & 2.66e-2 &8.53e-2 &2.00e-2 &9.71e-6 &4.96e-2 &2.13e-2\\
    TT & 3.59e-2 &3.29e-3 &4.07e-6 &3.32e-4 &4.52e-2 &2.58e-2\\
\end{array}}
\begin{document}
\raggedbottom
\begin{equation}
A=\myarray
\end{equation}
\begin{equation}
A=\myarray
\end{equation}
\begin{figure}[!p]
\begin{equation}
A=\myarray
\end{equation}
\end{figure}
\end{document}

enter code here

1
  • 1
    You might consider creating a new float class using newfloat (or float, if you don't mind the side effects). That way you can add captions and have a list of matrices. Commented Dec 3, 2019 at 15:07

You must log in to answer this question.

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