# Understanding minipages alignment

I know this might be repeated in Understanding minipages - aligning at top. But I could just not make sense from those answers. The code in MWE I have is a bit different and simpler. This code was actually found in this other webpage, which I found to be very helpful despite giving me this confusing about minipage alignment.

MWE

\documentclass{article}
\begin{document}
\fbox{\begin{minipage}[t]{0.5\linewidth}
This is the first paragraph and its width is half of the line-width. This minipage environment is quite essential in positioning of texts.
\end{minipage}}
\fbox{\begin{minipage}[b]{0.5\linewidth}
This is the second paragraph and its width is half of the line-width. We must understand the usage of the different position values.
\end{minipage}}
\end{document


Expectation

To have the first paragraph on the top, and the second on the bottom.

Output

Exactly the opposite.

\begin{minipage}[t]{dimen}text\end{minipage} is \vtop{\parindent=0pt\hsize=dimen text} from primitive point of view. It means, it is implementd by \vtop, On the other hand, \begin{minipage}[b] is implemented by \vbox and a minipage without vertical specification is implemented as \vcenter. These three TeX primitives create a box with given vertical material and their differnce is only where the baseline of such box is. \vbox has its baseline at baseline of the last element, \vtop has baseline at the first element, \vcenter has its baseline, that it is centered at math axis.

The name \vtop (top) means that two \vtops (side by side) are verticaly aligned by their top element.

More about boxes: for example in TeX in a nutshell, section 7 and page 18.

As you require, the first minipage  has its baseline at its top line of content, the second one at its bottom line. Consequently they are aligned as you show in the image. To better see this, lets add some text out of minipages:

\documentclass{article}

\begin{document}
Here is baseline \fbox{\begin{minipage}[t]{0.4\linewidth}
This is the first paragraph and its width is half of the line-width. This minipage environment is quite essential in positioning of texts.
\end{minipage}}
\fbox{\begin{minipage}[b]{0.4\linewidth}
This is the second paragraph and its width is half of the line-width. We must understand the usage of the different position values.
\end{minipage}}
\end{document}


If I correctly understand you, what you like to have, you need interchange minipages positions specifications:

\documentclass{article}

\begin{document}
Here is baseline \fbox{\begin{minipage}[b]{0.4\linewidth}
Here the baseline of minipage content is due to used [b] position specification at bottom line of the text in the minipage.
\end{minipage}}
\fbox{\begin{minipage}[t]{0.4\linewidth}
Here the baseline of minipage content is due to used [t] position specification at top line of the text in the minipage.
\end{minipage}}
Here is baseline\fbox{\begin{minipage}{0.4\linewidth}
The baseline of minipage content is due to used default position (without position specification)  at midle line of the text in the minipage.
\end{minipage}}
\fbox{\begin{minipage}{0.4\linewidth}
The baseline of minipage content is due to used default position (without position specification) at middle of the text in the minipage.
\end{minipage}}
\end{document}


and you will get:

• the image does not correspond to the code -- in the second code Aug 26 at 0:40
• @jsbibra, you are right. The second image is repeated the first one. Now corrected and added code for the last two minipages. Thank you very much to pointed me to this mismatch in answer. Aug 26 at 5:39