add convert 2 to 3

EthanDeng
2019-04-14 19:30:21 +08:00
parent c66748e7f3
commit 2ccca6aecb
4 changed files with 55 additions and 7 deletions

@@ -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. This Logo ratio is 1:1, that is square picture. In the replacement of the picture, please choose the appropriate picture to replace.
<a name="myfootnote1">1</a>: Thank ChinaTEX for providing free image source site, and [pexels.com](https://www.pexels.com/) is also recommended. <a name="myfootnote1">1</a>: Thank ChinaTeX for providing free image source site, and [pexels.com](https://www.pexels.com/) is also recommended.

@@ -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/添加序章)
* [示例](https://github.com/ElegantLaTeX/ElegantBook/wiki/最小示例) * [示例](https://github.com/ElegantLaTeX/ElegantBook/wiki/最小示例)
* [跨版本转换](https://github.com/ElegantLaTeX/ElegantBook/wiki/转换)
* 作者 * 作者
* [Github](https://github.com/EthanDeng) * [Github](https://github.com/EthanDeng)
* [个人主页](https://ddswhu.me/) * [个人主页](https://ddswhu.me/)

@@ -2,18 +2,18 @@
## 命令行方式安装 ## 命令行方式安装
以管理员权限打开命令行,在命令行输入下面命令即可安装 elegantnote 模板。 以管理员权限打开命令行,在命令行输入下面命令即可安装 elegantbook 模板。
```shell ```shell
tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet
tlmgr install elegantnote tlmgr install elegantbook
``` ```
升级和卸载分别使用 升级和卸载分别使用
```shell ```shell
tlmgr update elegantnote tlmgr update elegantbook
tlmgr uninstall elegantnote 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) ![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)

47
转换.md Normal file

@@ -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}{}{}`