From 2ccca6aecb23b2fccd709632754916333140fd42 Mon Sep 17 00:00:00 2001 From: EthanDeng Date: Sun, 14 Apr 2019 19:30:21 +0800 Subject: [PATCH] add convert 2 to 3 --- CoverLogo.md | 2 +- _Sidebar.md | 1 + 安装.md | 12 ++++++------ 转换.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 转换.md diff --git a/CoverLogo.md b/CoverLogo.md index b40973b..c47134b 100644 --- a/CoverLogo.md +++ b/CoverLogo.md @@ -2,4 +2,4 @@ The cover image used in this template is from [pixabay.com](https://pixabay.com/ This Logo ratio is 1:1, that is square picture. In the replacement of the picture, please choose the appropriate picture to replace. -1: Thank ChinaTEX for providing free image source site, and [pexels.com](https://www.pexels.com/) is also recommended. +1: Thank ChinaTeX for providing free image source site, and [pexels.com](https://www.pexels.com/) is also recommended. diff --git a/_Sidebar.md b/_Sidebar.md index 7274cfc..1c2dc9f 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -13,6 +13,7 @@ * [参考文献](https://github.com/ElegantLaTeX/ElegantBook/wiki/参考文献) * [添加序章](https://github.com/ElegantLaTeX/ElegantBook/wiki/添加序章) * [示例](https://github.com/ElegantLaTeX/ElegantBook/wiki/最小示例) +* [跨版本转换](https://github.com/ElegantLaTeX/ElegantBook/wiki/转换) * 作者 * [Github](https://github.com/EthanDeng) * [个人主页](https://ddswhu.me/) diff --git a/安装.md b/安装.md index 6d835eb..38a0910 100644 --- a/安装.md +++ b/安装.md @@ -2,18 +2,18 @@ ## 命令行方式安装 -以管理员权限打开命令行,在命令行输入下面命令即可安装 elegantnote 模板。 +以管理员权限打开命令行,在命令行输入下面命令即可安装 elegantbook 模板。 ```shell tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet -tlmgr install elegantnote +tlmgr install elegantbook ``` 升级和卸载分别使用 ```shell -tlmgr update elegantnote -tlmgr uninstall elegantnote +tlmgr update elegantbook +tlmgr uninstall elegantbook ``` ## 包管理工具方式安装 @@ -30,6 +30,6 @@ Load standard net repository: http://mirror.ctan.org/systems/texlive/tlnet ![tlmgr](https://elegantlatex.org/image/tlmgr-1.png) -然后在匹配框内输入包的名字,比如 `elegantnote`,在搜索结果中勾选需要安装/更新/卸载的包: +然后在匹配框内输入包的名字,比如 `elegantbook`,在搜索结果中勾选需要安装/更新/卸载的包: -![tlmgr](https://elegantlatex.org/image/tlmgr-note.png) +![tlmgr](https://elegantlatex.org/image/tlmgr-book.png) diff --git a/转换.md b/转换.md new file mode 100644 index 0000000..e039c06 --- /dev/null +++ b/转换.md @@ -0,0 +1,47 @@ +如果你使用的 ElegantBook 2.x 版本,推荐将其改为符合 ElegantBook 3.x 版本的格式,下面是在不安装 ElegantBook 模板前提下的转换步骤。 + +1. 从 Github 上下载[最新的模板](https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip),将 3.x 版本的 `elegantbook.cls` 替换你当前目录下 2.x 的 `elegantbook.cls`。 +2. 将下载下来的 logo.png 和 cover.jpg 复制到 2.x 版本 ./figure/ 文件夹下,因为 2.x 使用的是 PDF 文件,需要把 2.x 版本的主文件(`main.tex`)中的 `\logo{logo.pdf}` 替换为 `\logo{logo.png}`,`\cover{cover.pdf}` 替换为 `\cover{cover.jpg}`。 +3. 类文件选项:`mathpazo` 和 `mtpro2` 均不支持了,如果你使用了这两个选项,需要将其删除。示例,如果使用了 `mathpazo` 选项,需要把 `\documentclass[green,mathpazo]{elegantbook}` 改为 `\documentclass[green]{elegantbook}`。 +4. `\zhtitle` 和 `\zhend` 合并为 `\title`,也即 `\zhtitle{zh-string1}` 和 `\zhend{zh-string2}` 改为 `\title{zh-string1 zhstring2}`。 +5. `\entitle` 和 `\enend` 合并为 `\subtitle`,合并方法同上。 +6. `\myquote` 改为 `\equote`。 +7. 由于未使用 `mtpro2` 宏包,所以需要把 `\mbf` 改为 `\mathbf`。 +8. 在 `\mainmatter` 之后加上 `\hypersetup{pageanchor=true}` +9. 颜色修改 + + main 没有改动,不需要替换; + + thid 改为 third; + + seco 改为 second。 +10. 抄录环境 + + `\verb|x|` 改为 `\lstinline|x|`,具体替换为 `verb\|` 改为 `lstinline\|` +11. `\bibliographystyle{ieeetr}` 删除。 +12. 自定义环境 + +**第一步,名字替换:** + + `newdef` 改为 `definition` + + `newthem` 改为 `theorem` + + `newlemma` 改为 `lemma` + + `newcorol` 改为 `corollary` + + `newprop` 改为 `proposition` + + `newproof` 改为 `proof` + +**第二步:选项替换:** + +除去 `newproof` 环境,其他都需要使用正则表达式替换。 +这一步存在两种情况,一种是环境**使用了选项**,则使用下面的替换规则: + ++ `\begin{环境名}[x]` 改为 `\begin{环境名}{x}{}`。 + + `begin{definition}\[(.*?)\]` 替换为 `begin{definition}{\1}{}` + + `begin{theorem}\[(.*?)\]` 替换为 `begin{theorem}{\1}{}` + + `begin{lemma}\[(.*?)\]` 替换为 `begin{lemma}{\1}{}` + + `begin{corollary}\[(.*?)\]` 替换为 `begin{corollary}{\1}{}` + + `begin{proposition}\[(.*?)\]` 替换为 `begin{proposition}{\1}{}` + +如果定理环境**未使用选项**,则需要使用下面替换规则: + ++ `\begin{环境名}` 改为 `\begin{环境名}{}{}` + + `begin{definition}$` 替换为 `begin{definition}{}{}` + + `begin{theorem}$` 替换为 `begin{theorem}{}{}` + + `begin{lemma}$` 替换为 `begin{lemma}{}{}` + + `begin{corollary}$` 替换为 `begin{corollary}{}{}` + + `begin{proposition}$` 替换为 `begin{proposition}{}{}` \ No newline at end of file