生活随笔
收集整理的這篇文章主要介紹了
实用的latex报告排版模板
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
實用的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}{\mathrmze8trgl8bvbq}%插入數學公式宏包
\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, % 語言選Cbasicstyle = \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, % 語言選JAVAbasicstyle = \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, % 語言選Mbasicstyle = \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, % 語言選Mbasicstyle = \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}
總結
以上是生活随笔為你收集整理的实用的latex报告排版模板的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。