编译环境:

  • 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. YII2中分页组件的使用

    当数据过多,无法一页显示时,我们经常会用到分页组件,YII2中已经帮我们封装好了分页组件. 首先我们创建操作数据表的AR模型: <?php namespace app\models; use y ...

  2. 如何指定vim 的查找是从上往下还是从下往上[z]

    vim 搜索可以是 / 或者 ?,前者是往下找,后者是往前找. 用 n 查找下一个的时候,就和这两个指令指定的方向相同.如果你想改变方向的话,比如想往下找,那么 / 完了直接回车就行了.表示再次使用上 ...

  3. C语言中简单的for循环和浮点型变量

    浮点型变量:常数中带有小数点的叫做浮点型 以下用for循环写一个摄氏度和华氏度的转换的C程序 [见 http://www.linuxidc.com/Linux/2013-08/88513.htm ] ...

  4. iOS.C

    iOS开发中C语言的应用: 1. NS_ENUM & NS_OPTIONS http://nshipster.com/ns_enum-ns_options/

  5. svn冲突问题解决办法

    经常有人会说,树冲突是很难解决的一类冲突,其实一旦了解了其原理,要解决也不难.先回顾下对于树冲突的定义.     树冲突:当一名开发人员移动.重命名.删除一个文件或文件夹,而另一名开发人员也对它们进行 ...

  6. BZOJ1179或洛谷3672 [APIO2009]抢掠计划

    BZOJ原题链接 洛谷原题链接 在一个强连通分量里的\(ATM\)机显然都可被抢,所以先用\(tarjan\)找强连通分量并缩点,在缩点的后的\(DAG\)上跑最长路,然后扫一遍酒吧记录答案即可. # ...

  7. [ES]ES集群内容灾

    ES是如何实现节点容灾的? 1. ES中的index,首先会进行分片,每一个分片数据一般都会有自己的副本数据,ES分配分片的策略会保证同一个分片数据和自己的副本不会分配到同一个节点上2. 当集群中的某 ...

  8. 尝试解决nginx的499错误1

  9. Asterisk的type类型和身份认证

    Asterisk的type类型和身份认证 转载:http://zeevli.blog.163.com/blog/static/119591610201111745012380/ 在Asterisk中对 ...

  10. ubuntu配置ftp server

    ubuntu配置ftp server 1. 安装vsftpd   sudo apt-get install vsftpd 安装后会自动新建一个用户ftp,密码ftp,作为匿名用户登录的默认用户 sud ...