Skip to content

Commit

Permalink
解决单独编译章节不能显示参考文献的问题。使用ustcsetup.tex设置文档。
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcui committed Jan 26, 2022
1 parent e473352 commit 551b030
Show file tree
Hide file tree
Showing 10 changed files with 404 additions and 148 deletions.
87 changes: 15 additions & 72 deletions Main.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -170,7 +125,7 @@ Main 文档

\begin_layout Enumerate
整体结构,导航子章节。同目录下USTCthesis.layout 为\SpecialChar LyX
的 布局文件(或称为layout 文件)。
的布局文件(或称为layout 文件)。
\end_layout

\begin_layout Enumerate
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down
86 changes: 24 additions & 62 deletions Main_English.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@

注意先安装texlive,再安装LyX, LyX可以自动识别latex路径,并配置。 如果后安装texlive, 需要在LyX中设置,菜单: 工具->重配置LyX。重启LyX。

* 设置论文信息。
在”ustcsetup.tex“里设置作者和论文的信息。

* 选择学位论文类型:

打开Main.lyx文档,菜单 文档->首选项->文档类->文档类选项。填写文档类选项,默认为doctor。
Expand Down
63 changes: 63 additions & 0 deletions chapters/Appendix.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
18 changes: 18 additions & 0 deletions chapters/FrontMatter.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -341,6 +345,11 @@ hspace{1em}格}%加入目录
\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
Expand All @@ -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

Expand All @@ -367,6 +380,11 @@ hspace{1em}图}%加入目录
\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
Expand Down
Loading

0 comments on commit 551b030

Please sign in to comment.