
简单的包完全可以自己动手写,先看一个简单的例子,我们的目的是最终写出一个完整的毕业论文模板thesis.cls。
编写thesis.cls内容如下:
\NeedsTeXFormat{LaTeX2e}[2007/10/19]
\ProvidesClass{thesis}
[2011/04/05 v0.1 Thesis Template for Doctor]
\LoadClass[cs4size,a4paper,fancyhdr,fntef, UTF8]{ctexbook}[2007/10/19]
\RequirePackage{amsmath,amsthm,amsfonts,amssymb,bm}
\RequirePackage{apjfonts, epigraph, titlesec, textcomp}
\RequirePackage{natbib}
\renewcommand\title[1]{\def\IHEP@value@title{#1}}
\renewcommand\author[1]{\def\IHEP@value@author{#1}}
\renewcommand\maketitle{%
\clearpage
\thispagestyle{empty}
\vspace*{50pt}
\begin{center}
\bf\songti\zihao{-1}中国科学院研究生院\\博士学位论文
\vskip 50pt
\bf\heiti\zihao{3} \underline{~\IHEP@value@title~}
\vskip 20pt
\bf\kaishu\zihao{4} \underline{~\IHEP@value@author~}
\end{center}
}
\makeatletter
\def\IHEP@value@title{~~~~~(论~文~题~目)~~~~~}
\def\IHEP@value@author{~~~~~(作~者~姓~名)~~~~~}
\makeatother
\endinput
写测试文件test.tex,内容如下
\documentclass{thesis}
\begin{document}
\title{编写论文模板}
\author{Liyropt}
\maketitle
\end{document}
将thesis.cls和test.tex放在同一目录下,用Latex编译
你是否正确的安装了你的MacTex这个包呢,这个包中会给你自动安装pdflatex和其他相关工具,单独安装texshop是不能使用的。。。并且你可以尝试使用其他的方式,如xelatex。看看是否其他的已经安装上了额。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)