Why is there no space after my minipage but before my text?

Consider the following document.

\documentclass[12pt,a4paper]{article}
\usepackage{lipsum}
\pagestyle{empty}
\begin{document}
\begin{minipage}[t]{\textwidth}
\lipsum[1]
\end{minipage}
\medskip
{\large\scshape\bfseries\itshape Lorem Ipsum}
\medskip
\hrule
\medskip
\lipsum[2]
\end{document}

When I compile it with pdflatex it produces the following output.

Why is there no space after my minipage but before my text? I put a \medskip in between them.

\end{minipage}
\medskip
{\large\scshape\bfseries\itshape Lorem Ipsum}
\medskip

It seems that the \medskip before and after the text is being combined into one. How do I fix this?

• You have to learn how to properly use paragraphs. Also, \noindent. – Johannes_B Feb 9 at 5:20
• What would happen if you put a huge "A" instead of the minipage? What if you make a minipage as small as a normal character ? Your minipage is just like a huge character. That is, before of the minipage use \noindent to avoid paragraph indentation and after the minipage, left a blank line or use \par to end the paragraph. – Fran Feb 9 at 6:09
• Off-topic: the instruction \scshape\bfseries\itshape fails to produce the desired outcome, viz., bold-italic-smallcap letters, because the font in use doesn't feature letters that satisfy this combination of font attributes. You'll need to switch to something like Times Roman in order to produce the desired combination of font attributes. – Mico Feb 9 at 7:11

A minipage has no special spacing rules, it just acts like a big letter, so it is easier to see how \medskip (or \vspace) works just using letters:

\documentclass{article}

\begin{document}

\bigskip\hrule\bigskip

111 a b\\ c

\bigskip\hrule\bigskip

222 a \medskip b\\ c

\bigskip\hrule\bigskip

333 a

\medskip
b\\ c

\bigskip\hrule\bigskip

\end{document}

If you add a vertical space command mid-paragraph then it is saved in a special place (a \vadjust node) until after the paragraph has been broken in to lines, and then the extra space is inserted after the line that contained the original node. So in the 222 case the extra space comes after b even though \medskip is between a and b.

It is almost always more understandable if you put a blank line before any vertical space command, so that the vertical space command is seen in vertical mode, not mid-paragraph, in which case it acts immediately and adds space at that point, as in 333, where the space is between a and b.

Beside the missing paragraphs: you should also be aware that a minipage with [t] alignment is like a letter with a rather large descender (a large depth). This means that following lines are glued to the bottom at a fix distance (1pt by default). If you want the normal distance between lines you should end the text in the minipage with a \strut:

\documentclass[12pt,a4paper]{article}
\pagestyle{empty}
\begin{document}
X\begin{minipage}[t]{3cm}
t\\t\\t\\
aaaaaaaaaaa
\end{minipage}

xxxxxxx

\bigskip
X\begin{minipage}[t]{3cm}
t\\t\\t\\
yyyyyyyyyyyy
\end{minipage}

xxxxxxx

\bigskip
X\begin{minipage}[t]{3cm}
t\\t\\t\\
aaaaaaaaaaa\strut
\end{minipage}

xxxxxxx

\bigskip
X\begin{minipage}[t]{3cm}
t\\t\\t\\
yyyyyyyyyyyy\strut
\end{minipage}

xxxxxxx
\end{document}