Skip to content

Commit

Permalink
Merge pull request #341 from BITNP/fix-listings-caption-numbering
Browse files Browse the repository at this point in the history
fix: fix non-effective listings numbering.
  • Loading branch information
fky2015 authored May 17, 2023
2 parents 566355c + 4c2757f commit dc5d722
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
8 changes: 5 additions & 3 deletions bithesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -3388,9 +3388,11 @@
\cs_set:Npn \theequation {\thechapter\g_@@_label_divide_char_tl\arabic{equation}}

% code snippet
\cs_set:Npn \thelstlisting {\thechapter\g_@@_label_divide_char_tl\arabic{lstlisting}}
\cs_set:Npn \lstlistingname {\c_@@_label_code_tl}
\captionsetup[listing]{font=small,labelsep=space}
\AtBeginDocument{
\cs_gset:Npn \thelstlisting {\thechapter\g_@@_label_divide_char_tl\arabic{lstlisting}}
\cs_gset:Npn \lstlistingname {\c_@@_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
% \end{macrocode}
% \end{macro}
%
Expand Down
8 changes: 5 additions & 3 deletions templates/graduate-thesis/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,11 @@

\cs_set:Npn \theequation {\thechapter\g__bithesis_label_divide_char_tl\arabic{equation}}

\cs_set:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
\cs_set:Npn \lstlistingname {\c__bithesis_label_code_tl}
\captionsetup[listing]{font=small,labelsep=space}
\AtBeginDocument{
\cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
\cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
Expand Down
8 changes: 5 additions & 3 deletions templates/paper-translation/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,11 @@

\cs_set:Npn \theequation {\thechapter\g__bithesis_label_divide_char_tl\arabic{equation}}

\cs_set:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
\cs_set:Npn \lstlistingname {\c__bithesis_label_code_tl}
\captionsetup[listing]{font=small,labelsep=space}
\AtBeginDocument{
\cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
\cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
Expand Down
8 changes: 5 additions & 3 deletions templates/undergraduate-thesis-en/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,11 @@

\cs_set:Npn \theequation {\thechapter\g__bithesis_label_divide_char_tl\arabic{equation}}

\cs_set:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
\cs_set:Npn \lstlistingname {\c__bithesis_label_code_tl}
\captionsetup[listing]{font=small,labelsep=space}
\AtBeginDocument{
\cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
\cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
Expand Down
8 changes: 5 additions & 3 deletions templates/undergraduate-thesis/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,11 @@

\cs_set:Npn \theequation {\thechapter\g__bithesis_label_divide_char_tl\arabic{equation}}

\cs_set:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
\cs_set:Npn \lstlistingname {\c__bithesis_label_code_tl}
\captionsetup[listing]{font=small,labelsep=space}
\AtBeginDocument{
\cs_gset:Npn \thelstlisting {\thechapter\g__bithesis_label_divide_char_tl\arabic{lstlisting}}
\cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
Expand Down

0 comments on commit dc5d722

Please sign in to comment.