Moved caption package to document (what was it doing here in the

first place?).

+ simply removed the \@makecaption low-level definitions as they
  were interfering with our ability to use \captionsetup{...}
  inside the mdframed environment (the low-level definitions
  always ended up overriding any local captionsetup).
  I don't see much point to these low-level definitions, they
  can be fairly well replicated with captionsetup anyway.
main
Taha Ahmed 1 year ago
parent bc9cbb76ef
commit ef2daad757

@ -161,9 +161,6 @@
\DeclareOption{openright}{ \@UU@openrighttrue } \DeclareOption{openright}{ \@UU@openrighttrue }
\PassOptionsToPackage{figuresright}{rotating} \PassOptionsToPackage{figuresright}{rotating}
% added compatibility=false to make it work together with subcaption
% https://tex.stackexchange.com/questions/31906/subcaption-package-compatibility-issue#31927
\PassOptionsToPackage{font=small,labelfont=bf,nooneline,textfont=it,compatibility=false}{caption}
\ProcessOptions \ProcessOptions
@ -614,48 +611,6 @@
\setlength{\abovecaptionskip}{3pt plus 2pt} \setlength{\abovecaptionskip}{3pt plus 2pt}
\setlength{\belowcaptionskip}{0pt plus 42pt} \setlength{\belowcaptionskip}{0pt plus 42pt}
\AtBeginDocument{
\def\@caption#1[#2]#3{%
\par %
\addcontentsline {\csname ext@#1\endcsname }{#1}{\protect \numberline {\csname the#1\endcsname }{\ignorespaces #2}}%
\begingroup %
\@parboxrestore %
\if@minipage %
\@setminipage %
\fi %
\normalsize %
\@makecaption{\csname fnum@#1\endcsname }{\ignorespaces #3}%
\par %
\endgroup
}
\def\@makecaption@table#1#2{%
\addvspace{\belowcaptionskip}%
%\sbox\@tempboxa{{\bf #1.} #2}%
\small{\bf #1.} {\it #2}\par%
\addvspace{\abovecaptionskip}%
}
\def\@makecaption@default#1#2{%
\addvspace{\abovecaptionskip}%
\sbox\@tempboxa{{\it #1.} #2}%
\ifdim \wd\@tempboxa>\hsize%
\small{\it #1.} #2\par%
\else %
\global \@minipagefalse \hb@xt@ \hsize {\hfil \box \@tempboxa \hfil }%
\fi %
\addvspace{\belowcaptionskip}%
}
\renewcommand{\@makecaption}[2]{%
\expandafter\let\expandafter\hej\csname @makecaption@\@captype\endcsname%
\expandafter\ifx\hej\relax%
\let\hej\@makecaption@default%
\fi%
\hej{#1}{#2}%
}
}
% ============================================ % ============================================
% Package fixes % Package fixes
@ -751,6 +706,7 @@
}{\providecommand{\phantomsection}{}} }{\providecommand{\phantomsection}{}}
} }
% ============================================ % ============================================
% Table of contents % Table of contents
% ============================================ % ============================================

Loading…
Cancel
Save