I have long equation, Ax=b
that I want to put a frame around. I can't use mdframed
since I need to also compile this with tex4ht, which still does not support mdframed
. So I use this trick setup:
\fbox{
\noindent\begin{minipage}{\linewidth}
\scriptsize
\[
\begin{bmatrix}
...
\end{bmatrix}
\]
\end{minipage}
}
\normalsize
This works, but the problem with the above, is that the fbox does not fit the whole minipage
. Here is screen
Without minipage and no frame, here is how it looks like:
My question is: How can one automatically have fbox
fit the minipage content? The solution has to also compile with not errors with tex4ht
. Is there a way to tell Latex to shift the page margin to the left more, just in the minipage? i.e. make the minipage uses custom geometry
? I tried this
\fbox{
\noindent\begin{minipage}{\linewidth}
\newgeometry{left=.1in,right=.1in,top=1in,bottom=1in}
\scriptsize
....
But it made things worst. I do get these messages from lualatex, but this is because the equations are too wide. But they are still in the page.
Overfull \hbox (31.09998pt too wide) in paragraph at lines 49--51
[][][]
Here is the MWE. Sorry for large equation size, but this is the example am working on.
\documentclass[11pt]{report}%
\usepackage{amsmath,mathtools}
\usepackage[paperheight=11in,paperwidth=8.5in,top=.7in,bottom=.7in,
left=1.2in, right=.8in]{geometry}
\begin{document}
Therefore, the $Ax=b$ system to solve is%
\fbox{
\noindent\begin{minipage}{\linewidth}
\scriptsize
\[%
\begin{bmatrix}
7 & \left( -4-\frac{1}{2}h^{3}\right) & 1 & 0 & \cdots & 0 & 0 & 0\\
\left( -4+\frac{1}{2}h^{3}\right) & 6 & \left( -4-\frac{1}{2}h^{3}\right)
& 1 & 0 & \cdots & 0 & 0\\
1 & \left( -4+\frac{1}{2}h^{3}\right) & 6 & \left( -4-\frac{1}{2}%
h^{3}\right) & 1 & 0 & \cdots & 0\\
0 & 1 & \left( -4+\frac{1}{2}h^{3}\right) & 6 & \left( -4+\frac{1}{2}%
h^{3}\right) & 1 & 0 & \cdots\\
0 & 0 & \left( -4+\frac{1}{2}h^{3}\right) & 6 & \left( -4+\frac{1}{2}%
h^{3}\right) & 1 & 0 & \cdots\\
& & & & & & & \\
& & & & & & & \\
& & & & & & &
\end{bmatrix}%
\begin{bmatrix}
y_{1}\\
y_{2}\\
y_{3}\\
y_{4}\\
\vdots\\
y_{N-2}\\
y_{N-1}\\
y_{N}%
\end{bmatrix}
=%
\begin{bmatrix}
h^{4}e^{h}-2hy_{0}^{\prime}+y_{0}\left( 4-\frac{1}{2}h^{3}\right) \\
h^{4}e^{2h}-y_{0}\\
h^{4}e^{3h}\\
h^{4}e^{4h}\\
\vdots\\
\\
\\
\end{bmatrix}
\]
\end{minipage}
}
\normalsize
Therefore ...
\end{document}
compiled using lualatex foo.tex
TL 2015