3
convert
EthanDeng edited this page 2019-04-18 16:46:58 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

如果你使用的 ElegantBook 2.x 版本,推荐将其改为符合 ElegantBook 3.x 版本的格式,下面是在不安装 ElegantBook 模板前提下的转换步骤。

  1. 从 Github 上下载最新的模板,将 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. 类文件选项:mathpazomtpro2 均不支持了,如果你使用了这两个选项,需要将其删除。示例,如果使用了 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\|
    • verbatim 替换为 lstlisting,根据有框无框需求可以给 lstlisting 环境添加 frame=single 选项。
  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}{}{}