Skip to content

Commit

Permalink
增加算法适配;Close #100
Browse files Browse the repository at this point in the history
  • Loading branch information
sikouhjw committed Sep 26, 2023
1 parent fbdcdae commit 6665fd6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
24 changes: 24 additions & 0 deletions example/algorithm.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
\documentclass{../gdutthesis}

\usepackage[algochapter]{algorithm2e}
\renewcommand{\algorithmcfname}{算法}

\usepackage{glossaries}
\renewcommand{\loadglsentries}[1]{}
\gdutsetup{
style/cover = {false},
}

\begin{document}

\mainmatter

\chapter{测试}{test}

\autoref{alg:test}

\begin{algorithm}
\caption{test}\label{alg:test}
\end{algorithm}

\end{document}
22 changes: 13 additions & 9 deletions gdutthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1123,16 +1123,20 @@
\cs_set:Npn\thefigure{\thechapter-\arabic{figure}}
%% 设置引用格式
\labelformat{ equation } { (#1) }
\clist_map_inline:nn
{
{ subfigure , 图 },
{ figure , 图 },
{ table , 表 },
{ equation , 公式 },
{ appendix , 附录 },
}
\ctex_after_end_preamble:n
{
\cs_new:cpn { \clist_item:nn {#1} {1} autorefname } { \clist_item:nn {#1} {2} }
\clist_map_inline:nn
{
{ subfigure , 图 },
{ figure , 图 },
{ table , 表 },
{ equation , 公式 },
{ appendix , 附录 },
{ algorithm , 算法 },
}
{
\cs_set:cpn { \clist_item:nn {#1} {1} autorefname } { \clist_item:nn {#1} {2} }
}
}
%% 设置浮动体间距
\setlength{\floatsep}{2\baselineskip-2\ccwd-1pt}
Expand Down
4 changes: 3 additions & 1 deletion user-manual/gdutthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2404,12 +2404,14 @@ Copyright (C) 2017&ndash;2021 by Xiangdong Zeng <[email protected]>.
% \caption{\texttt{\textbackslash autoref} 命令预设置}\label{tab:autoref}
% \begin{tabular}{cccccccc}
% \toprule
% \textbf{环境} & \textbf{预设置格式} \\
% \textbf{类型} & \textbf{预设置格式} \\
% \midrule
% \env{figure} & 图1-1 \\
% \env{\textbackslash subfloat} & 图1-1(a) \\
% \env{table} & 表1-1 \\
% \env{equation} & 公式(1.1) \\
% \env{\textbackslash appendix} & 附录A \\
% \env{algorithm} & 算法1 \\
% \bottomrule
% \end{tabular}
% \end{table}
Expand Down

0 comments on commit 6665fd6

Please sign in to comment.