一份不太简短的LaTeX模板
编译环境:
- 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模板的更多相关文章
- 一份不太简短的LaTeX教程 lshort – A short introduction to LATEX 2elshort – A short introduction to LATEX 2e
Lshort started as a translation and rationalisation of a ground-breaking German-language i ...
- 【持续更新】一个简洁、易用的美赛LaTeX模板: easyMCM
目录 1 当前美赛模板通行情况的概述 2 easymcm宏包说明 2.1 与mcmthesis的关系之说明 2.2 easymcm宏包的简介 2.3 美赛模板下载地址 3 常见问题的解决方案 若您无意 ...
- 【持续更新】一个简洁、易用的美赛 LaTeX 模板: easyMCM
目录 1 当前美赛模板通行情况的概述 2 EasyMCM 宏包说明 2.1 与 mcmthesis 的关系之说明 2.2 easymcm宏包的简介 2.3 美赛模板下载地址 3 README 摘录 3 ...
- 山东大学硕士/博士研究生毕业论文--Latex模板
山东大学硕士/博士研究生毕业论文Latex模板 模板下载地址: https://github.com/Tsingke/SDU_thesis_template_for_postgraduate 封皮预 ...
- 国内大学毕业论文 LaTeX 模板集合
西北工业大学学位论文LaTeX模板 http://code.google.com/p/nwputhesis/ 西北工业大学硕博士论文LaTeX模版 http://code.google.com/p/n ...
- 国内大学毕业论文LaTeX模板集合
国内大学毕业论文LaTeX模板集合 薛瑞尼的清华大学学位论文LaTeX模板http://sourceforge.net/projects/thuthesis/ 北大论文文档 LaTeX 模板 pkut ...
- IEEE LaTeX模板使用BibTeX
IEEE LaTeX 模板使用 BibTeX 在Google Scholar获得的文献引用格式一般是BibTex的,而IEEE Transactions的模板默认用的是BibItem.目前没有什么自动 ...
- LaTeX模板 - FORMCM
LaTex 模板 - FORMCM \documentclass{mcmthesis} \mcmsetup{CTeX = true, % 使用 CTeX 套装时,设置为 true tcn = 8989 ...
- 定制一个支持中英文的简单LaTex模板
平常写汇报文档什么的,word排版有时还是比较费劲,遂定制一个简单的LaTex模板,中文默认为宋体,英文为LaTex默认字体,支持彩色高亮展示,有目录书签,有页眉展示,大致如下: LaTex代码如下: ...
随机推荐
- initialize flexnet service failed error code 50003
网络上下载回来的绿色版Xshell/Xftp在每次启动时都会报这个错,通过FlexNet Licensing Service 安装与卸载脚本了解到,程序 启动的时候会检查FlexNet Licensi ...
- Liunx Pwd
Linux中用 pwd 命令来查看”当前工作目录“的完整路径. 简单得说,每当你在终端进行操作时,你都会有一个当前工作目录. 在不太确定当前位置时,就会使用pwd来判定当前目录在文件系统内的确切位置. ...
- python下的MySQL数据库编程
https://www.tutorialspoint.com/python/python_database_access.htm if you need to access an Oracle dat ...
- Spring MVC 注解类型
Spring 2.5 引入了注解 基于注解的控制器的优势 1. 一个控制器类可以处理多个动作,而一个实现了 Controller 接口的控制器只能处理一个动作 2. 基于注解的控制器的请求映射不需要存 ...
- Linux renew ip command
$ sudo dhclient -r //release ip 释放IP$ sudo dhclient //获取IP Now obtain fresh IP:$ sudo dhcli ...
- Spring 系列教程之自定义标签的解析
Spring 系列教程之自定义标签的解析 在之前的章节中,我们提到了在 Spring 中存在默认标签与自定义标签两种,而在上一章节中我们分析了 Spring 中对默认标签的解析过程,相信大家一定已经有 ...
- Angular的一些用法或者结构技巧
如果有更好的方式,请留言交流: 2017-07-07 多个controller共用一个函数.在$rootScope中定义方法, $rootScope.share_fun = function test ...
- visual studio 修改注释快捷键,和断点
修改成alt+3和alt+4.效果不错 修改插入断点快捷键.这样按F12 就可以插入删除断点了.很爽 tab是批量加缩进 shift+tab 是批量减缩进
- 连接db2数据库出现No buffer space available (maximum connections reached?)
Caused by: javax.naming.NamingException: [jcc][t4][2043][11550][3.57.82] 异常 java.net.SocketException ...
- SpringMVC学习笔记:数据的接收与返回
SpringMVC的定义:Spring Web MVC is the original web framework built on the Servlet API and included in t ...