编译环境:

  • 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. mysql5.7 生成列 generated column

    生成列的值是根据列定义中的表达式计算得出的. mysql5.7支持两种类型的生成列: 1.virtual 生成列:当从表中读取记录时,才计算该列值.不会把数据持久化在硬盘上. 2.stored 生成列 ...

  2. Oracle管理表空间和数据文件详解

    介绍 表空间是数据库的逻辑组成部分 从物理上将:数据库数据存放在数据文件中 从逻辑上将:数据库则是存放在表空间中 表空间由一个或是多个数据文件组成 数据库的逻辑结构 介绍: Oracle中逻辑结构包括 ...

  3. linux 压缩命令

    .zip格式压缩 zip 压缩文件名 源文件     压缩文件 zip -r 压缩文件名 源目录    #压缩目录 .zip格式解压缩 unzip 压缩文件     #解压缩 .gz格式压缩 gzip ...

  4. Liunjx 文件

    cat命令的用途是连接文件或标准输入并打印.这个命令常用来显示文件内容,或者将几个文件连接起来显示,或者从标准输入读取内容并显示,它常与重定向符号配合使用. 1.命令格式: cat [选项] [文件] ...

  5. 简单使用DESeq做差异分析

    简单使用DESeq做差异分析 Posted: 五月 06, 2017  Under: Transcriptomics  By Kai  no Comments DESeq这个R包主要针对count d ...

  6. vim窗口切换

    参考资料: http://www.cnblogs.com/litifeng/p/8282479.html 当用vim写代码的时候,我喜欢一边看着头文件中结构的定义,一边编写实现的代码,这样就经常用到多 ...

  7. cron Linux下的定时执行工具

    说明:测试平台  Ubuntu 16.04.4 LTS cron是一个Linux下的定时执行工具,可以在无需人工干预的情况下运行作业.所以,在Linux中,周期性执行的任务一般由cron这个守护进程来 ...

  8. gensim_主题提取

    # https://blog.csdn.net/whzhcahzxh/article/details/17528261# gensim包中引用corpora,models, similarities, ...

  9. openssl RSA基本加密解密

    #include <stdio.h> #include <string.h> #include <stdlib.h> #include <openssl/bn ...

  10. 浅谈System.gc()

      今天巩固给大家讲讲System.gc().Java的内存管理着实给各位编程者带来很大的方便,使我们不再需要为内存分配烦太多神.那么讲到垃圾回收机制,就不得不讲讲System.gc().   先简单 ...