peacefullin
2025-07-14 16:45:44
Latex宏包就是模板,分为class(以ls为后缀,在documentclass命令中使用)和style(以sty为后缀,在usepackage命令中使用),如常见的book,article类;以及graphicx,caption包等。Latex提供了专门的工具doc/docstrip来编写宏包。 简单的包完全可以自己动手写,先看一个简单的例子,我们的目的是最终写出一个完整的毕业论文模板ls。 编写ls内容如下: /NeedsTeXFormat{LaTeX2e}[2007/10/19] /ProvidesClass{thesis} [2011/04/05 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 写测试文件x,内容如下 /documentclass{thesis} /begin{document} /title{编写论文模板} /author{Liyropt} /maketitle /end{document} 将ls和x放在同一目录下,用Latex编译
试试这个?/documentclass[11pt,a4paper,oneside]{report}/usepackage{mathptmx} % you may add any packages you need /begin{document}/title{YOUR TITLE}/author{Andrew Roberts}/date{December 2004}//end{document}这里有个比较不错Latex说明:(英文版)