latex各种宏包总结

各种宏包:

必备宏包:

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{float}
\usepackage{multirow}
\usepackage{array}

设置字号且book类型适合单面打印:

\documentclass[11pt, oneside]{book}

在目录中显示chapter:

\usepackage{titletoc}
\titlecontents*{chapter}% <section-type>
[0pt]% <left>
{\addvspace{1em}}% <above-code>
{\bfseries\chaptername\ \thecontentslabel\quad}% <numbered-entry-format>
{}% <numberless-entry-format>
{\bfseries\hfill\contentspage}% <filler-page-format>

页边距:

\usepackage{geometry}
\geometry{left=3.8cm, right=2.5cm, top=2.5cm, bottom=2.5cm}

取消段前空格:

\setlength{\parindent}{0pt}

显示section标号为x.x:

\renewcommand\thesubsection{\thesection.\arabic{subsection}}

设置字体:

\usepackage{fontspec}
\setmainfont{Arial}

设置全局行间距为1.5倍:

\renewcommand{\baselinestretch}{1.5}

引用的格式:

\bibliographystyle{IEEEtran}

chapter的格式:

\usepackage[Sonny]{fncychap}

页码置于最底部

\usepackage{fancyhdr}
\pagestyle{plain} % 此处为fancy时有页眉
\lfoot{}

插入图片路径:

\usepackage{graphicx}
\graphicspath{{figures/}, {pics/}}

设置图片、表格等标题的大小:

\usepackage{caption}
\captionsetup{font={scriptsize}}

关于标题:

\usepackage{titlesec}
\titleformat{\chapter}[block]{\LARGE \bfseries}{Chapter \arabic{chapter}}{1em}{}[]
\titlespacing{\chapter}{0pt}{-2pt}{2pt}
\titleformat{章节命令}[形状]{格式}{标题序号}{序号与标题间距}{标题前命令}[标题后命令]
\titlespacing*{章节命令}{左边距}{上文距}{下文距}[右边距]

将Book类型中的Bibliography改成Reference:

\renewcommand{\bibname}{Reference}

改变文献引用行距和字体大小:

\usepackage{setspace} 
\begin{spacing}{1.00} 
 	\small
	\bibliographystyle{IEEEtran}
 	\bibliography{cite}
\end{spacing}

插入左右排列的两张子图片:

\usepackage{subfigure}
\begin{figure}[H]
\centering
\subfigure[Accuracy rate without AE]{\includegraphics[width=2in]{convergence}}
\subfigure[Accuracy rate with AE]{\includegraphics[width=2in]{convergence_AE}}
\caption{Accuracy rate}
\label{accuracy_rate}
\end{figure}

插入附录:

\begin{appendices}
	\renewcommand{\thechapter}{\Alph{chapter}.}
	\chapter*{Appendix A - Calculation process in CONV layer}
	\begin{figure}[H]
		\centering
		\includegraphics[scale=0.5]{CONV}
		\caption{Calculation in CONV}\label{CONV}
	\end{figure} 
	\chapter*{Secondappendix}
	somemoretext
\end{appendices}

让参考文献出现在目录栏:

\begin{spacing}{1.00} 
 	\small
	\bibliographystyle{IEEEtran}
	\clearpage
 	\bibliography{cite}
\end{spacing}
\addcontentsline{toc}{chapter}{Reference} % 必须在spacing环境外

使 \section 的编号数字从 1 开始:

\renewcommand\thesection{\arabic {section}}
  • 19
    点赞
  • 148
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cofisher

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值