Skip to content

Commit

Permalink
Add \printbibliography in appendices (#875)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed May 14, 2023
1 parent 1ba52a5 commit 1ab3762
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
3 changes: 1 addition & 2 deletions data/appendix.tex
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ \section{参考文献}

附录中的参考文献示例(\cite{carlson1981two} 和 \cite{carlson1981two,taylor1983scanning,taylor1981study})。

\bibliographystyle{thuthesis-numeric}
\bibliography{ref/refs}
\printbibliography
37 changes: 29 additions & 8 deletions thuthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -5790,20 +5790,40 @@
%
% 设置 \option{cite-style} 的接口,只对 \BibTeX{} 的编译方式有效。
% \begin{macrocode}
\thu@define@key{
cite-style = {
name = cite@style,
choices = {
super,
inline,
author-year,
}
\thu@define@key{
cite-style = {
name = cite@style,
choices = {
super,
inline,
author-year,
}
}
}
% \end{macrocode}
%
% \subsubsection{BibTeX + \pkg{natbib} 宏包}
%
% \begin{macrocode}
\def\bibliographystyle#1{%
\gdef\bu@bibstyle{#1}%
\ifx\@begindocumenthook\@undefined\else
\expandafter\AtBeginDocument
\fi
{\if@filesw
\immediate\write\@auxout{\string\bibstyle{#1}}%
\immediate\write\@auxout{\string\gdef\string\bu@bibstyle{#1}}%
\fi}%
}
\def\bibliography#1{%
\if@filesw
\immediate\write\@auxout{\string\bibdata{\zap@space#1 \@empty}}%
\immediate\write\@auxout{\string\gdef\string\bu@bibdata{#1}}%
\fi
\gdef\bu@bibdata{#1}%
\@input@{\jobname.bbl}}
% \end{macrocode}
%
% \BibTeX{} 和 \pkg{natbib} 宏包的配置。
% \begin{macrocode}
\PassOptionsToPackage{compress}{natbib}
Expand Down Expand Up @@ -6335,6 +6355,7 @@
\renewcommand\thu@end@appendix@ref@section{%
\bibliographyunit\relax
}
\providecommand\printbibliography{\putbib\relax}%
\AtEndDocument{\thu@end@appendix@ref@section}
% \end{macrocode}
%
Expand Down

0 comments on commit 1ab3762

Please sign in to comment.