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

update-20200704-增加 biber 和 resumebib 选项可以选择使用biblatex或者bibtex生成参考文献,以及使用biblatex生成简历中的论文和成果 #27

Merged
merged 1 commit into from
Jul 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions data/resume.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@
\ifreview
该论文作者在学期间取得的阶段性成果(学术论文等)已满足我校博士学位评阅相关要求。为避免阶段性成果信息对专家评价学位论文本身造成干扰,特将论文作者的阶段性成果信息隐去。
\else

\ifisresumebib

\begin{refsection}[ref/resume.bib]
\settoggle{bbx:gbtype}{false}%局部设置不输出文献类型和载体标识符
\settoggle{bbx:gbannote}{true}%局部设置输出注释信息
\setcounter{gbnamefmtcase}{1}%局部设置作者的格式为familyahead格式
\nocite{ref-1-1-Yang,ref-2-1-杨轶,ref-3-1-杨轶,ref-4-1-Yang,ref-5-1-Wu,ref-6-1-贾泽,ref-7-1-伍晓明}

\setlength{\biblabelsep}{12pt}
\printbibliography[env=resumebib,heading=subbibliography,title={发表的学术论文}] % 发表的和录用的合在一起

\end{refsection}


\begin{refsection}[ref/resume.bib]
\settoggle{bbx:gbtype}{false}%局部设置不输出文献类型和载体标识符
\settoggle{bbx:gbannote}{true}%局部设置输出注释信息
\setcounter{gbnamefmtcase}{1}%局部设置作者的格式为familyahead格式
\nocite{ref-8-1-任天令,ref-9-1-Ren}

\setlength{\biblabelsep}{12pt}
\printbibliography[env=resumebib,heading=subbibliography,title={研究成果}]

\end{refsection}

\else

\section*{发表的学术论文} % 发表的和录用的合在一起

\begin{enumerate}[label={[\arabic*]}]
Expand Down Expand Up @@ -33,4 +61,5 @@
based on ferroelectric materials: USA, No.11/215, 102. (美国发明专利申请号.)
\end{enumerate}
\fi
\fi
\end{resume}
5 changes: 5 additions & 0 deletions makeclear.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off
del /q *.aux *.bbl *.blg *.log *.out *.toc *.bcf *.xml *.synctex *.nlo *.nls *.bak *.ind *.idx *.ilg *.lof *.lot *.ent-x *.tmp *.ltx *.los *.lol *.loc *.listing *.gz *.userbak *.nav *.snm *.vrb *.thm


del /q *.nav *.snm *.vrb *.fls *.xdv *.fdb_latexmk
6 changes: 6 additions & 0 deletions makepdfbib.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
del *.aux *.lo? *.toc *.ind *.inx *.gls *.glo *.idx *.ilg *.out *.bak *.bbl *.brf *.blg *.dvi data\*.aux
xelatex thesis
rem makeindex -s nomencl.ist -o thesis.nls thesis.nlo
biber thesis
xelatex thesis
xelatex thesis
69 changes: 59 additions & 10 deletions nudtpaper.cls
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
%% The original source files were:
%%
%% nudtpaper.dtx (with options: `cls')
%%
%%
%% This is a generated file.
%%
%%
%% Copyright (C) 2018 by Liu Benyuan <liubenyuan@gmail.com>
%%
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3a
%% of this license or (at your option) any later version.
%% The latest version of this license is in:
%%
%%
%% http://www.latex-project.org/lppl.txt
%%
%%
%% and version 1.3a or later is part of all distributions of LaTeX
%% version 2004/10/01 or later.
%%
%%
%% To produce the documentation run the original source files ending with `.dtx'
%% through LaTeX.
%%
%%
%% Any Suggestions : LiuBenYuan <liubenyuan@gmail.com>
%% Thanks Xue Ruini <xueruini@gmail.com> for the thuthesis class!
%% Thanks sofoot for the original NUDT paper class!
%%
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{nudtpaper}
[2017/06/15 v2.7 NUDT paper template]
Expand All @@ -46,6 +46,17 @@
\DeclareOption{otf}{\isotftrue}
\DeclareOption{fz}{\isfztrue}
\DeclareOption{fandol}{\isfandoltrue}

%%add biber option
%% if biber is set, use biblatex to generate bibliography
\newif\ifisbiber\isbiberfalse
\DeclareOption{biber}{\isbibertrue}

%%add resumebib option
%% if resumebib is set, use biblatex to generate resume
\newif\ifisresumebib\isresumebibfalse
\DeclareOption{resumebib}{\isresumebibtrue}

\ProcessOptions\relax
\RequirePackage{ifthen,calc}
\ifistwoside
Expand Down Expand Up @@ -77,7 +88,45 @@
\RequirePackage[CJKchecksingle,no-math]{xeCJK}
\RequirePackage{zhnumber}
\RequirePackage{indentfirst}

%code for dealing option: biber
\ifisbiber
\RequirePackage[backend=biber,style=gb7714-2015,gbalign=gb7714-2015]{biblatex}%
\addbibresource[location=local]{ref/refs.bib}
\setlength{\biblabelsep}{2mm}
\newlength{\refindent}
\setlength{\refindent}{24pt}
\renewcommand{\itemcmd}{%
\setlength{\lengthid}{0cm}%
\setlength{\lengthlw}{\textwidth}%
\addtolength{\lengthlw}{-\lengthid}%
\addvspace{\bibitemsep}%恢复\bibitemsep的作用 %\parshape 2 0em \textwidth \lengthid \lengthlw
\hangindent\lengthid%
\hspace{\refindent}\mkgbnumlabel{\printfield{labelnumber}}%
\hspace{\biblabelsep}}
\ifisresumebib
\defbibenvironment{resumebib}%修改对齐环境-调整缩进
{\list
{\printtext[labelnumberwidth]{%
\printfield{labelprefix}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\leftmargin}{\bibhang}%
\addtolength{\leftmargin}{\labelnumberwidth}%
\setlength{\itemindent}{\bibitemindent}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\fi
\else
\RequirePackage[numbers,sort&compress,square]{natbib}
\newcommand{\upcite}[1]{\textsuperscript{\cite{#1}}} % 上标形式引用
\fi


\RequirePackage[colorlinks=true,linkcolor=blue,citecolor=red,pdfborder=0 1 1]{hyperref}
\RequirePackage{datetime}
\defaultfontfeatures{Mapping=tex-text}
Expand Down Expand Up @@ -198,7 +247,7 @@
\thu@define@fontsize{xiaoliu}{6.5bp}
\thu@define@fontsize{qihao}{5.5bp}
\thu@define@fontsize{bahao}{5bp}
\newcommand{\upcite}[1]{\textsuperscript{\cite{#1}}} % 上标形式引用

\newcommand{\china}{中华人民共和国}
\def\nudtpaper{\textsc{Nudt}\textsc{Paper}}
\newcommand{\pozhehao}{\kern0.2em\rule[0.8ex]{1.6em}{0.1ex}\kern0.2em}
Expand Down Expand Up @@ -582,7 +631,7 @@ Defense Technology}\fi}\\
~\@endate~
}
\end{center}\vfill

\renewcommand{\baselinestretch}{1.5}%

\ifisanon{~}\else{
Expand Down
61 changes: 59 additions & 2 deletions nudtpaper.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,18 @@
%<thesis>%4. 如果想生成盲评,传递anon即可,仍需修改个人成果部分
%<thesis>% \documentclass[master,otf,anon]{nudtpaper}
%<thesis>%
%<thesis>%5. 参考文献若用biblatex生成,则使用biber选项
%<thesis>% \documentclass[master,biber]{nudtpaper}
%<thesis>%
%<thesis>%6. 简历中的论文和成果用biblatex参考文献方式生成,则使用resumebib选项
%<thesis>% \documentclass[master,biber,resumebib]{nudtpaper}
%<thesis>%


% \end{macrocode}
% \begin{macrocode}
%<*thesis>
\documentclass[master,otf]{nudtpaper}
\documentclass[doctor,twoside,biber,resumebib]{nudtpaper}
\usepackage{mynudt}

%</thesis>
Expand Down Expand Up @@ -463,8 +471,12 @@
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{参考文献}
\ifisbiber
\printbibliography[heading=bibliography, title=参考文献]
\else
\bibliographystyle{bstutf8}
\bibliography{ref/refs}
\fi

\input{data/resume}
%</thesis>
Expand Down Expand Up @@ -532,6 +544,17 @@
\DeclareOption{otf}{\isotftrue}
\DeclareOption{fz}{\isfztrue}
\DeclareOption{fandol}{\isfandoltrue}

%%add biber option
%% if biber is set, use biblatex to generate bibliography
\newif\ifisbiber\isbiberfalse
\DeclareOption{biber}{\isbibertrue}

%%add resumebib option
%% if resumebib is set, use biblatex to generate resume
\newif\ifisresumebib\isresumebibfalse
\DeclareOption{resumebib}{\isresumebibtrue}

\ProcessOptions\relax
% \end{macrocode}
%
Expand Down Expand Up @@ -660,7 +683,42 @@
% \changes{v2.3}{2013/12/27}{加入色彩版hyperref}
% \changes{v2.5}{2015/05/11}{提示用户在最终打印版时去掉链接颜色}
% \begin{macrocode}
%code for dealing option: biber
\ifisbiber
\RequirePackage[backend=biber,style=gb7714-2015,gbalign=gb7714-2015]{biblatex}%
\addbibresource[location=local]{ref/refs.bib}
\setlength{\biblabelsep}{2mm}
\newlength{\refindent}
\setlength{\refindent}{24pt}
\renewcommand{\itemcmd}{%
\setlength{\lengthid}{0cm}%
\setlength{\lengthlw}{\textwidth}%
\addtolength{\lengthlw}{-\lengthid}%
\addvspace{\bibitemsep}%恢复\bibitemsep的作用 %\parshape 2 0em \textwidth \lengthid \lengthlw
\hangindent\lengthid%
\hspace{\refindent}\mkgbnumlabel{\printfield{labelnumber}}%
\hspace{\biblabelsep}}
\ifisresumebib
\defbibenvironment{resumebib}%修改对齐环境-调整缩进
{\list
{\printtext[labelnumberwidth]{%
\printfield{labelprefix}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\leftmargin}{\bibhang}%
\addtolength{\leftmargin}{\labelnumberwidth}%
\setlength{\itemindent}{\bibitemindent}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\fi
\else
\RequirePackage[numbers,sort&compress,square]{natbib}
\newcommand{\upcite}[1]{\textsuperscript{\cite{#1}}} % 上标形式引用
\fi
\RequirePackage[colorlinks=true,linkcolor=blue,citecolor=red,pdfborder=0 1 1]{hyperref}
\RequirePackage{datetime}
%\RequirePackage[pdfborder=0 0 1]{hyperref}
Expand Down Expand Up @@ -898,7 +956,6 @@
%
% \begin{macrocode}
%<*cls>
\newcommand{\upcite}[1]{\textsuperscript{\cite{#1}}} % 上标形式引用
\newcommand{\china}{中华人民共和国}
\def\nudtpaper{\textsc{Nudt}\textsc{Paper}}
\newcommand{\pozhehao}{\kern0.2em\rule[0.8ex]{1.6em}{0.1ex}\kern0.2em}
Expand Down
6 changes: 3 additions & 3 deletions ref/refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ @ARTICLE{cnarticle
}

@INBOOK{clzs,
chapter = {大人物还是讲人情的},
title = {大人物还是讲人情的},
pages = {185-207},
title = {沧浪之水},
booktitle = {沧浪之水},
publisher = {人民文学出版社},
year = {2001},
author = {阎真},
bookauthor = {阎真},
language = {zh}
}

Expand Down
85 changes: 85 additions & 0 deletions ref/resume.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
@article{ref-1-1-Yang,
author = {Yang, Y and Ren, T L and Zhang, L T and others},
title = {Miniature microphone with silicon-based ferroelectric thin films},
journal = {Integrated Ferroelectrics},
date = {2003},
pages = {229-235},
volume = {52},
annotation = {SCI 收录, 检索号:758FZ},
}

@article{ref-2-1-杨轶,
author = {杨轶 and 张宁欣 and 任天令 and others},
title = {硅基铁电微声学器件中薄膜残余应力的研究},
journal = {中国机械工程},
pages= {1289-1291},
date = {2005},
volume = {16},
number ={14},
annotation ={EI 收录, 检索号:0534931 2907},
}

@article{ref-3-1-杨轶,
author = {杨轶 and 张宁欣 and 任天令 and others},
title = {集成铁电器件中的关键工艺研究},
journal = {仪器仪表学报},
date = {2003},
volume = {24},
pages={192-193},
number = {S4},
annotation = {EI 源刊},
}

@article{ref-4-1-Yang,
author = {Yang, Y and Ren, T L and Zhu, Y P and others},
title = {PMUTs for handwriting recognition},
pubstate ={In press},
annotation = {已被 Integrated Ferroelectrics 录用. SCI 源刊.},
}


@article{ref-5-1-Wu,
author = {Wu, X M and Yang, Y and Cai, J and others},
title = {Measurements of ferroelectric MEMS microphones},
journal = {Integrated Ferroelectrics},
date = {2005},
pages={417-429},
volume = {69},
annotation = {SCI 收录, 检索号 :896KM.},
}


@article{ref-6-1-贾泽,
author = {贾泽 and 杨轶 and 陈兢 and others},
title = {用于压电和电容微麦克风的体硅腐蚀相关研究},
journal = {压电与声光},
date = {2006},
pages = {117-119},
number={1},
volume = {28},
annotation = {EI 收录, 检索号:06129773469.},
}


@article{ref-7-1-伍晓明,
author = {伍晓明 and 杨轶 and 张宁欣 and others},
title = {基于MEMS技术的集成铁电硅微麦克风},
journal = {中国集成电路},
date = {2003},
volume = {53},
pages = {59-61},
}

@patent{ref-8-1-任天令,
author = {任天令 and 杨轶 and 朱一平 and others},
title = {硅基铁电微声学传感器畴极化区域控制和电极连接的方法},
number ={中国, CN1602118A},
annotation = {中国专利公开号.},
}

@patent{ref-9-1-Ren,
author = {Ren, T L and Yang, Y and Zhu, Y P and others},
title = {Piezoelectric micro acoustic sensor based on ferroelectric materials},
number ={USA, No.11/215, 102},
annotation = {美国发明专利申请号.},
}
Loading