So I solved the issue and wanted to document it in case anyone else has the same problem.
The key revelation came from this forum posting with a similar issue: http://www.latex-community.org/forum/viewtopic.php?f=45&t=4766&start=10
The issue stems from my dissertation.sty sheet, xcolor and xfloat. The .sty sheet defines a custom line spacing in float and footnotes, single, as opposed to the baseline of 2 using xfloat. It did so in a particularly bad way, it redefined xfloat globally as best as I can tell.
The solution was to preserve the kernel xfloat, and create a new xfloat called myxfloat for use in figures. This allows the spacing commands to work as intended while preserving compatibility with xcolor. Here is the original xfloat definition,
\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
\@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
\@parmoderr\@floatpenalty\z@
\else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
\multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
\@tfor \@tempa :=#2\do
{\if\@tempa h\advance\@tempcnta \@ne\fi
\if\@tempa t\advance\@tempcnta \tw@\fi
\if\@tempa b\advance\@tempcnta 4\relax\fi
\if\@tempa p\advance\@tempcnta 8\relax\fi
}\global\count\@currbox\@tempcnta}\@fltovf\fi
\global\setbox\@currbox\vbox\bgroup
\def\baselinestretch{1}
\ifx\undefined\selectfont
\small\normalsize
\else
\@newbaseline
\fi
\boxmaxdepth\z@
\hsize\columnwidth \@parboxrestore}
\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
\interlinepenalty\interfootnotelinepenalty
\splittopskip\footnotesep
\splitmaxdepth \dp\strutbox \floatingpenalty \@MM
\hsize\columnwidth \@parboxrestore
\edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
{\rule{\z@}{\footnotesep}\ignorespaces
#1\strut}}}
And here is the new definition:
% Save LaTeX kernel version of \@xfloat
\makeatletter
\let\my@xfloat\@xfloat
\makeatother
% Create a modified copy of \@xfloat using the kernel definition
\makeatletter
\def\@xfloat#1[#2]{
\my@xfloat#1[#2]%
\def\baselinestretch{1}%
% I COMMENTED THIS PART BELOW.
% \@normalsize \normalsize
%}
%\makeatother
%
%%%
%%% Reset baselinestretch within footnotes and floats. Originally stolen
%%% from Stanford thesis style.
%%%
%\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
% \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
% \@parmoderr\@floatpenalty\z@
% \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
% \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
% \@tfor \@tempa :=#2\do
% {\if\@tempa h\advance\@tempcnta \@ne\fi
% \if\@tempa t\advance\@tempcnta \tw@\fi
% \if\@tempa b\advance\@tempcnta 4\relax\fi
% \if\@tempa p\advance\@tempcnta 8\relax\fi
% }\global\count\@currbox\@tempcnta}\@fltovf\fi
% \global\setbox\@currbox\vbox\bgroup
% \def\baselinestretch{1}
% OLD SPACING TWEAK CONTINUES BELOW
\ifx\undefined\selectfont
\small\normalsize
\else
\@newbaseline
\fi
\boxmaxdepth\z@
\hsize\columnwidth \@parboxrestore}
\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
\interlinepenalty\interfootnotelinepenalty
\splittopskip\footnotesep
\splitmaxdepth \dp\strutbox \floatingpenalty \@MM
\hsize\columnwidth \@parboxrestore
\edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
{\rule{\z@}{\footnotesep}\ignorespaces
#1\strut}}}
Hope this helps someone else out there, I know it sure had me puzzled for a few days. And god bless all the programming my physics undergrad had me do, I can't even understand TeX but I sure can mend together some random samples off the interwebs!
listingspackage. It has m-code highlighting support. – Martin Scharrer Sep 13 '11 at 00:51mcodepackage loads onlylistingsand conditionallyxcolorandtextcomp. Consequently, it defineslistingssettings that are used to duplicate the traditional Matlab environment and even requires the user to use thelstlistingsenvironment. If it is not possible to duplicate the problem, then switch tolistingsoutright, and transfer the settings. Alternatively, at least provide your entire first figure causing this problem. – Werner Sep 13 '11 at 01:42Its not any specific figure thats causing the problem, any figure with a caption will cause the glitch. As far as I can tell its a problem with the caption spacing, the snippet above is a tweak to reset baselinestrech inside footnotes and figure captions to 1. I still can not create a MWE, but will upload the whole dissertation.sty and small exmaple.tex to illustrate.
– bcoss Sep 13 '11 at 18:58:sS/he seemed to have already solved the problem, anyway. I think it's fair to close the question... – jub0bs Feb 06 '14 at 03:28