ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

实用的latex报告排版模板

2021-02-09 15:57:52  阅读:295  来源: 互联网

标签:ttfamily latex begin 1.1 usepackage color %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 排版 模板


实用的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        =   \rmfamily\itshape,  % 注释的风格,斜体
	    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 项目1\par
\item 项目2\par
\end{itemize}
%插入带编号项目
\begin{enumerate}%默认编号格式
	\item a
	\item b
	\item c
\end{enumerate}
\begin{enumerate}[(1)]%自定义编号格式
	\item a
	\item b
	\item c
\end{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}\par
\lstinputlisting
[style = JAVA]{ColdInputLatex/Code.java}\par
\lstinputlisting
[style = M]{ColdInputLatex/Code.m}\par
\lstinputlisting
[style = TEX]{ColdInputLatex/Code.tex}\par
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%插入公式
正文$r_i=\int_{-\infty}^{y_i}{f\left( y \right) dy}$正文%行内公式
$$N\left( \mu ,\sigma ^2 \right)$$%行间公式
公式(\ref{e3.2.1.1})如下\par%带标签公式
\begin{eqnarray}
N\left( \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列 \\  
\hline
\end{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列 \\  
\hline
\end{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}

标签:ttfamily,latex,begin,1.1,usepackage,color,%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%,排版,模板
来源: https://blog.csdn.net/weixin_43545253/article/details/113771562

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有