diff --git a/Main.lyx b/Main.lyx index d1830d5..b582c17 100644 --- a/Main.lyx +++ b/Main.lyx @@ -71,6 +71,7 @@ \use_default_options false \begin_modules theorems-ams +algorithm2e \end_modules \maintain_unincluded_children false \language chinese-simplified diff --git a/chapters/Appendix.lyx b/chapters/Appendix.lyx index 1b1e7ee..c2c5b11 100644 --- a/chapters/Appendix.lyx +++ b/chapters/Appendix.lyx @@ -17,6 +17,7 @@ \master ../Main.lyx \begin_modules theorems-ams +algorithm2e \end_modules \maintain_unincluded_children false \begin_local_layout diff --git a/chapters/FrontMatter.lyx b/chapters/FrontMatter.lyx index f3c2988..3b731a7 100644 --- a/chapters/FrontMatter.lyx +++ b/chapters/FrontMatter.lyx @@ -36,6 +36,79 @@ InsetLayout Flex:Keywords LatexType Command LatexName keywords End + +Style notationlist + Category List + Margin First_Dynamic + LatexType Item_environment + LatexName notationlist + NextNoIndent 1 + LeftMargin MM + LabelSep xxx + ParSkip 0.4 + ItemSep 0.2 + TopSep 0.7 + BottomSep 0.7 + ParSep 0.3 + Align Block + AlignPossible Block, Left + LabelType Manual + LabelFont + Series Bold + EndFont + HTMLTag dl + HTMLAttr class='description' + HTMLItem dd + HTMLLabel dt + HTMLLabelFirst 1 + HTMLStyle + dl.description dt { font-weight: bold; } + EndHTMLStyle +End + + +Style 符号说明 + Margin Static + LatexType Environment + LatexName notation + Category FrontMatter + NextNoIndent 1 + ToggleIndent Always + LeftMargin MMM + RightMargin MMM + ParIndent MM + ItemSep 0 + TopSep 0.7 + BottomSep 0.7 + ParSep 0 + Align Block + LabelType Centered + LabelString "符号说明" + LabelBottomSep 0.5 + Font + Size Small + EndFont + LabelFont + Series Bold + Size Large + EndFont + HTMLLabelFirst 1 + HTMLForceCSS 1 + HTMLStyle + div.abstract { + margin: 4ex; + } + div.abstract_item { + font-size: small; + padding-top: 1ex; + } + div.abstract_label { + font-weight: bold; + } + EndHTMLStyle +End + + ####### NoStyle Chapter NoStyle Chapter* @@ -159,7 +232,21 @@ NoStyle ChapterSpecial status open \begin_layout Plain Layout -中国科学技术大学;学位论文;Lyx模板;博士;硕士;学士 +中国科学技术大学;学位论文;\SpecialChar LyX + 模板; +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +LaTeX{} +\end_layout + +\end_inset + + 模版;博士;硕士;学士 \end_layout \end_inset @@ -175,7 +262,8 @@ status open \end_layout \begin_layout EnglishAbstract -This is a sample document of USTC thesis Lyx template for bachelor, master +This is a sample document of USTC thesis \SpecialChar LyX + template for bachelor, master and doctor. The template is created by zepinglee and seisman, which orignate from the template created by ywg. @@ -184,8 +272,19 @@ This is a sample document of USTC thesis Lyx template for bachelor, master \begin_layout EnglishAbstract This document will show the usage of basic commands provided by +\begin_inset ERT +status open + +\begin_layout Plain Layout + + \backslash -LaTeX{} and some features provided by the template. +LaTeX{} +\end_layout + +\end_inset + + and some features provided by the template. For more information, please refer to the template document ustcthesis.pdf.. \end_layout @@ -330,7 +429,7 @@ status open status open \begin_layout Plain Layout -Denotation, 主要符号对照表 +符号对照表 \end_layout \begin_layout Plain Layout @@ -350,7 +449,7 @@ status open \backslash -chapter{主要符号对照表} +chapter{符号说明} \end_layout \end_inset @@ -367,7 +466,7 @@ chapter{主要符号对照表} \begin_layout Standard \begin_inset Tabular - + @@ -420,7 +519,39 @@ CLS \end_inset -\begin_inset space ~ +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +能量 +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $\ensuremath{{\displaystyle \sum_{i=1}^{n}a_{i}}}$ +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +The sum of +\begin_inset Formula $a_{i}$ \end_inset @@ -428,11 +559,25 @@ CLS \end_inset - + + + \begin_inset Text \begin_layout Plain Layout -能量 +\begin_inset Formula $\ensuremath{{\displaystyle m}}$ +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +The mass of one angel \end_layout \end_inset diff --git a/chapters/Introduction.lyx b/chapters/Introduction.lyx index 0ee41b6..d2fbf2b 100644 --- a/chapters/Introduction.lyx +++ b/chapters/Introduction.lyx @@ -18,6 +18,7 @@ \master ../Main.lyx \begin_modules theorems-ams +algorithm2e \end_modules \maintain_unincluded_children false \begin_local_layout @@ -108,7 +109,7 @@ NoStyle Cover \begin_body \begin_layout Chapter -本Lyx模板介绍 +本LyX模板介绍 \end_layout \begin_layout Section @@ -252,7 +253,7 @@ https://github.com/ustctug/ustcthesis/wiki/新手指南 \end_layout \begin_layout Subsection -安装Lyx +安装LyX \end_layout \begin_layout Standard diff --git a/chapters/Skills.lyx b/chapters/Skills.lyx index 24f4814..46a3d92 100644 --- a/chapters/Skills.lyx +++ b/chapters/Skills.lyx @@ -17,6 +17,7 @@ \master ../Main.lyx \begin_modules theorems-ams +algorithm2e \end_modules \maintain_unincluded_children false \begin_local_layout @@ -124,7 +125,7 @@ name "chap:使用技巧" \begin_layout Standard \align center -直接copy本章的格式模板,用于您的文档。 +Tips: 本章的格式范例,可直接copy用于您的文档。 \end_layout \begin_layout Section @@ -189,7 +190,16 @@ end{document}之间的文档内容,然后将之包进主文档 (如果导言 \end_layout \begin_layout Section -插图和表格 +使用Lyx帮助文档 +\end_layout + +\begin_layout Standard +\SpecialChar LyX +的帮助文档比较全面,新用户可以几分钟看一下入门教程,上手是非常快的。更详细问题可以用户手册里查看。 +\end_layout + +\begin_layout Section +插图浮动项 \end_layout \begin_layout Standard @@ -259,7 +269,7 @@ status open \begin_layout Plain Layout \begin_inset Graphics - filename D:/Users/LitePhosphor/Seafile/MyWork/2018/USTC-Lyx/ustcthesis/figures/ustc_logo_fig.pdf + filename ../figures/ustc_logo_fig.pdf lyxscale 20 width 5cm @@ -287,7 +297,7 @@ status open \begin_layout Plain Layout \begin_inset Graphics - filename D:/Users/LitePhosphor/Seafile/MyWork/2018/USTC-Lyx/ustcthesis/figures/ustc_logo_text.pdf + filename ../figures/ustc_logo_text.pdf lyxscale 30 width 4cm @@ -331,67 +341,415 @@ USTC Elements \end_layout \begin_layout Standard -\begin_inset Newpage clearpage +有的同学可能听说“ +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +LaTeX{} +\end_layout + +\end_inset + + 只能使用 eps 格式的图片”,甚至把 jpg 格式转为 eps。 事实上,这种做法已经过时。 而且每次编译时都要要调用外部工具解析 eps,导致降低编译速度 +。 所以我们推荐矢量图直接使用 pdf , svg,位图使用 jpeg 或 png 格式。如果系统上安装了inkscape,可以右键点击图,使用外部编辑器编辑s +vg图片。 +\end_layout + +\begin_layout Section +表格浮动项 +\end_layout + +\begin_layout Standard +\begin_inset Float table +wide false +sideways false +status open + +\begin_layout Plain Layout +\align center +\begin_inset Caption Standard + +\begin_layout Plain Layout +\begin_inset CommandInset label +LatexCommand label +name "tab:atoms" + +\end_inset + +三线表。表号和表题在表的正上方。 +\end_layout + +\end_inset + + +\begin_inset Tabular + + + + + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $r_{c}$ +\end_inset + + ( +\begin_inset Formula $\mathring{A}$ +\end_inset + +) +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $r_{0}$ +\end_inset + + ( +\begin_inset Formula $\mathring{A}$ +\end_inset + +) +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $\kappa r_{0}$ +\end_inset + + +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +Cu +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +0.800 +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +14.10 +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +2.550 +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +Ag +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +0.990 +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +15.90 +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +2.710 +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +Au +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +1.150 +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +15.90 +\end_layout + \end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +2.710 +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +Mg +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +0.490 +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +17.60 +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +3.200 +\end_layout + +\end_inset + + + + +\end_inset + + +\end_layout + +\end_inset + +\end_layout +\begin_layout Standard +编制表格应简单明了,表达一致,明晰易懂,表文呼应、内容一致。 排版时表格字号略小,或变换字体,尽量不分页,尽量不跨节。 表格太大需要转页是,需要在续表上方注明“ +续表”,表头页应重复排出。 +\end_layout + +\begin_layout Standard +表格的具体格式可以通过鼠标右键调出表格首选项里设置。增加表格列或行,点击表格后,在表格工具栏里点击对应图标设置。 \end_layout \begin_layout Section -tex转换为lyx +算法浮动项 \end_layout \begin_layout Standard -使用winedit编写的tex文件,默认是GBK编码的。可以使用lyx自带的tex2lyx.exe程序转换.假设lyx安装在D盘,需要转换chap3.tex这个文件, -在cmd先切换到lyx/bin文件夹下: +模板中使用 +\backslash +pkg{algorithm2e} 宏包实现算法环境。关于该宏包的具体用法, 请阅读宏包的官方文档。 \end_layout \begin_layout Standard -\begin_inset listings -lstparams "numbers=left,numberstyle={\tiny},stepnumber=1,basicstyle={\footnotesize},breaklines=true,showstringspaces=false,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},stringstyle={\ttfamily},keepspaces=true,breakindent=22pt,flexiblecolumns=true,breakautoindent=true,breakindent=4em,texcl=true,aboveskip=1em" -inline false +\begin_inset Float algorithm +placement htb +wide false +sideways false status open \begin_layout Plain Layout -D: +\size small +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +SetAlgoLined \end_layout \begin_layout Plain Layout -cd D: + \backslash -Program Files (x86) +KwData{this text} +\end_layout + +\begin_layout Plain Layout + + \backslash -LyX 2.2 +KwResult{how to write algorithm with \backslash -bin +LaTeX2e } \end_layout -\end_inset +\begin_layout Plain Layout + +initialization +\backslash +; +\end_layout + +\begin_layout Plain Layout +\backslash +While{not at end of this document}{ \end_layout -\begin_layout Standard -然后运行转换命令 +\begin_layout Plain Layout + + read current +\backslash +; \end_layout -\begin_layout Standard -\begin_inset listings -lstparams "numbers=left,numberstyle={\tiny},stepnumber=1,basicstyle={\footnotesize},breaklines=true,showstringspaces=false,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},stringstyle={\ttfamily},keepspaces=true,breakindent=22pt,flexiblecolumns=true,breakautoindent=true,breakindent=4em,texcl=true,aboveskip=1em" -inline false -status open +\begin_layout Plain Layout + + +\backslash +eIf{understand}{ +\end_layout \begin_layout Plain Layout -D: + go to next section \backslash -Program Files (x86) +; +\end_layout + +\begin_layout Plain Layout + + current section becomes this one \backslash -LyX 2.2 +; +\end_layout + +\begin_layout Plain Layout + + }{ +\end_layout + +\begin_layout Plain Layout + + go back to the beginning of current section \backslash -bin>tex2lyx.exe chap3.tex -e GBK +; +\end_layout + +\begin_layout Plain Layout + + } +\end_layout + +\begin_layout Plain Layout + + } +\end_layout + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +算法示例1 +\end_layout + +\end_inset + + +\begin_inset CommandInset label +LatexCommand label +name "algo:algorithm1" + +\end_inset + + \end_layout \end_inset @@ -400,41 +758,43 @@ bin>tex2lyx.exe chap3.tex -e GBK \end_layout \begin_layout Standard -如果是utf8编码的文件,-e 后的参数改为utf8。注意生成的lyx文件不能直接使用,因为这个文件没有设置模板。需要从这个文件中将内容拷贝出来,粘贴到设置好模 -板的lyx文件中。新建lyx文件参考 +注意,我们可以在论文正文中插入算法,不建议插入大段代码。如果需要在论文中附带代码,可以在论文的附录中加入源码。参考本章第 \begin_inset CommandInset ref -LatexCommand formatted -reference "sec:新建Lyx文件" +LatexCommand ref +reference "sec:程序代码" plural "false" caps "false" noprefix "false" \end_inset -。会遇到语言问题,参考 -\begin_inset CommandInset ref -LatexCommand formatted -reference "sub:语言问题" -plural "false" -caps "false" -noprefix "false" +节的例子,使用程序列表(Listing)插入源码。 +\end_layout +\begin_layout Standard +\begin_inset Newpage clearpage \end_inset -。 + \end_layout \begin_layout Section -使用Lyx帮助文档 +公式 \end_layout \begin_layout Standard -\SpecialChar LyX -的帮助文档比较全面,新用户可以几分钟看一下入门教程,上手是非常快的。更详细问题可以用户手册里查看。 +公式实例: \end_layout -\begin_layout Section -公式 +\begin_layout Standard +\begin_inset Formula +\begin{equation} +E=mc^{2}\label{eq:energy} +\end{equation} + +\end_inset + + \end_layout \begin_layout Subsection @@ -468,32 +828,6 @@ cdot 换行公式键入:在公式里ctl+enter 即可换行,可以通过右键设置公式属性,例如将整个公式编号还是某一行编号 \end_layout -\begin_layout Section -数学定理 -\end_layout - -\begin_layout Subsection -添加定理 -\end_layout - -\begin_layout Standard -论文模板中并没有提供各种定理环境,可以在文档中插入模块来实现所需的定理环境。在 文档\SpecialChar menuseparator -首选项\SpecialChar menuseparator -模块 中根据需要载入模块。 例如,在本章文档中已经加入了AMS的The -orem普通模块,在格式下拉菜单下可以看到添加了很多定理格式。书写一条语句用定理格式化,如下 -\end_layout - -\begin_layout Theorem -任何一个一元复系数多项式都至少有一个复数根 -\begin_inset CommandInset label -LatexCommand label -name "thm:algebra" - -\end_inset - - -\end_layout - \begin_layout Section 标签和引用 \end_layout @@ -741,6 +1075,32 @@ reference "fig:USTC-Elements" \end_inset +\end_layout + +\begin_layout Section +数学定理 +\end_layout + +\begin_layout Subsection +添加定理 +\end_layout + +\begin_layout Standard +论文模板中并没有提供各种定理环境,可以在文档中插入模块来实现所需的定理环境。在 文档\SpecialChar menuseparator +首选项\SpecialChar menuseparator +模块 中根据需要载入模块。 例如,在本章文档中已经加入了AMS的The +orem普通模块,在格式下拉菜单下可以看到添加了很多定理格式。书写一条语句用定理格式化,如下 +\end_layout + +\begin_layout Theorem +任何一个一元复系数多项式都至少有一个复数根 +\begin_inset CommandInset label +LatexCommand label +name "thm:algebra" + +\end_inset + + \end_layout \begin_layout Section @@ -857,6 +1217,13 @@ lyxpipe \begin_layout Section 程序代码 +\begin_inset CommandInset label +LatexCommand label +name "sec:程序代码" + +\end_inset + + \end_layout \begin_layout Standard @@ -1275,11 +1642,98 @@ File Formats 来设置相应图片格式的编辑器。这样对图片右键, 慢。 \end_layout +\begin_layout Section +tex转换为lyx +\end_layout + +\begin_layout Standard +使用winedit编写的tex文件,默认是GBK编码的。可以使用lyx自带的tex2lyx.exe程序转换.假设lyx安装在D盘,需要转换chap3.tex这个文件, +在cmd先切换到lyx/bin文件夹下: +\end_layout + +\begin_layout Standard +\begin_inset listings +lstparams "numbers=left,numberstyle={\tiny},stepnumber=1,basicstyle={\footnotesize},breaklines=true,showstringspaces=false,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},stringstyle={\ttfamily},keepspaces=true,breakindent=22pt,flexiblecolumns=true,breakautoindent=true,breakindent=4em,texcl=true,aboveskip=1em" +inline false +status open + +\begin_layout Plain Layout + +D: +\end_layout + +\begin_layout Plain Layout + +cd D: +\backslash +Program Files (x86) +\backslash +LyX 2.2 +\backslash +bin +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +然后运行转换命令 +\end_layout + +\begin_layout Standard +\begin_inset listings +lstparams "numbers=left,numberstyle={\tiny},stepnumber=1,basicstyle={\footnotesize},breaklines=true,showstringspaces=false,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},stringstyle={\ttfamily},keepspaces=true,breakindent=22pt,flexiblecolumns=true,breakautoindent=true,breakindent=4em,texcl=true,aboveskip=1em" +inline false +status open + +\begin_layout Plain Layout + +D: +\backslash +Program Files (x86) +\backslash +LyX 2.2 +\backslash +bin>tex2lyx.exe chap3.tex -e GBK +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +如果是utf8编码的文件,-e 后的参数改为utf8。注意生成的lyx文件不能直接使用,因为这个文件没有设置模板。需要从这个文件中将内容拷贝出来,粘贴到设置好模 +板的lyx文件中。新建lyx文件参考 +\begin_inset CommandInset ref +LatexCommand formatted +reference "sec:新建Lyx文件" +plural "false" +caps "false" +noprefix "false" + +\end_inset + +。会遇到语言问题,参考 +\begin_inset CommandInset ref +LatexCommand formatted +reference "sub:语言问题" +plural "false" +caps "false" +noprefix "false" + +\end_inset + +。 +\end_layout + \begin_layout Chapter 常见问题和解决方法 \end_layout -\begin_layout Subsection +\begin_layout Section 语言问题 \begin_inset CommandInset label LatexCommand label @@ -1299,7 +1753,7 @@ name "sub:语言问题" 选中有问题的文字,鼠标右键调出属性菜单,语言,选中文。 \end_layout -\begin_layout Subsection +\begin_layout Section 超链接编译错误 \end_layout