latex-排版(总结)

本文是对前面LaTeX论文排版文章的总结。前面的几篇文章是分别从论文的几个方面来讲述LaTeX的排版问题,这里综合了前面的内容,给出了论文排版的模版。
模版的使用:
1、首先建立一个main.tex文件,该文件用于管理论文的整体构架,文件代码为:
[plain]  view plain  copy
  1. \documentclass[a4paper,12pt]{book}  
  2. \usepackage{ctexcap}  
  3. \usepackage{amsmath}  
  4. \usepackage{graphicx}  
  5. \usepackage{fancyhdr}  
  6. \usepackage[super,square,comma,sort&compress]{natbib}%设置参考文献的格式  
  7. %%%设置页边距  
  8. \usepackage{geometry}  
  9. \geometry{left=4cm,right=2cm,top=3cm,bottom=2cm}  
  10. \newcommand{\tabincell}[2]{
    \begin{tabular}{@{}#1@{}}#2\end{tabular}\begin{tabular}{@{}#1@{}}#2\end{tabular}
    }% 设置换行  
  11. \graphicspath{{pics/},{figs/}}  
  12. \usepackage{float}%是图片悬浮  
  13.   
  14.   
  15. \usepackage{bm}  
  16. \usepackage{times}  
  17. \usepackage{mathptmx} %设置为罗马体  
  18. \usepackage{caption}  
  19. \captionsetup{labelsep=space}  
  20. %\usepackage[colorlinks,dvipdfm,  %电子版时使用这个包  
  21. %            bookmarksopenlevel=2,  
  22. %            pdfpagemode=UseNone,  
  23. %            pdfstartview=FitB,  
  24. %            linkcolor=black,  
  25. %            citecolor=blue,  
  26. %            linkcolor=black,  
  27. %            hyperindex=true,  
  28. %            pagebackref=true,  
  29. %            CJKbookmarks=true,  
  30. %            colorlinks]{hyperref}  
  31.   
  32. \renewcommand{\captionfont}{\zihao{5}\songti}  
  33. \renewcommand\theequation{\thechapter-\arabic{equation}}%公式编号  
  34. \usepackage{setspace}%使用间距宏包  
  35. \usepackage{comment}  
  36. \linespread{1.5}  
  37.   
  38. \CTEXsetup[beforeskip={0pt}]{chapter}  
  39. \CTEXsetup[nameformat={\heiti\zihao{3}\centering}]{chapter}%章标题格式  
  40. \CTEXsetup[titleformat={\heiti\zihao{3}\centering}]{chapter}%章标题格式  
  41. \CTEXsetup[format={\songti\zihao{4}\centering}]{section}% 节标题格式  
  42. \CTEXsetup[format={\songti\zihao{-4}}]{subsection}%小节标题格式  
  43. \CTEXsetup[format={\songti\zihao{-4}}]{subsubsection}%小节标题格式  
  44. \usepackage{titletoc}  
  45.   
  46. \begin{document}\songti\zihao{-4}%设置正文字体格式  
  47.   
  48.   
  49.   
  50. \pagenumbering{Roman}  
  51.   
  52. \include{Abstract}  
  53. \songti\zihao{-4}  
  54. \setcounter{tocdepth}{2}%设置目录深度  
  55. \thispagestyle{plain}  
  56. \titlecontents{chapter}  
  57.               [0.0em]  
  58.               {\songti\zihao{-4}\bfseries\addvspace{10bp minus 0bp}}  %\song  
  59.               {\thecontentslabel\hspace{0.5em}}  
  60.               {}  
  61.               {\normalfont\dotfill\textrm{\contentspage[{\bfseries\thecontentspage}]}}  
  62. \newgeometry{bottom=3cm,top=3cm}  
  63. \tableofcontents  
  64. \restoregeometry  
  65. %\include{chapter1}  
  66.   
  67. %\include{chapter2}  
  68. %\include{chapter3}  
  69. %\include{chapter4}  
  70. %\include{chapter5}  
  71.   
  72. %\include{thanks}  
  73. %\include{appendix}  
  74. %\include{reference}  
  75.   
  76. \end{document}  
    在上面的代码中,我将\include命令都给了注释,可以根据你论文的章节来去掉对应的%。比如说,我的论文有5章,还有致谢、附录和参考文献部分,则我需要将上面代码中include命令前的%去掉。同时,我需要新建chapter1.tex……chapter5.tex来编写1-5章的内容,thanks.tex对应致谢部分,appendix.tex对应附录部分,reference.tex对应参考文献部分。你可以根据实际情况来增、删、改相应的部分。
2、对于每一章的内容,大体形式如下(以第一章chapter1.tex的框架为例):
[plain]  view plain  copy
  1. \chapter{绪论}  
  2. \section{研究背景及意义}  
  3. \subsection{无线频谱的分配与利用}  
  4. \subsection{提高频谱利用效率的方法}  
  5. \section{认知无线电概述}  
  6. \subsection{认知无线电的定义}  
  7. \subsection{认知无线电的关键技术}  
  8. \subsection{国内外认知无线电的研究现状}  
  9. \section{论文内容及结构}  

在上面的每条命令语句下插入该标题的相关内容即可,效果显示如下图:

    到现在为止,LaTeX论文排版终于告一段落了,虽然这些文章只讲解了一些简单的问题,但是用来排版毕设论文已经足够了。离毕设答辩都过去半个多月了,由于比较忙,到现在才刚将关于论文排版的文章写完。说也惭愧,英语学习停止了大概一个多月了,下个月要将其补回来。BTW,前天举办了毕业典礼,有幸得到校长颁发学位证的机会,今天学院又进行了授位仪式,是真的要毕业了。

原文:http://blog.csdn.net/tengweitw/article/details/35570935

作者:nineheadedbird

猜你喜欢

转载自blog.csdn.net/qq_38294644/article/details/79963005