以下是我的个人论文模板,运行环境为Xelatex(在线ide:Sharelatex.com)
鉴于本人常有插入程序的需求,故引用了lstlisting
\RequirePackage{ifxetex}\ifxetex \documentclass[hyperref, UTF8, c5size, no-math, winfonts,a4paper]{ctexart} \punctstyle{quanjiao} \defaultfontfeatures{Mapping=tex-text} \setCJKmainfont[AutoFakeBold=false, ItalicFont=FandolKai]{FandolSong} \setCJKsansfont[AutoFakeBold=false]{FandolHei} \setCJKmonofont{FandolFang}\else \documentclass[hyperref, UTF8, c5size, winfonts]{ctexart} \usepackage[colorlinks,linkcolor=black]{hyperref}\fi%\documentclass[bachelor,openany,oneside,color]{buaathesis}\usepackage{CJKspace}\usepackage{CJKutf8}\usepackage{amssymb}\usepackage{amsmath}\usepackage{listings} \usepackage{xcolor}\usepackage{graphicx}\usepackage{geometry}\usepackage{cite}\title{\ \\ \ \\ \ \\ \ \\ 我的论文}\author{\\ \\ 北京航空航天大学计算机学院 \ 黄铎 \\ 学号\ :\ XXXXXXXX \\ \\ 指导教师:XXX}%\date{2016 年 11 月%sharelatex Version\usepackage[left=2.4cm,right=2.4cm,top=2.9cm,bottom=2.4cm]{geometry}%texide Version%\geometry{left=2.4cm,right=2.4cm,top=2.9cm,bottom=2.4cm}\lstset{numbers=left, basicstyle=\small,numberstyle= \small, keywordstyle= \color{ blue!70},commentstyle=\color{red!50!green!50!blue!50}, frame=shadowbox, rulesepcolor= \color{ red!20!green!20!blue!20} } \begin{document}%标题绘制\includegraphics[scale=0.55]{favicon_large_black.png}\maketitle\newpage\pagestyle{plain}%摘要\renewcommand{\abstractname}{\LARGE 中文摘要}\begin{abstract}\largeXXXX 是 XXXX。\normalsize\end{abstract}\textbf{\large 关键词: 词1}\ \\ \ \\ \ \\\renewcommand{\abstractname}{\LARGE English Abstract}\begin{abstract}\largeXXXX is XXXX.\normalsize\end{abstract}\textbf{\large Keywords : kwd1}\clearpage%目录\tableofcontents\clearpage%内容\section{第一章}\newpage%参考文献\begin{thebibliography}{0}\bibitem{e-wiki}\text{维基百科, \href{https://en.wikipedia.org/wiki/E\_(mathematical\_constant)}{e(mathematical constant) - Wikipedia}}\bibitem{pi-wiki}\text{维基百科, \href{https://en.wikipedia.org/wiki/Pi}{pi - Wikipedia}}\end{thebibliography}\newpage\newpage\end{document}