I'm using thmbox
and it seems it does not properly understand page size.
When it splits a box between pages, sometimes it writes over the page number.
Is this an error in my document, or is it that extreport
does not play well with thmbox
, or is this simply a bug in thmbox? Is there a way I can fix it? If I completely turn of cutting as explained here, it no longer writes over the page number, but it now refuses to cut boxes
between pages, which is not good for long theorems, etc.
I'm including a pretty small working example. It is difficult to produce a really short example at it seems to be triggered by long documents. This LaTeX code produces a 5 page document. You can see the error at the bottom of page 4 where the definition of determinant cuts between pages, and the page number (4) is written over by the math formula. $a_{1k}$
Here is a zoomed out view of the confused definition.
I also notice the math equation falls outside the theorem box.
Perhaps it is something to do with extreport
and math mode? However, I only see then problem with equations inside the box.
\documentclass[14pt]{extreport}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{thmbox}
\newtheorem[bodystyle=\normalfont\noindent]{theorem}{Theorem}[section]
\newtheorem[bodystyle=\normalfont\noindent]{definition}[theorem]{Definition}
\newcommand\jleft{\mathopen{}\mathclose\bgroup\left}
\newcommand\jright{\aftergroup\egroup\right}
\newcommand\jparen[1]{\jleft(#1\jright)}
\newcommand\supress[2]{{\mathfrak{S}_{#2}\jparen{#1}}}
\newcommand\cvec[1]{\begin{bmatrix} #1 \end{bmatrix}}
\newcommand{\abs}[1]{{\left| #1 \right|}}
\title{Practical Linear Algebra}
\author{Jim Newton}
\begin{document}
\chapter{Matrices}
\label{ch.matrices}
\section{Definition}
What is a matrix?
\begin{enumerate}
\item Mathematical definition.
\item Representing in Python
\end{enumerate}
\section{Addition}
Matrices are added component-wise.
If two matrices $A$ and $B$ each have dimensions $n\times m$, i.e., $n$ rows and $m$ columns,
then the can be added and the compnent in the row $i$ column $j$ of the sum
is exactly $c_{ij}=a_{ij}+b_{ij}$.
\begin{align*}
\begin{bmatrix}
a_{11}&a_{12}&\cdots&a_{1m}\\
a_{21}&a_{22}&\cdots&a_{2m}\\
\vdots & \vdots &&\vdots\\
a_{n1}&a_{n2}&\cdots&a_{nn}
\end{bmatrix} +
\begin{bmatrix}
b_{11} & b_{12} &\cdots & b_{1n}\\
b_{21} & b_{22} &\cdots & b_{2n}\\
\vdots & \vdots & & \vdots\\
b_{n1} & b_{n2} &\cdots & b_{nn}
\end{bmatrix} =\\
\begin{bmatrix}
a_{11}+b_{11} & a_{12}+b_{12} & \cdots & a_{1n}+b_{1n}\\
a_{21}+b_{21} & a_{22}+b_{22} & \cdots & a_{2n}+b_{2n}\\
\vdots & \vdots & &\vdots\\
a_{n1}+b_{n1} & a_{n2}+b_{n2} & \cdots & a_{nn}+b_{nn}
\end{bmatrix}
\end{align*}
Matrix addition is commutative when the components are themselves
commutative. For example if the components are integers or real
numbers.
The $n\times m$ zero matrix is the additive identity for the set of $n\times m$ matrices.
\section{Multiplication}
Two matrices, $A$ and $B$, can be multiplied if their dimensions are
compatible. The requirement is that an $n\times k$ (on the left) can
be multiplied by a $k \times n$ matrix to obtain an $n\times m$
matrix.
Matrix multiplication is, in general, not commutative. However, there
do exist pairs of matricies which are commutative under
multiplication. E.g., $A^n \times A^m = A^{n+m} = A^{m+n} = A^m\times
A^n$. Also if a matrix is invertable, then $A \times A^{-1} = I =
A^{-1}\times A$.
We may multiply two matricies
\begin{align*}
A &= \begin{bmatrix}
a_{11}&a_{12}&\cdots&a_{1k}\\
a_{21}&a_{22}&\cdots&a_{2k}\\
\vdots & \vdots &&\vdots\\
a_{n1}&a_{n2}&\cdots&a_{nk}
\end{bmatrix}\\
B &=
\begin{bmatrix}
b_{11} & b_{12} &\cdots & b_{1n}\\
b_{21} & b_{22} &\cdots & b_{2n}\\
\vdots & \vdots & & \vdots\\
b_{k1} & b_{k2} &\cdots & b_{kn}
\end{bmatrix},
\end{align*}
to obtain a matrix with dimensions $n\times m$, and the component
$c_{ij}$, row $i$, column $j$, is exactly
\begin{equation}
c_{ij} = \sum_{k=1}^{k}a_{ik}b_{kj}
\end{equation}
There are many ways to think about this. One way is that we
\emph{multiply} the rows of $A$ by the columns of $B$. Another way to
think about it is that each $c_{ij}$ is the dot product of two
vectors, the i'th row vector from $A$ with the j'th column vector of
$B$. The dot product of two vectors having the same dimension is:
\begin{equation}
\cvec{a_1\\a_2\\\vdots\\a_n} \cdot \cvec{b_1\\b_2\\\vdots\\b_n} = \sum_{k=1}^{n} a_kb_k\,.
\end{equation}
There is an identity matrix for multiplication provided the matrices in question are square.
The identity matrix is denoted $I$
\begin{equation}
I = \begin{bmatrix}
1 & 0 & 0 & \cdots & 0 \\
0 & 1 & 0 & \cdots & 0 \\
0 & 0 & 1 & \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
0 & 0 & 0 & \cdots & 1
\end{bmatrix}
\end{equation}
For any square matrix $A$, we have $I\times A = A\times I = A$.
\section{Determinant}
We will present a method to compute the \emph{determinant} of a square
matrix, called the \emph{Laplacian expansion} method.
The determinant of a matrix which tells us whether the matrix has an
inverse. Some square matrices have an inverse and some do not. If
$\det\jparen{A}\ne 0$, then there exists a matrix, which we denote
$A^{-1}$, for which $A\times A^{-1} = A^{-1}A = I$. The inverse of a
matrix is compute intensive to calculate. In Chapter 3
we will begin talking about ways of computing the inverse.
Given an $n\times m$ matrix:
\begin{equation}
A = \begin{bmatrix}
a_{11}&a_{12}&\cdots&a_{1m}\\
a_{21}&a_{22}&\cdots&a_{2m}\\
\vdots & \vdots &\ddots&\vdots\\
a_{n1}&a_{n2}&\cdots&a_{nm}
\end{bmatrix}\,,
\end{equation}
we first define $\supress{A}{i,j}$ as the $(n-1) \times (m-1)$ matrix
formed by supressing the i'th row and j'th column of $A$.
\begin{definition}[determinant]\label{def.determinant}
We may define the determinant of a square, $n\times n$ matrix as:
\begin{equation}
\det\jparen{A} = \begin{cases}
a_{11} & \text{if } n = 1\\
\sum\limits_{k=1}^{n}(-1)^k a_{1k} \det\jparen{\supress{A}{1,k}} & \text{if } n > 1
\end{cases}
\end{equation}
We may also denote $\det\jparen{A}$ as $\abs{A}$.
\end{definition}
\end{document}