From 551b030641f81348cc9538f5e3eb01494843326d Mon Sep 17 00:00:00 2001 From: jmcui Date: Wed, 26 Jan 2022 13:55:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8D=95=E7=8B=AC=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E7=AB=A0=E8=8A=82=E4=B8=8D=E8=83=BD=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=8F=82=E8=80=83=E6=96=87=E7=8C=AE=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82=E4=BD=BF=E7=94=A8ustcsetup.tex=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Main.lyx | 87 ++++++---------------------------- Main_English.lyx | 86 ++++++++++------------------------ README.md | 3 ++ chapters/Appendix.lyx | 63 +++++++++++++++++++++++++ chapters/FrontMatter.lyx | 18 +++++++ chapters/Introduction.lyx | 57 ++++++++++++++++++++-- chapters/Publication.lyx | 56 ++++++++++++++++++++-- chapters/Skills.lyx | 66 ++++++++++++++++++++++++-- release.sh | 17 ++++++- ustcsetup.tex | 99 +++++++++++++++++++++++++++++++++++++++ 10 files changed, 404 insertions(+), 148 deletions(-) create mode 100644 ustcsetup.tex diff --git a/Main.lyx b/Main.lyx index b582c17..2c5881b 100644 --- a/Main.lyx +++ b/Main.lyx @@ -10,64 +10,19 @@ % Created by jmcui 6-23-2011 @USTC % use USTCthesis class: https://github.com/jmcui/USTC-Lyx -% 模版参数, 在文档类里设置,不能在本导言区设置。这里仅仅列出参数,供参考 -% doctor|master|bachelor [academic|professional] [chinese|english] [print|pdf] -% [super|numebers|authoryear] - -\title{中国科学技术大学\\学位论文模板示例文档} -\author{李泽平} -\major{数学与应用数学} -\supervisor{华罗庚\ 教授} -\cosupervisor{钱学森\ 教授} -% \date{二〇一七年五月一日} % 注释掉则为今日 -% \professionaltype{专业学位类型} -% \secretlevel{秘密} % 绝密|机密|秘密,注释本行则不保密 -% \secretyear{20} % 保密年限 - -\entitle{An example of thesis template for University of Science and Technology - of China} -\enauthor{Zeping Li} -\enmajor{Mathematics and Applied Mathematics} -\ensupervisor{Prof. Luogeng Hua} -\encosupervisor{Prof. Xuesen Qian} -% \endate{May 1, 2017} % Today if commented -% \enprofessionaltype{Professional degree type} -% \ensecretlevel{Secret} % Top secret|Highly secret|Secret - - -% load packages -\usepackage{bibentry,natbib} -\usepackage{hyperref} - -%%图、表的格式化引用 -\newrefformat{fig}{\hyperref[#1]{图\ref*{#1}\,}} -\newrefformat{eq}{\hyperref[#1]{式\ref*{#1}\,}} -\newrefformat{tab}{\hyperref[#1]{表\ref*{#1}\,}} - -%%listings设置 -\usepackage{listings} -\usepackage{xcolor} -\lstset{ - tabsize=4, % - frame=shadowbox, %把代码用带有阴影的框圈起来 - commentstyle=\color{red!50!green!50!blue!50},%浅灰色的注释 - rulesepcolor=\color{red!20!green!20!blue!20},%代码块边框为淡青色 - keywordstyle=\color{blue!90}\bfseries, %代码关键字的颜色为蓝色,粗体 - showstringspaces=false,%不显示代码字符串中间的空格标记 - stringstyle=\ttfamily, % 代码字符串的特殊格式 - keepspaces=true, % - breakindent=22pt, % - basicstyle=\footnotesize, % - showspaces=false, % - flexiblecolumns=true, % - breaklines=true,%对过长的代码自动换行 - breakautoindent=true,% - breakindent=4em,% - texcl=true, - aboveskip=1em %代码块边框 -} +% Template setup parameter +% degree = doctor | master | bachelor +% degree-type = academic | professional +% language = chinese | english +% fontset = windows | mac | ubuntu | fandol + + +\def\myref{Ref} +\usepackage{bibentry} + +\input{ustcsetup.tex} \end_preamble -\options doctor +\options degree=doctor \use_default_options false \begin_modules theorems-ams @@ -170,7 +125,7 @@ Main 文档 \begin_layout Enumerate 整体结构,导航子章节。同目录下USTCthesis.layout 为\SpecialChar LyX -的 布局文件(或称为layout 文件)。 +的布局文件(或称为layout 文件)。 \end_layout \begin_layout Enumerate @@ -200,17 +155,9 @@ status open \end_layout \begin_layout Enumerate -封面设置,在主文档Main.lyx的导言区设置: +封面设置。在ustcsetup.tex文件里设置封面。可以使用vscode编辑tex文件。 \end_layout -\begin_deeper -\begin_layout Plain Layout -文档\SpecialChar menuseparator -首选项\SpecialChar menuseparator -latex导言区 -\end_layout - -\end_deeper \end_inset @@ -339,11 +286,7 @@ filename "chapters/Skills.lyx" status open \begin_layout Plain Layout -参考文献 -\end_layout - -\begin_layout Plain Layout -参考文献用Bibtex实现。需在Main文档中,其他子文当方可引用。 +参考文献。 \end_layout \end_inset diff --git a/Main_English.lyx b/Main_English.lyx index 8d8cf5d..30d3236 100644 --- a/Main_English.lyx +++ b/Main_English.lyx @@ -10,64 +10,19 @@ % Created by jmcui 6-23-2011 @USTC % use USTCthesis class: https://github.com/jmcui/USTC-Lyx -% 模版参数, 在文档类里设置,不能在本导言区设置。这里仅仅列出参数,供参考 -% doctor|master|bachelor [academic|professional] [chinese|english] [print|pdf] -% [super|numebers|authoryear] - -\title{中国科学技术大学\\学位论文模板示例文档} -\author{李泽平} -\major{数学与应用数学} -\supervisor{华罗庚\ 教授} -\cosupervisor{钱学森\ 教授} -% \date{二〇一七年五月一日} % 注释掉则为今日 -% \professionaltype{专业学位类型} -% \secretlevel{秘密} % 绝密|机密|秘密,注释本行则不保密 -% \secretyear{20} % 保密年限 - -\entitle{An example of thesis template for University of Science and Technology - of China} -\enauthor{Zeping Li} -\enmajor{Mathematics and Applied Mathematics} -\ensupervisor{Prof. Luogeng Hua} -\encosupervisor{Prof. Xuesen Qian} -% \endate{May 1, 2017} % Today if commented -% \enprofessionaltype{Professional degree type} -% \ensecretlevel{Secret} % Top secret|Highly secret|Secret - - -% load packages -\usepackage{bibentry,natbib} -\usepackage{hyperref} - -%%图、表的格式化引用 -\newrefformat{fig}{\hyperref[#1]{图\ref*{#1}\,}} -\newrefformat{eq}{\hyperref[#1]{式\ref*{#1}\,}} -\newrefformat{tab}{\hyperref[#1]{表\ref*{#1}\,}} - -%%listings设置 -\usepackage{listings} -\usepackage{xcolor} -\lstset{ - tabsize=4, % - frame=shadowbox, %把代码用带有阴影的框圈起来 - commentstyle=\color{red!50!green!50!blue!50},%浅灰色的注释 - rulesepcolor=\color{red!20!green!20!blue!20},%代码块边框为淡青色 - keywordstyle=\color{blue!90}\bfseries, %代码关键字的颜色为蓝色,粗体 - showstringspaces=false,%不显示代码字符串中间的空格标记 - stringstyle=\ttfamily, % 代码字符串的特殊格式 - keepspaces=true, % - breakindent=22pt, % - basicstyle=\footnotesize, % - showspaces=false, % - flexiblecolumns=true, % - breaklines=true,%对过长的代码自动换行 - breakautoindent=true,% - breakindent=4em,% - texcl=true, - aboveskip=1em %代码块边框 -} +% Template setup parameter +% degree = doctor | master | bachelor +% degree-type = academic | professional +% language = chinese | english +% fontset = windows | mac | ubuntu | fandol + + +\def\myref{Ref} +\usepackage{bibentry} + +\input{ustcsetup.tex} \end_preamble -\options doctor, english, numbers +\options degree=doctor, language=english, numbers \use_default_options false \begin_modules theorems-ams @@ -213,14 +168,21 @@ status open \end_layout \begin_layout Enumerate -Cover,Setting premeable area in the Main_English.lyx : +Cover: \end_layout \begin_deeper -\begin_layout Plain Layout -Document\SpecialChar menuseparator -Preference\SpecialChar menuseparator -latex premeable +\begin_layout Enumerate +Set author information in the “ustcsetup.tex +\begin_inset Quotes erd +\end_inset + + file. +\end_layout + +\begin_layout Enumerate +Setting premeable area in the Main_English.lyx. + \end_layout \end_deeper diff --git a/README.md b/README.md index dd86fd7..7305f3e 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,9 @@ 注意先安装texlive,再安装LyX, LyX可以自动识别latex路径,并配置。 如果后安装texlive, 需要在LyX中设置,菜单: 工具->重配置LyX。重启LyX。 +* 设置论文信息。 + 在”ustcsetup.tex“里设置作者和论文的信息。 + * 选择学位论文类型: 打开Main.lyx文档,菜单 文档->首选项->文档类->文档类选项。填写文档类选项,默认为doctor。 diff --git a/chapters/Appendix.lyx b/chapters/Appendix.lyx index c2c5b11..5a948ae 100644 --- a/chapters/Appendix.lyx +++ b/chapters/Appendix.lyx @@ -111,6 +111,20 @@ NoStyle EnglishAbstract 修改记录 \end_layout +\begin_layout Itemize +1/26-2022 +\end_layout + +\begin_deeper +\begin_layout Itemize +升级模版兼容 ustcthesis V3.3.01 +\end_layout + +\begin_layout Itemize +每章添加参考文献,单独编译章节的时可以显示参考文献列表,引用处也不是问号了。利用tex条件判断代码控制编译,解决与主文档参考文献冲突的问题。 +\end_layout + +\end_deeper \begin_layout Itemize 1/30-2019 \end_layout @@ -171,5 +185,54 @@ makebookspline中给出(最好用命令直接将标题中的回车删除,需 04/11-2012 修正最初版本的一些bug;去掉模板中冗余的些命令;整理使用技巧一章 \end_layout +\begin_layout Standard +\begin_inset Separator plain +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +ifx +\backslash +myref +\backslash +undefined +\end_layout + +\end_inset + + +\begin_inset CommandInset bibtex +LatexCommand bibtex +btprint "btPrintCited" +bibfiles "../Ref" +options "../ustcthesis-numerical" + +\end_inset + + +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +fi +\end_layout + +\end_inset + + +\end_layout + \end_body \end_document diff --git a/chapters/FrontMatter.lyx b/chapters/FrontMatter.lyx index 3b731a7..e7cc1de 100644 --- a/chapters/FrontMatter.lyx +++ b/chapters/FrontMatter.lyx @@ -326,6 +326,10 @@ LatexCommand tableofcontents \end_layout \begin_layout Standard +\begin_inset Note Note +status open + +\begin_layout Plain Layout \begin_inset ERT status open @@ -341,6 +345,11 @@ hspace{1em}格}%加入目录 \end_inset +\end_layout + +\end_inset + + \end_layout \begin_layout Standard @@ -352,6 +361,10 @@ hspace{1em}格}%加入目录 \end_layout \begin_layout Standard +\begin_inset Note Note +status open + +\begin_layout Plain Layout \begin_inset ERT status open @@ -367,6 +380,11 @@ hspace{1em}图}%加入目录 \end_inset +\end_layout + +\end_inset + + \end_layout \begin_layout Standard diff --git a/chapters/Introduction.lyx b/chapters/Introduction.lyx index d2fbf2b..35c4158 100644 --- a/chapters/Introduction.lyx +++ b/chapters/Introduction.lyx @@ -10,8 +10,9 @@ \usepackage{xcolor} -\usepackage{hyperref} +\usepackage[sort]{natbib} %\graphicspath{{figures/}} +\usepackage{hyperref} \end_preamble \options doctor,twoside \use_default_options false @@ -74,9 +75,10 @@ NoStyle Cover \use_package stackrel 0 \use_package stmaryrd 0 \use_package undertilde 0 -\cite_engine basic -\cite_engine_type default -\biblio_style plain +\cite_engine natbib +\cite_engine_type numerical +\biblio_style plainnat +\biblio_options sort \use_bibtopic false \use_indices false \paperorientation portrait @@ -84,6 +86,11 @@ NoStyle Cover \justification true \use_refstyle 0 \use_minted 0 +\branch Chapter +\selected 1 +\filename_suffix 0 +\color #55aa00 +\end_branch \index 索引 \shortcut idx \color #008000 @@ -525,6 +532,48 @@ https://git.lug.ustc.edu.cn/ustctug/ustcthesis \end_inset +\end_layout + +\begin_layout Standard +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +ifx +\backslash +myref +\backslash +undefined +\end_layout + +\end_inset + + +\begin_inset CommandInset bibtex +LatexCommand bibtex +btprint "btPrintCited" +bibfiles "../Ref" +options "../ustcthesis-numerical" + +\end_inset + + +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +fi +\end_layout + +\end_inset + + \end_layout \end_body diff --git a/chapters/Publication.lyx b/chapters/Publication.lyx index b1ce318..1d35df4 100644 --- a/chapters/Publication.lyx +++ b/chapters/Publication.lyx @@ -69,9 +69,10 @@ NoStyle EnglishAbstract \use_package stackrel 0 \use_package stmaryrd 0 \use_package undertilde 0 -\cite_engine basic -\cite_engine_type default -\biblio_style plain +\cite_engine natbib +\cite_engine_type numerical +\biblio_style plainnat +\biblio_options sort \use_bibtopic false \use_indices false \paperorientation portrait @@ -189,6 +190,55 @@ bibentry{fu2008coupling} \end_inset +\end_layout + +\begin_layout Standard +\begin_inset Separator plain +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +ifx +\backslash +myref +\backslash +undefined +\end_layout + +\end_inset + + +\begin_inset CommandInset bibtex +LatexCommand bibtex +btprint "btPrintCited" +bibfiles "../Ref" +options "../ustcthesis-numerical" + +\end_inset + + +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +fi +\end_layout + +\end_inset + + \end_layout \end_body diff --git a/chapters/Skills.lyx b/chapters/Skills.lyx index ed8e7ce..691e7b2 100644 --- a/chapters/Skills.lyx +++ b/chapters/Skills.lyx @@ -9,10 +9,11 @@ %Created by jmcui \usepackage{xcolor} -\usepackage{hyperref} %\graphicspath{{figures/}} + +\usepackage{hyperref} \end_preamble -\options doctor,twoside +\options degree=doctor \use_default_options false \master ../Main.lyx \begin_modules @@ -72,9 +73,10 @@ NoStyle EnglishAbstract \use_package stackrel 0 \use_package stmaryrd 0 \use_package undertilde 0 -\cite_engine basic -\cite_engine_type default -\biblio_style plain +\cite_engine natbib +\cite_engine_type numerical +\biblio_style plainnat +\biblio_options sort \use_bibtopic false \use_indices false \paperorientation portrait @@ -1213,6 +1215,18 @@ lyxpipe \end_inset +\end_layout + +\begin_layout Standard +参考文献测试:引用 +\begin_inset CommandInset citation +LatexCommand cite +key "childress2006faulttolerant,faraon2010resonant,thomas2010adiamond" +literal "false" + +\end_inset + + \end_layout \begin_layout Section @@ -1776,5 +1790,47 @@ href 链接的文字直接写入,而链接通过参数插入。鼠标右键点击链接对象,调出菜单,点'链接'。 \end_layout +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +ifx +\backslash +myref +\backslash +undefined +\end_layout + +\end_inset + + +\begin_inset CommandInset bibtex +LatexCommand bibtex +btprint "btPrintCited" +bibfiles "../Ref" +options "../ustcthesis-numerical" + +\end_inset + + +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +fi +\end_layout + +\end_inset + + +\end_layout + \end_body \end_document diff --git a/release.sh b/release.sh index 34347b5..beb8dc3 100755 --- a/release.sh +++ b/release.sh @@ -1,5 +1,11 @@ #!/bin/bash -rm -R ./release/* +if [ ! -d "./release/" ];then + mkdir release +else + rm -R ./release/* +fi + +cp *.tex ./release/ cp *.lyx ./release/ cp *.md ./release/ cp *.bib ./release/ @@ -11,6 +17,13 @@ cp ./USTCthesis.layout ./release/ cp -R ./chapters ./release/ -rm ./release/chapters/*.lyx~ cp ./ustcthesis/ustcthesis.cls ./release/chapters/ cp ./USTCthesis.layout ./release/chapters/ + +FINDED_FILES=`find ./release/chapters -name *.lyx~` +for file in ${FINDED_FILES} +do + rm -rf ${file} +done + +echo 'reflesh release folder' diff --git a/ustcsetup.tex b/ustcsetup.tex new file mode 100644 index 0000000..1f8df65 --- /dev/null +++ b/ustcsetup.tex @@ -0,0 +1,99 @@ +\ustcsetup{ + title = {中国科学技术大学\\学位论文模板示例文档 \ustcthesisversion}, + title* = {An example of thesis template for University of Science + and Technology of China \ustcthesisversion}, + author = {李泽平}, + author* = {Li Zeping}, + speciality = {数学与应用数学}, + speciality* = {Mathematics and Applied Mathematics}, + supervisor = {XXX~教授, XXX~教授}, + supervisor* = {Prof. XXX, Prof. XXX}, + % date = {2017-05-01}, % 默认为今日 + % professional-type = {专业学位类型}, + % professional-type* = {Professional degree type}, + % department = {数学科学学院}, % 院系,本科生需要填写 + % student-id = {PB11001000}, % 学号,本科生需要填写 + % secret-level = {秘密}, % 绝密|机密|秘密|控阅,注释本行则公开 + % secret-level* = {Secret}, % Top secret | Highly secret | Secret + % secret-year = {10}, % 保密/控阅期限 + % + % 数学字体 + % math-style = GB, % 可选:GB, TeX, ISO + math-font = xits, % 可选:stix, xits, libertinus +} + + +% 加载宏包 + +% 插图 +\usepackage{graphicx} + +% 三线表 +\usepackage{booktabs} + +% 跨页表格 +\usepackage{longtable} + +% SI 量和单位 +\usepackage{siunitx} + +% 参考文献使用 BibTeX + natbib 宏包 +% 顺序编码制 +\usepackage[sort]{natbib} +\bibliographystyle{ustcthesis-numerical} + +% 著者-出版年制 +% \usepackage{natbib} +% \bibliographystyle{ustcthesis-authoryear} + +% 本科生参考文献的著录格式 +% \usepackage[sort]{natbib} +% \bibliographystyle{ustcthesis-bachelor} + +% 参考文献使用 BibLaTeX 宏包 +% \usepackage[style=ustcthesis-numeric]{biblatex} +% \usepackage[bibstyle=ustcthesis-numeric,citestyle=ustcthesis-inline]{biblatex} +% \usepackage[style=ustcthesis-authoryear]{biblatex} +% \usepackage[style=ustcthesis-bachelor]{biblatex} +% 声明 BibLaTeX 的数据库 +% \addbibresource{bib/ustc.bib} + +% 配置图片的默认目录 +\graphicspath{{figures/}} + + +% 用于写文档的命令 +\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} +\DeclareRobustCommand\pkg{\textsf} +\DeclareRobustCommand\file{\nolinkurl} + +%%图、表的格式化引用 +\newrefformat{fig}{\hyperref[#1]{图\ref*{#1}\,}} +\newrefformat{eq}{\hyperref[#1]{式\ref*{#1}\,}} +\newrefformat{tab}{\hyperref[#1]{表\ref*{#1}\,}} + +%%listings设置 +\usepackage{listings} +\usepackage{xcolor} +\lstset{ + tabsize=4, % + frame=shadowbox, %把代码用带有阴影的框圈起来 + commentstyle=\color{red!50!green!50!blue!50},%浅灰色的注释 + rulesepcolor=\color{red!20!green!20!blue!20},%代码块边框为淡青色 + keywordstyle=\color{blue!90}\bfseries, %代码关键字的颜色为蓝色,粗体 + showstringspaces=false,%不显示代码字符串中间的空格标记 + stringstyle=\ttfamily, % 代码字符串的特殊格式 + keepspaces=true, % + breakindent=22pt, % + basicstyle=\footnotesize, % + showspaces=false, % + flexiblecolumns=true, % + breaklines=true,%对过长的代码自动换行 + breakautoindent=true,% + breakindent=4em,% + texcl=true, + aboveskip=1em %代码块边框 +} + +% hyperref 宏包在最后调用 +\usepackage{hyperref}