编译环境:

  • Ubuntu16.04
  • texllive2016
  • sublime text3 + latextools

该模板使用与自己写文档,记笔记,记录代码,写作业等等。

%!TEX program = xelatex
\documentclass[10pt,onecolumn,a4paper]{article}
\usepackage{ctex} % 支持中文
\usepackage{enumerate} % 项目编号
%\usepackage{enumitem}
\usepackage{geometry} % 设置页边距
\geometry{left = 2.2cm, right=2.2cm, top = 2.5cm, bottom=2.5cm}
\usepackage{amssymb} % symbol
\usepackage{amsthm} % proof
%\usepackage{courier} % 代码字体
\usepackage{graphicx,subfigure} % figures
\usepackage{xcolor,mdframed} % mdframed
\usepackage{amsmath}
\usepackage{fancyhdr} % 添加页眉页脚
\usepackage{titlesec}
\titleformat*{\section}{\centering\bf\large} %设置章节字体
\usepackage{indentfirst} % 首行缩进
\setlength{\parindent}{2em} % 设置首行缩进两字符
\usepackage{breqn}
\renewcommand\d{\mathop{}\!\mathrm{d}}
\usepackage{multirow} \newtheorem{theorem}{Theorem}
\renewcommand{\proofname}{\emph{\textbf{Proof}}}
%\definecolor{mycolor}{RGB}{200,200,200}
\definecolor{mycolor}{RGB}{192,192,192} % 设置代码阴影 \cfoot{\thepage} % 代码
%\usepackage{listings}
\usepackage{fontspec}
\setmonofont[Mapping={}]{DejaVu Sans Mono} %英文引号之类的正常显示,相当于设置英文字体,windows下用Consolas字体,Linux下用DejaVu Sans Mono字体
%\setmonofont[Mapping={}]{Consolas} %英文引号之类的正常显示,相当于设置英文字体
\setmonofont{DejaVu Sans Mono}
%\setsansfont{Consolas} %设置英文字体 Monaco, Consolas, Fantasque Sans Mono,Linux下用DejaVu Sans Mono字体
%\setmainfont{Consolas} %设置文章主体部分的英文字体 \setcounter{tocdepth}{2} % 设置目录深度 \begin{document}
\title{文档标题}
\author{作者}
%\today
\maketitle % 显示文档标题 作者 时间 \tableofcontents % 生成标题目录
%\listoftables % 生成表格目录
%\listoffigures % 生成图片目录
%\clearpage
%\newpage % 换页 \section{第一章标题}
\subsection{第一章第一节标题}
一级标题和二级标题:
\begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\section{} 表示一级标题,自动对标题进行编号
\section*{} 表示一级标题,不对标题进行编号
\subsection{} 表示二级标题,自动对标题进行编号
\subsection*{} 表示二级标题,不对标题进行编号
\end{verbatim}
\end{mdframed} 书写代码的环境,设置背景颜色为黑色,不显示行号:
\begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\ begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\ begin{verbatim}
代码内容
\ end{verbatim}
\ end{mdframed}
%注意这里为了避免歧义,在反斜杠\后加了空格
\end{verbatim}
\end{mdframed} 插入图片:
\begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\begin{figure}
\centering % 设置图片居中显示
\includegraphics[width=5in]{./当前目录下的图片如pic.jpg} % 设置了图片宽度
\caption{图片标题用于在图片下显示}\label{图片标签用于引用}
\end{figure}
\end{verbatim}
\end{mdframed} 默认使用首行缩进,如果不希望缩进,那么需要使用:
\begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\noindent
\end{verbatim}
\end{mdframed} 项目编号,默认起始编号为1.
\begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\begin{enumerate}
\item 这里默认起始编号为1.
\end{enumerate}
\end{verbatim}
\end{mdframed} 项目编号,默认起始编号为(1)
\begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\begin{enumerate}[(1)]
\item
\end{enumerate}
\end{verbatim}
\end{mdframed} 项目编号,默认起始编号为(a)
\begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\begin{enumerate}[(a)]
\item
\end{enumerate}
\end{verbatim}
\end{mdframed} 项目编号,默认起始编号为指定数字:
\begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\begin{enumerate}
\setcounter{enumi}{4}
\item 设置默认起始编号为5.
\end{enumerate}
\end{verbatim}
\end{mdframed} \begin{table}[!hbp]
\centering
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
% after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
项目1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline
项目2 & 8 & 9 & 10 & 11 & 12 & 13 \\ \hline
项目3 & 一 & 二 & 三 & 四 & 五 & 六 \\ \hline
\end{tabular}
\caption{表格名称}\label{表格标签}
\end{table}
如表\ref{表格标签}所示: \begin{mdframed}[backgroundcolor=mycolor,hidealllines=true]
\begin{verbatim}
\begin{table}[!hbp]
\centering
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
% after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
项目1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline
项目2 & 8 & 9 & 10 & 11 & 12 & 13 \\ \hline
项目3 & 一 & 二 & 三 & 四 & 五 & 六 \\ \hline
\end{tabular}
\caption{表格名称}\label{表格标签}
\end{table}
如\ref{表格标签}所示:
\end{verbatim}
\end{mdframed} \end{document}

效果如下图所示:

未完待续……

一份不太简短的LaTeX模板的更多相关文章

  1. 一份不太简短的LaTeX教程 lshort – A short in­tro­duc­tion to LATEX 2elshort – A short in­tro­duc­tion to LATEX 2e

    Lshort started as a trans­la­tion and ra­tio­nal­i­sa­tion of a ground-break­ing Ger­man-lan­guage i ...

  2. 【持续更新】一个简洁、易用的美赛LaTeX模板: easyMCM

    目录 1 当前美赛模板通行情况的概述 2 easymcm宏包说明 2.1 与mcmthesis的关系之说明 2.2 easymcm宏包的简介 2.3 美赛模板下载地址 3 常见问题的解决方案 若您无意 ...

  3. 【持续更新】一个简洁、易用的美赛 LaTeX 模板: easyMCM

    目录 1 当前美赛模板通行情况的概述 2 EasyMCM 宏包说明 2.1 与 mcmthesis 的关系之说明 2.2 easymcm宏包的简介 2.3 美赛模板下载地址 3 README 摘录 3 ...

  4. 山东大学硕士/博士研究生毕业论文--Latex模板

    山东大学硕士/博士研究生毕业论文Latex模板 模板下载地址:  https://github.com/Tsingke/SDU_thesis_template_for_postgraduate 封皮预 ...

  5. 国内大学毕业论文 LaTeX 模板集合

    西北工业大学学位论文LaTeX模板 http://code.google.com/p/nwputhesis/ 西北工业大学硕博士论文LaTeX模版 http://code.google.com/p/n ...

  6. 国内大学毕业论文LaTeX模板集合

    国内大学毕业论文LaTeX模板集合 薛瑞尼的清华大学学位论文LaTeX模板http://sourceforge.net/projects/thuthesis/ 北大论文文档 LaTeX 模板 pkut ...

  7. IEEE LaTeX模板使用BibTeX

    IEEE LaTeX 模板使用 BibTeX 在Google Scholar获得的文献引用格式一般是BibTex的,而IEEE Transactions的模板默认用的是BibItem.目前没有什么自动 ...

  8. LaTeX模板 - FORMCM

    LaTex 模板 - FORMCM \documentclass{mcmthesis} \mcmsetup{CTeX = true, % 使用 CTeX 套装时,设置为 true tcn = 8989 ...

  9. 定制一个支持中英文的简单LaTex模板

    平常写汇报文档什么的,word排版有时还是比较费劲,遂定制一个简单的LaTex模板,中文默认为宋体,英文为LaTex默认字体,支持彩色高亮展示,有目录书签,有页眉展示,大致如下: LaTex代码如下: ...

随机推荐

  1. 瑞波Ripple-OnlineDeletion配置的理解

    1.概要 如果没有设置online deletion,那么Rippled Server的本地数据库大小将会无限增长.为了释放磁盘空间,那种情况应该被制止并且那些数据库文件应该被手动删除.online ...

  2. ie8,9不支持indexOf解决办法,纯拷贝

    原文在这里,大家快去点啊 自从开始工作后,就没有再碰过原型链了,今天遇到ie8不认识indexOf的时候才发现原型这么嚣张,,哈哈 把代码粘过来,以后留着看 //添加数组IndexOf方法 if (! ...

  3. HTML&&css练习

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. hdu 1541 (基本树状数组) Stars

    题目http://acm.hdu.edu.cn/showproblem.php?pid=1541 n个星星的坐标,问在某个点左边(横坐标和纵坐标不大于该点)的点的个数有多少个,输出n行,每行有一个数字 ...

  5. 部分开源gis 方案的比较

    3.1MapServer和GeoServer的总体对比 功能上:MapServer弱于GeoServer,QGIS要强于UDIG. 效率上:Mapserver对WMS(Web Map service) ...

  6. BZOJ 2733 [HNOI2012]永无乡 - 启发式合并主席树

    Description 1: 查询一个集合内的K大值 2: 合并两个集合 Solution 启发式合并主席树板子 Code #include<cstdio> #include<cst ...

  7. UI设计教程分享:6个不能错过的UI设计网站

    Ui设计学习的人越来越多了,想要找到合适的学习资料很难,很多才接触ui设计且没有基础的同学也不知道去哪里找学习资料,虽然现在百度上很容易搜到ui设计的学习资料,但是一看不难发现,很多都是过时的学习资料 ...

  8. 当前页面刷新和动态添加控件的jquery事件绑定on

    当前页面刷新(console): location.reload() 给动态添加的控件添加js事件(委托): <ul> <li>菜单一</li> <li> ...

  9. SQL注入漏洞总结

    目录: 一.SQL注入漏洞介绍 二.修复建议 三.通用姿势 四.具体实例 五.各种绕过 一.SQL注入漏洞介绍: SQL注入攻击包括通过输入数据从客户端插入或“注入”SQL查询到应用程序.一个成功的S ...

  10. 调用webservice时,产生android.os.NetworkOnMainThreadException错误

    android.os.NetworkOnMainThreadException 网上搜索后知道是因为版本问题,在4.0之后在主线程里面执行Http请求都会报这个错,也许是怕Http请求时间太长造成程序 ...