Skip to content

Commit

Permalink
sjtuthesis: Fix compilation errors with '\captionsetup'
Browse files Browse the repository at this point in the history
With newer 'caption' package, the '\captionsetup[xxx]' must be placed
*after* the corresponding '\DeclareCaptionOption{xxx}'.

Credit: mohuangrui/ucasthesis#223 (comment)
  • Loading branch information
liweitianux committed Mar 13, 2021
1 parent dc9592b commit c74fe5d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sjtuthesis/sjtuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%%==================================================

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{sjtuthesis}[2019/09/03 v0.19 SJTU Thesis Template]
\ProvidesClass{sjtuthesis}[2021/03/13 v0.20 SJTU Thesis Template]

\newif\ifsjtu@english\sjtu@englishfalse
\newif\ifsjtu@bachelor\sjtu@bachelorfalse
Expand Down Expand Up @@ -250,9 +250,6 @@
textfont={small,sf},
labelfont={small,bf},
}
\captionsetup[sub]{font=footnotesize}
\captionsetup[bi-first]{bi-first}
\captionsetup[bi-second]{bi-second}
\DeclareCaptionOption{bi-first}[]{
\def\tablename{\sjtu@tablename}
\def\figurename{\sjtu@figurename}
Expand All @@ -261,6 +258,11 @@
\def\tablename{Table}
\def\figurename{Figure}
}
% \captionsetup[xxx] must be placed *after* \DeclareCaptionOption{xxx}
% Credit: https://github.com/mohuangrui/ucasthesis/issues/223#issuecomment-731495483
\captionsetup[bi-first]{bi-first}
\captionsetup[bi-second]{bi-second}
\captionsetup[sub]{font=footnotesize}

\renewcommand{\lstlistingname}{\sjtu@listingname}

Expand Down

0 comments on commit c74fe5d

Please sign in to comment.