[Tex/LaTex] Formatting text inside minipage

formattingminipage

If I use \begin{textbf} and \end{textbf} (for example) inside a minipage, it seems to apply only to the first character. Here's a simple example:

\documentclass{article}

\begin{document}

\begin{minipage}{10cm}
\begin{textbf}
This is a test.
\end{textbf}
\end{minipage}

\end{document}

Only the "T" of "This" appears bold. Am I doing something very stupid? (Probably!)

Best Answer

\begin{textbf}
This
\end{textbf}

is

\begingroup\textbf This \endgroup

which is

\begingroup\textbf{T}his \endgroup

So the fact that it only affects the T is unrelated to the minipage.

You want the declarative version \bfseries not the \textbf command which takes an argument.

\begin{minipage}{3cm}\bfseries
 This
\end{minipage}