• LaTeX小范例


    LaTeX小范例

    作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/

        这篇博客给出一个关于LaTeX论文的小范例,包含了如何插入图片并设置图片大小,如何插入复杂表格(包括合并单元格,横线位置,列宽,总表格宽度,行间隔,表格一行里面文字太多需要另起一行,表格左下角注释等等),如何单独插入公式与在文本中插入公式,如何插入参考文献,如何引用文献或公式,如何插入网址等等。(自行忽略英文语法错误,只是做一个关于LaTeX的小模板)。更多LaTeX知识,参考:LaTeX常用链接与资料

    1. LaTeX

    documentclass{article}
    % 插入图需要加的包
    usepackage{graphicx} 
    % 插入表格需要的包
    usepackage{multirow}
    usepackage{threeparttable}
    
    ewcommand{	abincell}[2]{egin{tabular}{@{}#1@{}}#2end{tabular}} 
    % 插入公式需要的包
    usepackage{amsmath}
    % 引用,自己定义颜色
    usepackage[colorlinks, linkcolor=blue, anchorcolor=green, citecolor=red]{hyperref}
    % 超链接
    usepackage{url}
    % Author:凯鲁嘎吉 https://www.cnblogs.com/kailugaji/
    % 开始正文
    egin{document}
    % 标题
    	itle{A LaTeX Example}
    % 作者
    author{Kailugaji}  
    maketitle
    % 章节
    section{Model}
    This is an equation (
    ef{eq:1}) and the picture is shown in Fig. 
    ef{fig:1}, where $AB^2$ is xxxxx.
    % 公式
    egin{equation}
    	label{eq:1}
    	egin{aligned}
    		AB^2 = BC^2 + AC^2 
    	end{aligned}
    end{equation}
    
    subsection{Text}
    This is a table, which is shown in Table 
    ef{tab:1}, and this is a reference cite{ref:1}. 
    % 表格
    egin{table}
    	egin{threeparttable}
    	centering
    	caption{Blogs kailugaji}
    	setlength{	abcolsep}{5mm}{
    		egin{tabular}{ccccp{0.1mm}ccc}
    		hline 
    oalign{smallskip}
    		multirow{3}[4]{*}{Blogs} & multirow{3}[4]{*}{Lists} & multicolumn{2}{c}{Class1} &       & multicolumn{3}{c}{Class2} \
    		cline{3-4}cline{6-8}          &       & multirow{2}[2]{*}{	abincell{c}{E1\(f=0.4)}} & multirow{2}[2]{*}{	abincell{c}{E2\(f=0.5)}} &       & multirow{2}[2]{*}{E3} & multicolumn{1}{c}{multirow{2}[2]{*}{E4}} & multicolumn{1}{c}{multirow{2}[2]{*}{E5}} \
    		&       &       &       &       &       &       &  \
    		
    oalign{smallskip} hline 
    oalign{smallskip}
    		multirow{3}[1]{*}{A} & A1    & 1     & 3     &       & 2     & multirow{3}[1]{*}{--} & multirow{3}[1]{*}{--} \
    		& A2    & 2     & 4     &       & 0     &       &  \
    		& A3    & 5     & 9     &       & 7     &       &  \
    		
    oalign{smallskip}
    		multirow{3}[0]{*}{B} & B1    & multirow{3}[0]{*}{--} & multirow{3}[0]{*}{--} &       & multirow{3}[0]{*}{--} & 1     & 4 \
    		& B2    &       &       &       &       & 2     & 2 \
    		& B3    &       &       &       &       & 5     & 9 \
    		
    oalign{smallskip}
    		multirow{3}[0]{*}{C} & C1    & 8     & 4     &       & 8     & multirow{3}[0]{*}{--} & multirow{3}[0]{*}{--} \
    		& C2    & 3     & 6     &       & 3     &       &  \
    		& C3    & 2     & 1     &       & 5     &       &  \
    		
    oalign{smallskip} hline 
    		end{tabular}}
    		egin{tablenotes} 
    			item[1] xxxxxxxxx.
    			% item[*] xxxxxxxxx.
    		end{tablenotes} 
    		label{tab:1}
    		end{threeparttable}
    end{table}
    % 图片
    egin{figure}
    	centering
    	includegraphics[width=5cm]{1.png}
    	caption{Kailugaji}
    	label{fig:1}
    end{figure}	
    % 参考文献
    egin{thebibliography}{}
    ibitem{ref:1}
    Kailugaji, Blog about LaTex, Journal, Volume, page numbers (2020), url{https://www.cnblogs.com/kailugaji/}
    end{thebibliography}
    end{document}

    2. 结果

    3. 下载

        源文件与PDF文件:LaTex范例-凯鲁嘎吉.rar

  • 相关阅读:
    CentOS7使用集群同步脚本对文件同步分发
    CentOS7安装jdk1.8
    CentOS7+CDH5.12.1集群搭建
    nginx通配符
    Nginx反向代理及配置
    一些好玩有用的书签
    linux操作小技巧锦集
    系统压测结果对比:tomcat/thinkphp/swoole/php-fpm/apache
    python修改linux日志(logtamper.py)
    【原创】给定随机数的取值范围(最小值、最大值),且要求多次取得的随机数最后的结果有一个固定的平均值
  • 原文地址:https://www.cnblogs.com/kailugaji/p/13501262.html
Copyright © 2020-2023  润新知