用LaTeX写学校论文模板(四)目录的设置 |
您所在的位置:网站首页 › latex加目录 › 用LaTeX写学校论文模板(四)目录的设置 |
目录的设置
这应该是我最想吐槽的部分了!! 学校那么多规矩!不仅字体要求设置,而且还吃藕,竟然还要英文目录,直接抬走了我!! \RequirePackage[titles]{tocloft}利用的tocloft宏包,里面诸多设置。 主要是为了空两格用! \addtocontents{toc}{\protect\hypersetup{hidelinks}} %英语目录连接 \addtocontents{toe}{\protect\hypersetup{hidelinks}} %设置目录标题用 \newcommand\SDAUspace{\phantom{永永}} %要两个空格 \renewcommand\cftchapdotsep{0.5}%虚线间隔 \renewcommand{\cftdot}{$\cdot$} \renewcommand{\cftdotsep}{1.5} \renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}} \renewcommand{\cftchapdotsep}{\cftdotsep} \setlength{\cftbeforesecskip}{18pt}%章节间隔,节前18磅 \setlength{\cftbeforesubsecskip}{18pt}%章节间隔,小节节前18磅 \renewcommand\cftchapfont{\kaishu\zihao{-4}} \renewcommand\cftsecfont{\kaishu\zihao{-4}} \renewcommand\cftsubsecfont{\kaishu\zihao{-4}} %\renewcommand\cftchappagefont{\mdseries} \setlength\cftbeforetoctitleskip{18pt} % \setlength\cftaftertoctitleskip{18pt} \setlength{\cftsubsecindent}{0pt} %设置subsubsection不缩进 \setlength{\cftsecindent}{0pt} %设置section部分不缩进 \renewcommand{\cftchappagefont }{} %如何设置目录chap的page不加粗目录在完成后自行回生成一个toc文件,然后toc将条目一个一个加进去,生成了pdf,此外目录需要有链接,需要link,宏包的话就是 \RequirePackage{hyperref} 不过需要隐藏链接,上面应该看的相关代码! 由于我们学校论文模板比较特殊,可以看到,章、节、小节都不需要缩进,所以需要 \setlength{\cftsubsecindent}{0pt} %设置subsubsection不缩进 \setlength{\cftsecindent}{0pt} %设置section部分不缩进你大概可以理解成一个公式,\cft + {section;chapter等等} + 具体设置,具体就请参阅toc的宏包。里面很多详细设置。 就像这些 对于需要特殊加入参考文献的部分,可以这样定义: %致谢,附录,附件 \newcommand{\Thanks}{%将致谢添加到目录中 \cleardoublepage \addcontentsline{toc}{chapter}{\kaishu 致谢} \phantomsection \chapter*{致谢} \zihao{-4}\songti } \newcommand{\Appendix}{%将附录添加到目录中 \cleardoublepage %book类需要控制奇偶页 \addcontentsline{toc}{chapter}{\kaishu 附录} \phantomsection \renewcommand{\thechapter}{A}% \cleardoublepage \chapter*{附录} \zihao{-4}\songti }这里面 \addcontentsline{toc}{chapter}{\kaishu 致谢}这句话的作用就是放到目录页去,同理附录,由于是ctexbook,可能会导致超链接错误,可以参考这篇文章,可以参考 http://blog.sina.com.cn/s/blog_5e16f1770100lsl7.html 是小屋里面的内容。 同理参考文献也加进去 \addcontentsline{toc}{chapter}{参考文献} 英文目录
我把这个写成了一个单独的tex文件放在总文件夹下的chapter里面。像这样 就像这样,才会将章节加入英文目录中,同理,section和subsection。 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |