分类
LaTeX

为WinEdt添加自制LaTeX模板

实际上, 写作过程中有些重复的东西。 为此, 我们可以将公共的部分提出来建一个模板文件。 然后将其添加到WinEdt中, 这样我们就可以直接在新建文档里面找到了。

详细过程如下:

  1. 假设你的tex安装目录为:C:\CTEX, 首先是把你的模板文件copy到C:\CTEX\WinEdt\Templates\Doc下面, 这样WinEdt就可以在相应位置找到该文件了。
  2. 打开WinEdt, 单击Options->Options Interface, 打开选项交互边侧栏。此时在该边侧栏找到Editor: Mouse,Modes,Defaults... 下的Document Templates, 并单击打开Templates.ini
  3. 在你希望显示新模板的位置(我这里是最后, 注意放在[END]之前才有效)添加一条TEMPLATE, 我是首先copy一条AMSartTEMPLATE 然后修改成这个样子:
TEMPLATE="CTeX: Article"
  MODE="TeX"
  NAME=""
  EXTENSION=".tex"
  FILE_TEMPLATE="%B\Templates\Doc\Chinese_template.tex"
  BEFORE_MACRO=""
  AFTER_MACRO="[NextBullet;ScreenCenterLine;]"

其中只有两处需要对应修改, 一是TEMPLATE="CTeX: Article", 这里CTeX: Article可以修改在新建Document时的显示名字。二是FILE_TEMPLATE="%B\Templates\Doc\Chinese_template.tex" 这里Chinese_template.tex 是我的模板名,你可能需要更改成你在之前copy的到Doc下的模板文件名。

最后附上我的模板文件源码






\usepackage{amsmath,amsthm,amssymb}






\setlist[enumerate,1]{label={\normalfont(\alph*)}}



\DeclareCaptionLabelSeparator{twospace}{\ ~}
\captionsetup{labelsep=twospace}









\hypersetup{%
    pdfstartview=FitH,
    bookmarksopen=false,
    colorlinks=true,
    linkcolor=blue,
    pdfinfo={
        Title={},%Input your title here
        Subject={},%Input your subject
        Author={},%Your name
        Keywords={},%Your keywords%
        }
}



\newtheorem{defn}{定义}[section]
\newtheorem{thm}[defn]{定理}
\newtheorem{lem}[defn]{引理}
\newtheorem{cor}[defn]{推论}
\newtheorem{prop}[defn]{命题}
\newtheorem*{rem}{注记}

\numberwithin{equation}{section}

\newenvironment{eq}{\equation}{\endequation}




\newcommand{\comp}{\raisebox{1pt}{\scalebox{.7}{$\circ$}}}

\newcommand{\set}[1]{\left\{#1\right\}}

\newcommand{\pt}{\partial}




\begin{filecontents}{\jobname.bib}
@book{lebesgue2003leccons,
  title={Le{\c{c}}ons sur l'int{\'e}gration et la recherche des fonctions primitives},
  author={Lebesgue, Henri},
  volume={267},
  year={2003},
  publisher={AMS Bookstore}
}
@article{shoen1976harmonic,
  title={Harmonic maps and the topology of stable hypersurfaces and manifolds with non-negative Ricci curvature},
  author={Shoen, Richard and Yau, Shing Tung},
  journal={Commentarii Mathematici Helvetici},
  volume={51},
  number={1},
  pages={333--341},
  year={1976},
  publisher={Springer}
}
\end{filecontents}



文章题目
你的名字\&合作者
04/10/2015

\newcommand{\Addresses}{{% additional braces for segregating \footnotesize
  \bigskip
  \footnotesize
  R.~Campbell, \textsc{Department of Mathematics, Pennsylvania State University,
    Pittsburgh, Pennsylvania 13593}\par\nopagebreak
  \textit{E-mail address}, R.~Campbell: \texttt{[email protected]}\\
  \medskip
  M.~Dane (Corresponding author), \textsc{Atmospheric Research Station,
    Pala Lundi, Fiji}\par\nopagebreak
  \textit{E-mail address}, M.~Dane: \texttt{DaneMark@@ffr.choice}
}}




1. 如何使用Ctex写中文

写中文最简单的办法就是使用 了.

1.1. 定理环境使用

定理 1 (勾股定理).

假设$a,b,c$是直角三角形的三边长, 且$c$为斜边长. 则

\begin{eq}\label{eq:1}

a^2+b^2=c^2.

\end{eq}

公式\eqref{eq:1}就称为勾股定理.

2. 参考文献的示例

这是引用[1]

\Addresses

参考文献

    发表回复

    您的电子邮箱地址不会被公开。 必填项已用*标注

    此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据