Skip to content

Commit

Permalink
Add support for chapterbib
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Feb 18, 2020
1 parent f7db2ac commit 1c0f92a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Added

- 添加对 `chapterbib` 宏包的支持

### Fixed

- 修正 LaTeX3 的 `\str_if_eq_x` 已过时的报错 - [#241](https://github.com/ustctug/ustcthesis/issues/241)
Expand Down
7 changes: 7 additions & 0 deletions ustcthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1487,3 +1487,10 @@
}
\fi
}
\ustc@atendpackage{chapterbib}{
\renewcommand\bibsection{%
\ctexset{section/numbering=false}%
\section{\bibname}%
\ctexset{section/numbering=true}%
}
}
20 changes: 20 additions & 0 deletions ustcthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,14 @@
% \end{tabular}
% \end{table}
%
% 如果需要每章生成独立的参考文献表,可以使用 \pkg{chapterbib} 宏包,
% 但是需要注意:
% \begin{enumerate}
% \item 在 \file{main.tex} 中调用每章的子文件时必须使用 \cs{include} 命令;
% \item 每章需要使用 \cs{bibliographystyle} 和 \cs{bibliography} 命令;
% \item 如果手动调用 BibTeX,需要对每章生成的 \file{.aux} 文件编译,
% (如果使用 \pkg{latexmk} 则可以自动处理)。
% \end{enumerate}
%
% \StopEventually
% \clearpage
Expand Down Expand Up @@ -3086,5 +3094,17 @@
}
% \end{macrocode}
%
% \subsubsection{\pkg{chapterbib} 宏包}
%
% \begin{macrocode}
\ustc@atendpackage{chapterbib}{
\renewcommand\bibsection{%
\ctexset{section/numbering=false}%
\section{\bibname}%
\ctexset{section/numbering=true}%
}
}
% \end{macrocode}
%
% \Finale
\endinput

0 comments on commit 1c0f92a

Please sign in to comment.