My university requires that all figures in a thesis follow this pattern:
I'm very new to LaTeX, so far my best attempt has been this:
\begin{SCfigure}
\colorbox{darkgray}{
\begin{minipage}{14cm}
\centering
\includegraphics{inductor.jpg}
\end{minipage}
}
\caption{caption caption}
\end{SCfigure}
and the result is here:
My figure is not centered and the caption is off the page.
Trying to create another minipage around caption does not work because the colored box somehow appears in between the figure and caption.
Any help will be highly appreciated. Thank you!
Best Answer
All problems are not resolved. You need to create a macro to automate all the little jobs and I have not used Arial and 8pt. It will be fine to cretae a macro with argument the caption and the picture. I placed a
minipage
inside aminipage
to get margins around the caption. I think there is perhaps a better way to this. I used a box to get the height of the picture, I don't know if it's possible to avoid this.update 4: I added a macro like Herbert and I adapted the code to odd and even pages but you need to make some calculations to replace
\hspace*{-6em}
and\hspace*{-4em}
by something like\hspace*{\dimexpr -\marginparwidth-\marginparsep\relax}
(Herbert's code). I don't know exactly what are the macros for atwoside
document to calculate the left and right margin. I corrected 2 bugs. I added some extra space around the picture