tuna / thuthesis

LaTeX Thesis Template for Tsinghua University
https://www.ctan.org/pkg/thuthesis
LaTeX Project Public License v1.3c
4.52k stars 1.07k forks source link

附录参考文献永远显示??? #903

Closed Mirviy closed 10 months ago

Mirviy commented 11 months ago

编译环境

编译的系统:Windows 10 TeX 发行版:This is XeTeX, Version 3.141592653-2.6-0.999995 (MiKTeX 23.9) 模板版本:v7.4.0 模板类型:doctor / master / bachelor

描述问题

附录参考文献永远显示???

截图:

屏幕截图 2023-09-22 211352

复现上述问题的代码:


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

\printbibliography
note286 commented 11 months ago

无法复现

\documentclass{thuthesis}
\usepackage[style=thuthesis-author-year]{biblatex}
\addbibresource{ref.bib}
\begin{document}
\appendix
\chapter{title}
附录中的参考文献示例(\cite{carlson1981two} 和 \cite{carlson1981two,taylor1983scanning,taylor1981study})。
\printbibliography
\end{document}

image

Mirviy commented 11 months ago

你不需要写任何新的tex文档…… 我直接下载模板编译,就能复现这个问题。

另外你给的代码在我的环境下直接编译会粗体打印出reference的key值,显然我们的环境不一样。

note286 commented 11 months ago

你所指的模板具体是?

Mirviy commented 11 months ago

你所指的模板具体是?

https://github.com/tuna/thuthesis/archive/refs/heads/master.zip

Harry-Chen commented 11 months ago

通常是因为你的编译方式不正确,缺少了某些步骤,请仔细阅读文档,按照说明编译。

Mirviy commented 11 months ago

thuthesis_see_appendix.zip

啊……

note286 commented 11 months ago

注意appendix.tex文件中存在\printbibliography,因此需要使用biblatex编译。请修改thusetup.tex中关于参考文献的设置。

% \usepackage[sort]{natbib}
% \bibliographystyle{thuthesis-numeric}

\usepackage[style=thuthesis-numeric]{biblatex}
\addbibresource{ref/refs.bib}

以及thuthesis-example.tex

% 参考文献
% \bibliography{ref/refs}  % 参考文献使用 BibTeX 编译
\printbibliography       % 参考文献使用 BibLaTeX 编译

image

Harry-Chen commented 11 months ago

注意appendix.tex文件中存在\printbibliography,因此需要使用biblatex编译。请修改thusetup.tex中关于参考文献的设置。

其实不需要,我们统一了一些配置,是可以用 bibtex 工作的。

note286 commented 11 months ago

你不需要写任何新的tex文档…… 我直接下载模板编译,就能复现这个问题。

另外你给的代码在我的环境下直接编译会粗体打印出reference的key值,显然我们的环境不一样。

你提问的时候并没有给出完整的代码,仅给出了部分,也没有说直接编译模板。

note286 commented 11 months ago

注意appendix.tex文件中存在\printbibliography,因此需要使用biblatex编译。请修改thusetup.tex中关于参考文献的设置。

其实不需要,我们统一了一些配置,是可以用 bibtex 工作的。

是重定义了\printbibliography吗?

抱歉,我没有仔细阅读过相关说明。

note286 commented 11 months ago

使用如下命令编译

https://github.com/tuna/thuthesis/archive/refs/heads/master.zip
xelatex thuthesis-example
bibtex thuthesis-example
xelatex thuthesis-example
xelatex thuthesis-example

image

附录的参考文献确实有问题,部分日志如下:

) [9] (./thuthesis-example.bbl [10]) (./data/appendix.tex (./bu.aux) [11]
附录 A
[12] (./thuthesis-example-appendix-a.aux)

Package natbib Warning: Citation `dupont1974bone' on page 13 undefined on input line 57.

Package natbib Warning: Citation `zhengkaiqing1987' on page 13 undefined on input line 57.

Package natbib Warning: Citation `dupont1974bone' on page 13 undefined on input line 58.

Package natbib Warning: Citation `zhengkaiqing1987' on page 13 undefined on input line 58.

No file thuthesis-example-appendix-a.bbl.
) (./data/acknowledgements.tex (./bu.aux) [13]) (./bu.aux) [14] (./data/resume.tex (./bu.aux)
[15]) (./data/comments.tex (./bu.aux) [16] [17]) (./data/resolution.tex (./bu.aux) [18])

Package natbib Warning: There were undefined citations.

(./bu.aux) (./thuthesis-example.aux (./bu.aux)) )
(see the transcript file for additional information)
Output written on thuthesis-example.pdf (34 pages).
Transcript written on thuthesis-example.log.

不确定是不是我编译的问题。

Mirviy commented 11 months ago

注意appendix.tex文件中存在\printbibliography,因此需要使用biblatex编译。请修改thusetup.tex中关于参考文献的设置。

谢谢!

我用这个方法,编译三次之后参考文献正常了 : ) (第一次是粗体key,第二次序号从0开始,第三次正常。)

不太清楚里面有什么魔法,不过我的问题解决了。

zepinglee commented 11 months ago

学会阅读文档:

Screenshot 2023-09-22 at 23 37 29

BibTeX 方法需要对附录的 .aux 单独处理。biblatex 不需要这一过程。

但是更推荐使用 latexmk 自动处理编译过程。

note286 commented 11 months ago

非常感谢,是我的疏忽。