I am trying to use the subcaption
package for horizontally aligning up some figures, and I did as the documentation instructs me to do, yet the result is these are vertically aligned. It really confuses me.
\documentclass{article}
\usepackage[font=small]{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{xltxtra}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Linux Libertine O}
\begin{document}
\begin{figure}[htp]
\centering
\begin{minipage}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{fig/bed1.jpg}
\subcaption{Bedroom 1}
\end{minipage}
\begin{minipage}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{fig/bed2.jpg}
\subcaption{Bedroom 2}
\end{minipage}
\caption{Two bedrooms}
\end{figure}
\end{document}