I am using figure
and subfigure
environment. Inside subfigure
I am using includegraphics
. The figure
and subfigure
structure looks like following:
\begin{figure}
\begin{subfigure}[b]{.25\textwidth}
\centering
\includegraphics[width=.9\linewidth,keepaspectratio]{building1}
\caption{\textit{\small{building1}}}
\label{fig:1a}
\end{subfigure}
\begin{subfigure}[b]{.75\textwidth}
\centering
\includegraphics[width=.9\linewidth,height=100\lineheight pt,keepaspectratio]{building2}
\caption{\textit{\small{building2}}}
\label{fig:1b}
\end{subfigure}
\caption{\textit{\small{Buildings}}}
\label{fig:1}
\end{figure}
For the first subfigure
, everything is OK. But for the second I am getting the build error: Undefined control sequence. ...t pt,keepaspectratio]{building2}
. It seems the problem lies with using the height
attribute in the second subfigure
, as when I removed the height
attribute from the second subfigure
, there was no build error.
What is the reason of this? Is there a way to keep using both height
and width
attributes in includegraphics
?
P.S.: I am using \usepackage{subcaption}
.
\lineheight
is not defined by default. Perhaps you want\baselineskip
instead. – Andrew Swann Jul 16 '15 at 9:48height=100\baselineskip
should instead be something likeheight=0.85\textheight
to allow space for the caption. – egreg Jul 16 '15 at 10:24\lineheight pt
<- maybe thept
is a problem? – Thomas Weise Jul 16 '15 at 10:28