What's the problem with this code? Overfull \hbox

I want to create something like this in word by MathType 6.9

But I have MikTex 2.9 and texmaker installed on my computer. Just to try out the code and see what is wrong with that, I've created the following document in LaTeX.

\documentclass[a4paper]{book}
\usepackage{amsmath}

\begin{document}
\begin{align}
T_4 &= \langle \underline{k}\,.\,\underline{k}^{*^T} \rangle=
\left\langle
\begin{bmatrix}
\left|k_1\right|^2 & k_1k_2^* & k_1k_3^* & k_1k_4^*\\
k_2k_1^* & \left|k_2\right|^2 & k_2k_3^* & k_2k_4^*\\
k_3k_1^* & k_3k_2^* & \left|k_3\right|^2 & k_3k_4^*\\
k_4k_1^* & k_4k_2^* & k_4k_3^* & \left|k_4\right|^2
\end{bmatrix}
\right\rangle
\\
&=\frac{1}{2}
\begin{split}
\left[\begin{matrix}
\langle|S_{XX}+S_{YY}|^2\rangle &
\langle(S_{XX}+S_{YY})(S_{XX}-S_{YY})^*\rangle &\\
\langle(S_{XX}-S_{YY})(S_{XX}+S_{YY})^*\rangle &
\langle|S_{XX}-S_{YY}|^2\rangle & \cdots\cdots\\
\langle(S_{XY}+S_{YX})(S_{XX}+S_{YY})^*\rangle&
\langle(S_{XY}+S_{YX})(S_{XX}-S_{YY})^*\rangle & \cdots\cdots\\
\langle j(S_{XY}-S_{YX})(S_{XX}+S_{YY})^*\rangle &
\langle j(S_{XY}-S_{YX})(S_{XX}-S_{YY})^*\rangle &
\end{matrix}\right.\\
\left.\begin{matrix}
& \langle(S_{XX}+S_{YY})(S_{XY}+S_{YX})^*\rangle
& \langle -j(S_{XX}+S_{YY})(S_{XY}-S_{YX})^*\rangle\\
\cdots\cdots& \langle(S_{XX}-S_{YY})(S_{XY}+S_{YX})^*\rangle
& \langle -j(S_{XX}-S_{YY})(S_{XY}-S_{YX})^*\rangle\\
\cdots\cdots& \langle|S_{XY}+S_{YX}|^2\rangle
& \langle-j(S_{XY}+S_{YX})(S_{XY}-S_{YX})^*\rangle\\
& \langle j(S_{XY}-S_{YX})(S_{XY}+S_{YX})^*\rangle
& \langle|S_{XY}-S_{YX}|^2\rangle
\end{matrix}\right]
\end{split}
\end{align}
\end{document}


But there's a warning Overfull \hbox (213.43704pt too wide) in paragraph at lines 39--39.
Line 39 is \end{align}
and the created pdf is like this:

I also deleted the document parts and tried out the code from begin{align} to end{aline} in MathType 6.9 but there it is like this:

It seems that begin{split} and end{split} is making something wrong!!! What should I do?

• the mathtype specific parts of the question are off topic for this forum, mathtype does not use tex. like many other tex-to-xx convertors it reads a small subset of tex-like syntax. there may be other sites in teh stackexchange network that are more suitable. – David Carlisle Aug 9 '15 at 20:13
• @DavidCarlisle Can you suggest me a site in stack exchange where I can ask my mathtype related question? – Sepideh Abadpour Aug 9 '15 at 20:17
• No sorry I know nothing about it at all, you could try the main stack overflow one, but it's not tex related – David Carlisle Aug 9 '15 at 20:20
• Does multline exist in MathType? If so, try replacing align with multline, and remove \begin{split} and \end{split}. – Torbjørn T. Aug 10 '15 at 8:18

Using the aligned environment instead of split there is no problem, especially if you add the geometry package:

\documentclass[a4paper]{book}
\usepackage{geometry}
\usepackage{amsmath}

\begin{document}

\begin{align}
T_4 &= \langle \underline{k}\,.\,\underline{k}^{*^T} \rangle=
\left\langle
\begin{bmatrix}
\left|k_1\right|^2 & k_1k_2^* & k_1k_3^* & k_1k_4^* \\
k_2k_1^* & \left|k_2\right|^2 & k_2k_3^* & k_2k_4^* \\
k_3k_1^* & k_3k_2^* & \left|k_3\right|^2 & k_3k_4^* \\
k_4k_1^* & k_4k_2^* & k_4k_3^* & \left|k_4\right|^2
\end{bmatrix}
\right\rangle
\\
&=\frac{1}{2}
\!\begin{aligned}[t]
& \left[\begin{matrix}
\langle|S_{XX}+S_{YY}|^2\rangle &
\langle(S_{XX}+S_{YY})(S_{XX}-S_{YY})^*\rangle &\\
\langle(S_{XX}-S_{YY})(S_{XX}+S_{YY})^*\rangle &
\langle|S_{XX}-S_{YY}|^2\rangle & \cdots\cdots\\
\langle(S_{XY}+S_{YX})(S_{XX}+S_{YY})^*\rangle&
\langle(S_{XY}+S_{YX})(S_{XX}-S_{YY})^*\rangle & \cdots\cdots\\
\langle j(S_{XY}-S_{YX})(S_{XX}+S_{YY})^*\rangle &
\langle j(S_{XY}-S_{YX})(S_{XX}-S_{YY})^*\rangle &
\end{matrix}\right.\\
& \left.\begin{matrix}
& \langle(S_{XX}+S_{YY})(S_{XY}+S_{YX})^*\rangle
& \langle -j(S_{XX}+S_{YY})(S_{XY}-S_{YX})^*\rangle\\
\cdots\cdots& \langle(S_{XX}-S_{YY})(S_{XY}+S_{YX})^*\rangle
& \langle -j(S_{XX}-S_{YY})(S_{XY}-S_{YX})^*\rangle\\
\cdots\cdots& \langle|S_{XY}+S_{YX}|^2\rangle
& \langle-j(S_{XY}+S_{YX})(S_{XY}-S_{YX})^*\rangle\\
& \langle j(S_{XY}-S_{YX})(S_{XY}+S_{YX})^*\rangle
& \langle|S_{XY}-S_{YX}|^2\rangle
\end{matrix}\right]
\end{aligned}
\end{align}

\end{document}


• yes you are right. Both your code and Tarass's work in Latex environment but when I want to add them in MS word with the help of Mathtype they do not work. In fact it seems that Mathtype does not have the ability to parse some codes of Latex to equations of word. And my main problem is I need this MS word document and I should submit it to my professor. Do you know of any way other than Mathtype to directly enter latex equations into MS Word? – Sepideh Abadpour Aug 9 '15 at 19:19
• But Mathtype doesn't parse simple amsmath code? – Bernard Aug 9 '15 at 19:49
• seems that it does not. I'm now searching the site to find other way than mathtype or to export .doxc from latex and then copy-paste the equation into my thesis document – Sepideh Abadpour Aug 9 '15 at 19:52
• Maybe Word would understand mathml? Or includig the equation as a .pdf image (so that it remains zoomable). – Bernard Aug 9 '15 at 20:02
• htlatex is a script from TeX4ht that converts TeX files to html, using MathML. I don't know if you've seen this thread – Bernard Aug 9 '15 at 20:15

\documentclass[a4paper]{book}
\usepackage{amsmath}

\begin{document}
{\setlength{\arraycolsep}{1.5pt}
$\begin{array}{rclc} T_4 &=& \langle \underline{k}\,.\,\underline{k}^{*^T} \rangle= \left\langle \begin{bmatrix} \left|k_1\right|^2 & k_1k_2^* & k_1k_3^* & k_1k_4^*\\ k_2k_1^* & \left|k_2\right|^2 & k_2k_3^* & k_2k_4^*\\ k_3k_1^* & k_3k_2^* & \left|k_3\right|^2 & k_3k_4^*\\ k_4k_1^* & k_4k_2^* & k_4k_3^* & \left|k_4\right|^2 \end{bmatrix} \right\rangle &(1)\\ \\[-.5em] &=&\frac{1}{2} \left[\begin{matrix} \langle|S_{XX}+S_{YY}|^2\rangle & \langle(S_{XX}+S_{YY})(S_{XX}-S_{YY})^*\rangle &\\ \langle(S_{XX}-S_{YY})(S_{XX}+S_{YY})^*\rangle & \langle|S_{XX}-S_{YY}|^2\rangle & \cdots\\ \langle(S_{XY}+S_{YX})(S_{XX}+S_{YY})^*\rangle& \langle(S_{XY}+S_{YX})(S_{XX}-S_{YY})^*\rangle & \cdots\\ \langle j(S_{XY}-S_{YX})(S_{XX}+S_{YY})^*\rangle & \langle j(S_{XY}-S_{YX})(S_{XX}-S_{YY})^*\rangle & \end{matrix}\right. \\ &&&(2)\\[-.5em] &&\hfill \left.\begin{matrix} \langle(S_{XX}+S_{YY})(S_{XY}+S_{YX})^*\rangle & \langle -j(S_{XX}+S_{YY})(S_{XY}-S_{YX})^*\rangle\\ \langle(S_{XX}-S_{YY})(S_{XY}+S_{YX})^*\rangle & \langle -j(S_{XX}-S_{YY})(S_{XY}-S_{YX})^*\rangle\\ \langle|S_{XY}+S_{YX}|^2\rangle & \langle-j(S_{XY}+S_{YX})(S_{XY}-S_{YX})^*\rangle\\ \langle j(S_{XY}-S_{YX})(S_{XY}+S_{YX})^*\rangle & \langle|S_{XY}-S_{YX}|^2\rangle \end{matrix}\right] \end{array}$}
\end{document}

• very nice answer for latex but not for mathtype an thus can not be entered in MS word as an equation – Sepideh Abadpour Aug 9 '15 at 18:01
• I had a doubt if you are using MS word or latex. Could you crop the produced pdf and include it in your Word document ? – Tarass Aug 9 '15 at 18:04
• If you can use Libre Office instead of MS, you can install TexMaths here :extensions.libreoffice.org/extension-center/texmaths-1. Then double click on the pi icone and past the code between begin and end document. The result is perfect. I just Tried. See the new photo in my answer. – Tarass Aug 9 '15 at 18:20
• If you select the picture in LO, ans click the pi icone, you can edit again your code. I maybe exists something like that in MS word otherwise use LO. – Tarass Aug 9 '15 at 18:24
• Both linux, Windows, Mac - what is both for three ? – Tarass Aug 9 '15 at 18:25