首页 > 编程知识 正文

LaTeX 模板,latex参考文献排版

时间:2023-05-04 14:38:24 阅读:182756 作者:1973

实用的latex报告排版模板

经过大半年的latex报告排版以下是博主总结的latex报告排版模板在此备忘也分享给大家
通过清华大学开源软件镜像站下载texlive的安装程序,网址如下:
https://mirrors.tuna.tsinghua.edu.cn/ctan/systems/texlive/tlnet/
运行安装程序 运行安装程序 ,在命令行窗口输入 ,在命令行窗口输入 ,在命令行窗口输入 tex tex tex –v回车显示安装信息则说明软件成功;

documentclass[a4paper,11pt]{article}%[纸张,标题后新页,字体大小]{article类}usepackage{amsmath}%AMS 数学公式扩展usepackage{geometry}%自由设置页边距宏包usepackage{ctex}% 有这句话中文可以正常显示,否则不能usepackage{lineno}%PDF显示行号宏包 usepackage{xcolor}%设置字体颜色宏包usepackage{graphicx}%插入图片宏包usepackage{enumerate}%item编号格式宏包usepackage{multirow}%插入表格宏包usepackage{listings} %代码排版的宏包usepackage{float}%浮动体图片usepackage{cite}%引用参考文献usepackage{attachfile2}%插入附件宏包usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,urlcolor=black]{hyperref}%编译为带书签的pdf文件newcommand{ud}{mathrm{d}}%插入数学公式宏包usepackage{hyperref}%url定位到网页或者邮箱usepackage[colorlinks,linkcolor=blue]{hyperref}%url定位到网页或者邮箱title{标题}author{作者}geometry{left=2.5cm,right=2.5cm,top=3.0cm,bottom=2.5cm}%自由设置页边距begin{document}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%导言区设定好 lstlisting 环境所用的公共参数lstset{ basicstyle = sffamily, % 基本代码风格 keywordstyle = bfseries, % 关键字风格 commentstyle = rmfamilyitshape, % 注释的风格,斜体 stringstyle = ttfamily, % 字符串风格 flexiblecolumns, numbers = left, % 行号的位置在左边 showspaces = false, % 是否显示空格 numberstyle = zihao{-5}ttfamily, % 行号的样式,小五号,tt等宽字体 showstringspaces = false, captionpos = t, % 这段代码的名字所呈现的位置,t指的是top上面 frame = lrtb, % 显示边框}lstdefinestyle{C}{ language = C, % 语言选C basicstyle = zihao{-5}ttfamily, numberstyle = zihao{-5}ttfamily, keywordstyle = color{blue}, keywordstyle = [2] color{teal}, stringstyle = color{olive}, commentstyle = color{gray}ttfamily, breaklines = true, % 自动换行 columns = fixed, % 字间距固定 basewidth = 0.5em,}lstdefinestyle{JAVA}{ language = JAVA, % 语言选JAVA basicstyle = zihao{-5}ttfamily, numberstyle = zihao{-5}ttfamily, keywordstyle = color{blue}, keywordstyle = [2] color{teal}, stringstyle = color{olive}, commentstyle = color{gray}ttfamily, breaklines = true, % 自动换行 columns = fixed, % 字间距固定 basewidth = 0.5em,}lstdefinestyle{M}{ language = Matlab, % 语言选M basicstyle = zihao{-5}ttfamily, numberstyle = zihao{-5}ttfamily, keywordstyle = color{blue}, keywordstyle = [2] color{teal}, stringstyle = color{olive}, commentstyle = color{gray}ttfamily, breaklines = true, % 自动换行 columns = fixed, % 字间距固定 basewidth = 0.5em,}lstdefinestyle{TEX}{ language = Tex, % 语言选M basicstyle = zihao{-5}ttfamily, numberstyle = zihao{-5}ttfamily, keywordstyle = color{blue}, keywordstyle = [2] color{teal}, stringstyle = color{olive}, commentstyle = color{gray}ttfamily, breaklines = true, % 自动换行 columns = fixed, % 字间距固定 basewidth = 0.5em,}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%linenumbers%显示行号songti%输出字体为宋体maketitle%自动插入日期tableofcontents%添加目录newpage%另起一页thispagestyle{plain}%页面样式页脚正中显示页码%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%section{1}subsection{1.1}subsubsection{1.1.1}subsubsection{1.1.2}subsection{1.2}subsubsection{1.2.1}section{2}subsection{2.1}section*{2}%在大纲及目录不显示正文par%换行正文前\indent 正文后par%强制换行后缩进{color{red}红色字体par}begin{flushleft}(.............)end{flushleft}%左对齐语句,{flushrright为右对齐}ldots %插入符号(省略号)verb||%插入斜杠%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%插入普通项目begin{itemize}item 项目1paritem 项目2parend{itemize}%插入带编号项目begin{enumerate}%默认编号格式item aitem bitem cend{enumerate}begin{enumerate}[(1)]%自定义编号格式item aitem bitem cend{enumerate}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%插图结果如图(ref{Fig3.2.1.1}):par%引用标签begin{figure}[H]%在此插图可设置浮动体centering%居中includegraphics[width=11cm]{photo/3.2.1.1.png}%设置图大小相对地址引用caption{图注}%图注label{Fig3.2.1.1}%图标签end{figure}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%引用代码lstinputlisting[style = C]{ColdInputLatex/Code.c}parlstinputlisting[style = JAVA]{ColdInputLatex/Code.java}parlstinputlisting[style = M]{ColdInputLatex/Code.m}parlstinputlisting[style = TEX]{ColdInputLatex/Code.tex}par%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%插入公式正文$r_i=int_{-infty}^{y_i}{fleft( y right) dy}$正文%行内公式$$Nleft( mu ,sigma ^2 right)$$%行间公式公式(ref{e3.2.1.1})如下par%带标签公式begin{eqnarray}Nleft( mu ,sigma ^2 right)label{e3.2.1.1}end{eqnarray}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%插入网址链接详细参阅href{http://www.doc88.com/p-1761985525506.html}{gnaplot手册}url{http://www.doc88.com/p-1761985525506.html}。par%前为隐式连接,后为显示链接%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%插入表格begin{tabular}{|c|l|c|l|}%居中与左对齐hline%第一行multicolumn{4}{|c|}{基本信息} \%使用multicolumn{项数}{新列格式}{内容} 命令将一行中的几个不同的表格合并为一项hline%第二行第1列 & 第2列& 第3列& 第4列 \ hline%第三行第1列 & 第2列& 第3列& 第4列 \ hlineend{tabular}%插入带标签标注的表格XXX表如(ref{t3.2.1.1})所示:begin{table}[H]%在此处插入表格centering%居中caption{XXX}%表描述label{t3.2.1.1}%表标签begin{tabular}{|c|l|c|l|}%居中与左对齐hline%第一行multicolumn{4}{|c|}{基本信息} \%使用multicolumn{项数}{新列格式}{内容} 命令将一行中的几个不同的表格合并为一项hline%第二行第1列 & 第2列& 第3列& 第4列 \ hline%第三行第1列 & 第2列& 第3列& 第4列 \ hlineend{tabular}end{table}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%参考文献这里引用参考文献cite{3.2.1.1}begin{thebibliography}bibitem{3.2.1.1}%参考文献标签参考文献信息end{thebibliography}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%插入附件attachfile[author=XXX,color={[gray]{.5}},description=......,icon=PushPin]%author填写该附件作者姓名%color 设置附件图标的颜色。例如red,{[gray]{.5}}等,默认为{[rgb]{1,.9,8}},浅褐色%description 可用于填写该附件的简要说明%icon 附件图标样式,默认PushPin,另有Graph、Paperclip和Tag三个选项%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%end{document}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。