Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add German support #38

Merged
merged 15 commits into from
Mar 23, 2023
105 changes: 105 additions & 0 deletions sjtutex/doc/sample-thesis-de.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
% !TeX encoding = UTF-8

% 载入 SJTUThesis 模版
\documentclass[type=master,lang=de]{sjtuthesis}

\input{common-package}
% \usepackage[ngerman]{babel}
\usepackage{ngerman}
Comment on lines +7 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用 babel 会使得参考文献中的 and vol. p. 被翻译为德文,使用 ngerman 不会。参考:https://tex.stackexchange.com/questions/72893/whats-the-difference-between-usepackagengerman-and-usepackagengermanbabe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当然主流应当使用 babel。

\usepackage[pangram]{blindtext}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用 ngerman 主要使该宏包识别语言,如果不用假文,可以去除 ngerman

\input{common-setup-thesis}
% 使用 MLA 引用格式
\usepackage[backend=biber,style=mla-new]{biblatex}
% 变更为自订的引用样式 (Kafka: 67)
\DeclareDelimFormat{postnotedelim}{\addcolon\space}
\renewbibmacro*{postnote}{%
\iffieldundef{postnote}%
{}
{\setunit{\printdelim{postnotedelim}}%%
\ifbool{cbx@hyperpages}%
{\printtext[bibhyperref]{\printfield[ibidpostnote]{postnote}}}%
{\printfield[ibidpostnote]{postnote}}}}%
Comment on lines +13 to +21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

由于提供的文中引用的格式并不是标准的 MLA 格式,参考 https://tex.stackexchange.com/questions/478282/how-to-change-selectively-the-post-note-comma-in-a-citation-using-biblatex/478292#478292 进行修改。

% 调整引用标题,不使用 Works Cited
\AtBeginDocument{
\renewcommand{\bibname}{Literaturverzeichnis}
}
Comment on lines +22 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

biblatex-mla 对于 \bibname 的处理比较奇怪,需要延迟至 \AtBeginDocument 之后进行。参考 https://tex.stackexchange.com/questions/306107/suppressing-large-text-works-cited-in-biblatex-mla-printbibliography

% 添加引用数据库
\addbibresource{ref.bib}
% 德语模板补充字段
\sjtusetup{
info = {
de / title = {Vorlage für Abschlussarbeiten der Shanghai Jiao Tong Universität},
de / display-title = {Vorlage für Abschlussarbeiten der \\ Shanghai Jiao Tong Universität},
de / keywords = {Dissertation, Dissertation-Format, Standardisierung, Vorlage},
de / degree = {Master of Engineering},
de / author = {Jemand},
de / supervisor = {Professor Jemand},
de / major = {Ein bestimmtes Fachgebiet},
de / department = {Gewisse Abteilung},
% de / fund = {
% {National 973 Project (No. 2025CB000000)},
% {Nationale Stiftung für Naturwissenschaften Chinas (No. 81120250000)},
% },
}
}

\begin{document}

% 标题页
\maketitle

% 原创性声明及使用授权书
\copyrightpage

% 前置部分
\frontmatter

\begin{abstract}[zh]
\input{common-abstract-zh.tex}
\end{abstract}

\begin{abstract}[en]
\input{common-abstract-en.tex}
\end{abstract}

\begin{abstract}[de]
\input{common-abstract-de.tex}
\end{abstract}

% 目录
\tableofcontents
% 插图索引
\listoffigures*
% 表格索引
\listoftables*
% 算法索引
% \listofalgorithms*

% 主体部分
\mainmatter

\input{common-mainmatter-de}

% 参考文献
\printbibliography[heading=bibintoc]

% 附录
\appendix

% 附录中图表不加入索引
\captionsetup{list=no}

\input{common-nomenclature-de}

% 结尾部分
\backmatter

% 用于盲审的论文需隐去致谢、发表论文、科研成果、简历

\input{common-achievements-de}

\input{common-acknowledgements-de}

\input{common-digest}

\end{document}
Loading