zoukankan      html  css  js  c++  java
  • 我常用的Latex中文报告模板(一)

    不得不说,使用Latex编写文档效率会提升很多。但是,如果没有好的模板,自己从零开始动手完成一份Latex文档还是得花费不少时间和精力的,所以,为了提高文档和技术报告的编写效率,我为自己准备了以下的Latex模板,并附图如下(注意,在Texlive中需要自己安装黑体(hei)和楷体(kai)等中文字体,具体安装方法我会在下一篇博客中介绍。

    \documentclass[a4paper, 11pt]{article}
    
    %%%%%% 导入包 %%%%%%
    \usepackage{CJKutf8}
    \usepackage{graphicx}
    \usepackage[unicode]{hyperref}
    \usepackage{xcolor}
    \usepackage{cite}
    \usepackage{indentfirst}
    
    %%%%%% 设置字号 %%%%%%
    \newcommand{\chuhao}{\fontsize{42pt}{\baselineskip}\selectfont}
    \newcommand{\xiaochuhao}{\fontsize{36pt}{\baselineskip}\selectfont}
    \newcommand{\yihao}{\fontsize{28pt}{\baselineskip}\selectfont}
    \newcommand{\erhao}{\fontsize{21pt}{\baselineskip}\selectfont}
    \newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont}
    \newcommand{\sanhao}{\fontsize{15.75pt}{\baselineskip}\selectfont}
    \newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont}
    \newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}\selectfont}
    \newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}\selectfont}
    \newcommand{\xiaowuhao}{\fontsize{9pt}{\baselineskip}\selectfont}
    \newcommand{\liuhao}{\fontsize{7.875pt}{\baselineskip}\selectfont}
    \newcommand{\qihao}{\fontsize{5.25pt}{\baselineskip}\selectfont}
    
    %%%% 设置 section 属性 %%%%
    \makeatletter
    \renewcommand\section{\@startsection{section}{1}{\z@}%
    {-1.5ex \@plus -.5ex \@minus -.2ex}%
    {.5ex \@plus .1ex}%
    {\normalfont\sihao\CJKfamily{hei}}}
    \makeatother
    
    %%%% 设置 subsection 属性 %%%%
    \makeatletter
    \renewcommand\subsection{\@startsection{subsection}{1}{\z@}%
    {-1.25ex \@plus -.5ex \@minus -.2ex}%
    {.4ex \@plus .1ex}%
    {\normalfont\xiaosihao\CJKfamily{hei}}}
    \makeatother
    
    %%%% 设置 subsubsection 属性 %%%%
    \makeatletter
    \renewcommand\subsubsection{\@startsection{subsubsection}{1}{\z@}%
    {-1ex \@plus -.5ex \@minus -.2ex}%
    {.3ex \@plus .1ex}%
    {\normalfont\xiaosihao\CJKfamily{hei}}}
    \makeatother
    
    %%%% 段落首行缩进两个字 %%%%
    \makeatletter
    \let\@afterindentfalse\@afterindenttrue
    \@afterindenttrue
    \makeatother
    \setlength{\parindent}{2em}  %中文缩进两个汉字位
    
    
    %%%% 下面的命令重定义页面边距,使其符合中文刊物习惯 %%%%
    \addtolength{\topmargin}{-54pt}
    \setlength{\oddsidemargin}{0.63cm}  % 3.17cm - 1 inch
    \setlength{\evensidemargin}{\oddsidemargin}
    \setlength{\textwidth}{14.66cm}
    \setlength{\textheight}{24.00cm}    % 24.62
    
    %%%% 下面的命令设置行间距与段落间距 %%%%
    \linespread{1.4}
    % \setlength{\parskip}{1ex}
    \setlength{\parskip}{0.5\baselineskip}
    
    %%%% 正文开始 %%%%
    \begin{document}
    \begin{CJK}{UTF8}{gbsn}
    
    %%%% 定理类环境的定义 %%%%
    \newtheorem{example}{例}             % 整体编号
    \newtheorem{algorithm}{算法}
    \newtheorem{theorem}{定理}[section]  % 按 section 编号
    \newtheorem{definition}{定义}
    \newtheorem{axiom}{公理}
    \newtheorem{property}{性质}
    \newtheorem{proposition}{命题}
    \newtheorem{lemma}{引理}
    \newtheorem{corollary}{推论}
    \newtheorem{remark}{注解}
    \newtheorem{condition}{条件}
    \newtheorem{conclusion}{结论}
    \newtheorem{assumption}{假设}
    
    %%%% 重定义 %%%%
    \renewcommand{\contentsname}{目录}  % 将Contents改为目录
    \renewcommand{\abstractname}{摘要}  % 将Abstract改为摘要
    \renewcommand{\refname}{参考文献}   % 将References改为参考文献
    \renewcommand{\indexname}{索引}
    \renewcommand{\figurename}{图}
    \renewcommand{\tablename}{表}
    \renewcommand{\appendixname}{附录}
    \renewcommand{\algorithm}{算法}
    
    
    %%%% 定义标题格式,包括title,author,affiliation,email等 %%%%
    \title{大规模分布式系统环境下的性能监测与跟踪调试工具的\\研究成果综述}
    \author{傅海平\footnote{电子邮件: haipingf@gmail.com,学号: 201128013229018}\\[2ex]
    \xiaosihao 中国科学院计算技术研究所\\[2ex]
    }
    \date{2012年5月}
    
    
    %%%% 以下部分是正文 %%%%  
    \maketitle
    
    \tableofcontents
    \newpage
    在此输入正文,中英文均可。
    \end{CJK}
    \end{document}

    希望对经常使用Latex编辑的同鞋有用:-)

  • 相关阅读:
    Visifire正式版(v1.1)发布
    [转]PSP机能强大!已能模拟运行WINDOWS系统?
    在Silverlight+WCF中应用以角色为基础的安全模式(一)基础篇之角色为基础的安全模式简介 Virus
    C#的加密解密算法,包括Silverlight的MD5算法 Virus
    MMORPG programming in Silverlight Tutorial (10)Implement the sprite’s 2D animation (Part IV)
    Game Script: Rescue Bill Gates
    MMORPG programming in Silverlight Tutorial (9)KeyFrame Animation
    MMORPG programming in Silverlight Tutorial (5)Implement the sprite’s 2D animation (Part II)
    MMORPG programming in Silverlight Tutorial (7)Perfect animation
    MMORPG programming in Silverlight Tutorial (3)Animate the object (Part III)
  • 原文地址:https://www.cnblogs.com/haippy/p/2507337.html
Copyright © 2011-2022 走看看