% !Mode:: "TeX:UTF-8:Hard"
\documentclass[a4paper]{article}
\usepackage[a4paper,hmargin=1.25in,vmargin=1in]{geometry} % 用Microsoft Office 中Word 的默认页边距
% ===========================数学符号===============================================
\usepackage{amsmath,amssymb}
\usepackage{bm} % $\bm{letter}$ 数学式中粗斜体字母的最佳方案
\usepackage{calc}
\usepackage{units} %单位宏包
% ===========================XeLatex相关宏包与选项========================================
\usepackage[driverfallback=dvipdfm,colorlinks=true,linkcolor=black]{hyperref} % 选项防与amssymb冲突,防目录、注释红框。
\usepackage{xltxtra}
% 提供了针对XeTeX的改进并且加入了XeTeX的LOGO,自动调用xunicode宏包(提供Unicode字符宏)
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
% 中文断行
% ===========================中文字体==========================================
\usepackage[hyperref,nopunct]{ctex}
%\usepackage{fontspec}
%将系统字体名映射为逻辑字体名称,主要是为了维护的方便
\newcommand\fontnamewenquanyi{WenQuanYi Micro Hei Mono}
\newcommand\fontnamefangsong{FangSong}
\newcommand\fontnameyahei{Microsoft YaHei}
\newcommand\fontnamehei{SimHei}
\newcommand\fontnamesong{SimSun}
\newcommand\fontnamekai{楷体}
%English Fonts
\newcommand\fontnamemono{DejaVu Sans Mono}
\newcommand\fontnameroman{Times New Roman}
\newcommand\fontnamelucida{Lucida Console}
\newcommand\fontnamecourier{Courier New}
\newcommand\fontnamemeiryo{Meiryo UI}
%%设置常用中文字号,方便调用
\newcommand{\erhao}{\fontsize{22pt}{\baselineskip}\selectfont}
\newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont}
\newcommand{\sanhao}{\fontsize{16pt}{\baselineskip}\selectfont}
\newcommand{\xiaosanhao}{\fontsize{15pt}{\baselineskip}\selectfont}
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont}
\newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}\selectfont}
\newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}\selectfont}
\newcommand{\xiaowuhao}{\fontsize{9pt}{\baselineskip}\selectfont}
\newcommand{\liuhao}{\fontsize{7.5pt}{\baselineskip}\selectfont}
%设置文档正文字体为宋体
\setCJKmainfont[BoldFont=\fontnamehei]{\fontnamesong}
\setCJKsansfont[BoldFont=\fontnamehei]{\fontnamekai}
\setCJKmonofont{\fontnamemono}
\setmainfont{\fontnameroman}
%楷体
\newfontinstance\KAI {\fontnamekai}
\newcommand{\kai}[1]{{\KAI#1}}
%黑体
\newfontinstance\HEI{\fontnamehei}
\newcommand{\hei}[1]{{\HEI#1}}
%雅黑
\newfontinstance\YAHEI{\fontnameyahei}
\newcommand{\yahei}[1]{{\YAHEI#1}}
%
%宋体
\newfontinstance\SONG{\fontnamesong}
\newcommand{\song}[1]{{\SONG#1}}
%隶书
\newfontfamily\lishu{LiSu}
%英文
\newfontinstance\ROMAN{\fontnameroman}
\newcommand{\newroman}[1]{\,{\ROMAN#1}\,}
%Lucida Console
\newfontinstance\LUCIDA{\fontnamelucida}
\newcommand{\lucida}[1]{\,{\LUCIDA#1}\,}
%Courier New
\newfontinstance\COURIER{\fontnamecourier}
\newcommand{\courier}[1]{\,{\COURIER#1}\,}
%Consolas
\newfontfamily\consol{Consolas}
%Minion Pro
\newfontfamily\minion{Minion Pro}
%===========================段落设置================================================
\usepackage{setspace}
\setlength{\parindent}{2em}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
% ==========================图形表格=================================================
\usepackage{caption}
\captionsetup{font={scriptsize}}
\usepackage{booktabs}
\usepackage{array}
\usepackage{longtable}
\usepackage{tabularx} % 上这个网站 http://truben.no/latex/table/ 粗制一份表格
\usepackage{rotating} % 图片旋转
\usepackage{graphicx} % 插图必用宏包
\usepackage{wrapfig}
\usepackage{tikz}
%==========================引用格式宏包=============================
\usepackage{harvard} % havard bibliography style宏包
\citationstyle{dcu} % harvard引用格式,即(author 1, year 1; author 2, year 2)格式
% ========================默认组成名修改成对应中文命令========================
\renewcommand{\figurename}{图} % 将图的名字改成图1:…… 图2:……等
\renewcommand{\tablename}{表} % 将默认的talbe 1,table 2改成表1、表2等
\usepackage{titletoc}
\renewcommand{\contentsname}{\centering{\Huge 目\quad 录}}
%\usepackage[center]{titlesec}
%\titleformat{\chapter}{\centering\huge\hei}{第\,\thechapter\,章}{1em}{}
% ===========Opening===============
\begin{document}
\tableofcontents % 目录
\clearpage
\section{装傻}
很傻
\subsection{犯二}
很二
\end{document}