-
2021-05-20 20:35:28更多相关内容
-
LaTex目录管理
2022-03-03 16:31:32Latex,目录,标题LaTex生成章节,图片,表格目录
章节目录
在latex中,每个章节都由特定的关键字命令定义,如:“\section{},subsection{},subsubsection{}等”,利用这些关键字,我们可以生成文章的章节结构,并根据这些章节的结构和标题生成章节目录。
普通章节定义
章节定义:
\section{一级标题名} \subsection{二级标题名} \subsubsection{三级标题名} ...
隐藏章节定义
如果希望某一个章节拥有章节的格式,但是并不对其进行编号,也不放进章节目录中,则可以在定义章节时,在关键字和标题名之间加上’*’。
\section*{一级标题名} \subsection*{二级标题名} \subsubsection*{三级标题名} ...
章节目录生成
\tableofcontents
示例:
\documentclass[UTF8]{article} \usepackage{ctex} \begin{document} \title{Chapter Directory} \author{Qltan} \maketitle \tableofcontents \section{Section1} Section1 contents \subsection{Subsection1.1} Subsection1.1 contents \subsubsection{Subsection1.1.1} Subsection1.1.1 contents \subsubsection*{Subsection1.1.2} Subsection1.1.2 contents \subsection{Subsection1.2} Subsection1.2 contents \section{Section2} \subsection{Subsection2.1} Subsection2.1 contents \subsection*{Subsection2.2} Subsection2.2 contents \subsection{Subsection2.3} Subsection2.3 contents \section*{Section3} \subsection{Subsection3.1} Subsection3.1 contents \end{document}
插图目录(索引)
在文章中插入图片后,使用“\listoffigures”可以在文章中自动生成插图索引。
示例:\documentclass[UTF8]{article} \begin{document} \listoffigures \begin{figure}[!htp] \centering \fbox{ figure 1} \caption{The detail in figure 1, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \begin{figure}[!htp] \centering \fbox{ figure 2} \caption{The detail in figure 2, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \begin{figure}[!htp] \centering \fbox{ figure 3} \caption{The detail in figure 3, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \end{document}
效果:
上面生成的目录还存在一些问题,比如:“目录名称不合适”,“目录中图片标题太长”。针对这两个问题,我们可以采用如下方法:修改插图目录的名称
使用命令“\renewcommand{\listfigurename}{Figures}”来修改插图目录的名称(此命令需要放在“\begin{document}”之前!),此命令会使用“Figures”替代“List of Figures”。
示例:\documentclass[UTF8]{article} \renewcommand{\listfigurename}{Figures} \begin{document} \listoffigures \begin{figure}[!htp] \centering \fbox{ figure 1} \caption{The detail in figure 1, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \begin{figure}[!htp] \centering \fbox{ figure 2} \caption{The detail in figure 2, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \begin{figure}[!htp] \centering \fbox{ figure 3} \caption{The detail in figure 3, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \end{document}
效果:
修改插图目录中的插图标题
在插入图片时,若直接使用“\caption{图片标题}”来定义图片的标题,则插图目录会默认使用此标题。而有时图片下方的标题会包含一些图片内容的细节解释,会让标题变的冗长,导致目录太长,不美观。此时,若想让目录中只包含简单的图片标题,而在图片下方的标题包含细节解释,则需要使用“\caption[图片标题]{包含图片细节的标题}”来定义图片标题。
示例:\documentclass[UTF8]{article} \renewcommand{\listfigurename}{Figures} \begin{document} \listoffigures \begin{figure}[!htp] \centering \fbox{ figure 1} \caption[The title of figure 1]{The detail in figure 1, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \begin{figure}[!htp] \centering \fbox{ figure 2} \caption[The title of figure 2]{The detail in figure 2, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \begin{figure}[!htp] \centering \fbox{ figure 3} \caption[The title of figure 3]{The detail in figure 3, which contains many special symbols and content details, is usually long and takes up multiple lines.} \end{figure} \end{document}
效果:
表格目录
和插图索引类似,在文章定义好表格之后,只需要使用“\listoftables”命令即可自动生成表格目录。
示例:\documentclass[UTF8]{article} \begin{document} \listoftables \begin{table}[h] \renewcommand{\arraystretch}{1.5} \caption{table 1} \centering \begin{tabular}{|c|c|} \hline a & b\\ \hline c & d\\ \hline \end{tabular} \end{table} \begin{table}[h] \renewcommand{\arraystretch}{1.5} \caption{table 2} \centering \begin{tabular}{|c|c|} \hline a & b\\ \hline c & d\\ \hline \end{tabular} \end{table} \begin{table}[h] \renewcommand{\arraystretch}{1.5} \caption{table 3} \centering \begin{tabular}{|c|c|} \hline a & b\\ \hline c & d\\ \hline \end{tabular} \end{table} \end{document}
效果:
修改表格目录标题的命令为“\renewcommand{\listtablename}{Tables}”,设定表格目录中的标题也和插图目录类似。参考资料:
章节目录隐藏:https://jingyan.baidu.com/article/e8cdb32b3b2bee37052bade7.html
插图目录标题:http://blog.sina.com.cn/s/blog_5e16f1770100g5a3.html -
Latex:目录和标题
2022-05-09 17:47:27参考:LaTeX目录定制——titlecontents - 简书 (jianshu.com) Example: \tableofcontents \titlecontents{subsection}{3em}{}% %3em设置subsection 与section 文字开始的水平距离 {\contentslabel{3.25em}}% %3.25...0、基本概念介绍
- 标题一般有三个部分组成:标签+间隔+标题文字
标签label即序号,例如“1. 这是一个标题”中的“1.”就是label
- 章节分为以下几个层级
- -1 part
- 0 chapter
- 1 section
- 2 subsection
- 3 subsubsection
- 4 paragraph
- 5 subparagraph
不同的文章类型,包含不同的层级。article最高层级为section
1、设置目录的格式
package: titletoc
command: titlecontents
\titlecontents{标题名}[左间距]{标题格式}{标题标志}{无序号标题}{指引线与页码}[下间距]
- 标题名 设置所需修改的某一层次标题格式的标题名,如chapter、section等层次标题名,或是table和figure图表标题名
- 左间距 可选参数,不能省略
- 标题格式 设置标题的整体格式,如字体、字体尺寸、与上一个标题的垂直距离等。该参数可空置。
- 标题标志 设置标题标志的格式,如序号格式、序号宽度、序号与标题内容之间的间距等。该参数不能空置, 否则标题将无标题标志。
- 无序号标题 设置无序号标题的格式, 如字体、字体尺寸等。 该参数可以空置
- 指引线与页码 设置标题与页码之间的指引线样式以及页码的格式, 该参数如果空置,标题将无指引线和页码。
- 下间距 可选参数, 用于设置标题排版后还需要执行的命令, 例如与下个标题的垂直间距等。该参数常被省略。
参考:LaTeX目录定制——titlecontents - 简书 (jianshu.com)
Example:
\tableofcontents \titlecontents{subsection}{3em}{}% %3em设置subsection 与section 文字开始的水平距离 {\contentslabel{3.25em}}% %3.25em设置的是序号label和标题文字之间的距离 {}% {\titlerule*[0.5pc]{.}\contentspage}{} %设置的是显示页数的格式为"..........8"
2、设置标题的格式
package: titlesec
command: titleforamt
\titleformat{command}[shape]{format}{label}{sep}{before}[after]
- command 是要重新定义的各种标题命令,比如 \part,\chapter,\section,\s section,\s s section,\paragraph,\subparagraph等;
- shape 是用来设定段落形状的,可选的参数有hang、block、display等,详见 titlesec 文档;
- format 用于定义标题外观,比如使标题居中、字体加粗等;
- label 用于定义定义标题的标签,就是标题内容前面的标号;label中使用thesection, thechapter等表示默认的序号。[用于修改编号格式]
- sep 定义标题的标签与标题内容之间的间隔距离;
- before 用于在标题内容前再加些内容;
- after 用于在标题内容后再加些内容。
Example:
\titleformat{\chapter}{\centering\Huge\bfseries}{第\,\thechapter\,章}{1em}{}
format参数将章标题设置为居中(\centering)显示、字号为 \Huge,字体被加粗显示\bfseries ; label 参数将标题的标签设置为 “第 xxx 章”格式;sep 参数设置标签与标题内容之间以一个字(1em)的宽度为间隔。
当采用该方式设置标题格式时,所有层级均需要设置,否则latex会出现错误
参考链接:LaTeX使用titlesec宏包改变章节编号形式的方法 - 阿拉果 - 博客园 (cnblogs.com)
3、设置目录和标题的层级
3.1 设置目录的层级
\setcounter{tocdepth}{数字}
例如当数字设置为2时,3级及其以下的层级不会显示
3.2 设置标题计数的层级
\setcounter{secnumdepth}{数字}
当数字设置为2时,3级以及3级一下的层级不会显示编号,目录中也不会显示编号
4、设置文档标题均不显示序号
-
方案一【failed】
\setcounter{secnumdepth}{0}
该方式虽然可以去除全文(正文标题,目录,书签)的编号,但是会出现点击目录和书签无法跳转的情况。猜想该命令设置后不显示编号的章节,实际上应该是已经将这些标题不作为一个节点计数了,而不是简单隐藏了编号,所以目录和书签无法定位。
但是在实际操作过程中也有部分章节可以跳转,观察后发现这些章节的前一个章节中一般都有图表或是列表,不太明白原理。
-
方案二
对目录,正文标题、书签分别设置不显示编号。
- 目录:{标题标志}和{无序号标志}都置空
- 正文标题:label置空,before置0
- 书签:bookmarksnumbered置false
Example:
\tableofcontents \titlecontents{subsection}{1em}{}% {}% {}% {\titlerule*[0.5pc]{.}\contentspage}{} %设置的是显示页数的格式为"..........8" \titleformat{\chapter}{\centering\Huge\bfseries}{}{0em}{}
Appendix-Example:
设置章节无编号,且上方有一条分割线
\titleformat{\chapter}{color{green}\titlerule[2pt] \color{black} \centering\Huge\bfseries}{}{0em}{}
-
LaTeX目录居中及目录字体设置
2022-02-19 17:17:29% 目录字体设置 \usepackage{subfigure} \usepackage[subfigure]{tocloft} \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} % 目录后一行连续的点\renewcommand{\cftsecfont}{\rmfamily} \renewcommand{\...% 目录字体设置 \usepackage{subfigure} \usepackage[subfigure]{tocloft} \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} % 目录后一行连续的点 \renewcommand{\cftsecfont}{\rmfamily} \renewcommand{\cftsecpagefont}{\rmfamily} % 目录居中 \renewcommand*\contentsname{\hfill Contents \hfill}
-
LaTeX技巧907:目录与格式定制
2021-01-14 15:28:19本期的主要内容有:目录的生成与定制章节标题格式的定制版面大小的定制页面风格的定制中间还会穿插介绍一些页面控制的命令。 ---目录的生成与定制我们需要给它们来一个集合,就是制作目录。制作目录其实非常简单,只... -
latex 目录层次设置
2019-11-24 22:14:23https://blog.csdn.net/golden1314521/article/details/39926135 -
LaTex 页码设置 目录页空页码
2019-05-13 18:28:41latex 默认从起始页编页码。...设置目录页为空页码,且从后 1开始编页码如下: \tableofcontents # 生成目录 \thispagestyle{empty} # 目录页不显示页码 \newpage \setcounter{page}{1} # 从下面开始编页码 ... -
Latex | 添加带链接的目录
2020-07-13 21:14:03在latex中添加带有链接的目录页,可以用hyperref package完成: # import package \usepackage{hyperref} # setting \hypersetup{ colorlinks, citecolor=black, filecolor=black, urlcolor=black } \title{... -
latex插入目录
2022-01-17 19:36:23在你想要插入目录的地方加上这两句话即可: \tableofcontents \newpage -
LaTeX 学位论文排版 章节目录设置
2019-06-12 11:10:14一般学位论文使用的是book排版,我们这里介绍三级标题格式的设置以及生成目录的方式,具体要求和实现方式如下。 前言部分:中英文摘要+目录 使用小写罗马字母格式进行页面编号 正文部分:第一章、第二章…… 后记... -
Latex 插入目录 设置首页页码为空
2020-09-17 18:02:54插入目录 \begin{document} \maketitle \tableofcontents \newpage # 从下一页开始 \end{document} \maketitle \tableofcontents \textbf{\ \\ \\ \\ \\ \\ $*$ means that it is a supplementary ... -
LaTeX的字体设置
2022-02-02 16:48:35文章目录字体族设置字体系列设置字体形状中文字体字体大小中文字号 字体属性 在LaTeX中,一个字体有5种属性。 字体编码 正文字体编码:OT1、T1、EU1等 数学字体编码:OML、OMS、OMX等 字体族 罗马字体:笔画... -
LaTeX目录只显示一级标题
2022-06-08 12:09:40今天在编写LaTeX模板的时候,有一个LaTeX模板目录上面的样式调整需求,目录内只显示一级标题。 调整前的样子: 调整后的样子: 我们项目内一共自动标题设置了三级 一级、二级、三级标题分别是 chapter section ... -
Latex 设置目录深度
2019-05-25 12:27:45导言区添加: ...tocdepth:设置在 ToC 的显示的章节深度 secnumdepth:设置章节的编号深度 两者可选的设置值如下: num mean -1 part 0 chapter 1 section 2 subsection 3 subsubsect... -
LaTeX字体设置
2021-03-29 16:43:18LaTeX字体设置 文章转发自 简书-野狗子嗷嗷嗷 \setCJKmainfont 设置 CJK 主字体,也就是设置 \rmfamily 的 CJK 字体 \setCJKsansfont 设置 CJK 无衬线的字体,也就是设置 \sffamily 的 CJK 字体 \setCJKmonofont ... -
LaTex学习笔记——目录的制作
2021-09-11 10:15:42当制作的文档页数较多时,往往大家翻页找内容十分不方便,那么LaTex如何制作目录呢?并且点击目录可以跳转到对应页数。 源代码 \documentclass{article} \usepackage{ctex} \usepackage[hidelinks]{hyperref}%目录... -
1.3 Latex页眉页脚设置
2022-05-27 15:52:08介绍了LaTex页眉页脚的设置 -
Latex设置字体颜色
2022-03-10 15:38:55设置字体颜色: \textcolor{red/blue/green/black/white/cyan/magenta/yellow}{text} 设置字体背景颜色: \colorbox{red/blue/green/black/white/cyan/magenta/yellow}{text} text为自己的文本。 -
LaTeX目录定制
2014-10-09 10:49:08最常用的目录格式设置命令如下: \titlecontents{标题名}[左间距]{标题格式}{标题标志}{无序号标题}{指引线与页码}[下间距] 标题名 设置所需修改的某一层次标题格式的标题名,如chapter、section等... -
LaTeX页码设置
2019-11-26 19:49:48默认情况下,LaTeX会在每个页面的底部生成一个页码编号,即使是...本文接下来介绍了LaTeX中基本的页码设置。 页码设置相关的命令 在LaTex中,与页码和页面设置相关的命令有\pagestyle{type},\thispagestyle{type}... -
LaTeX目录格式控制
2021-01-27 04:21:29章节结构控制 章节层次 一个文档的最高层章节可以是part,也可以没有part直接是chapter/section。除了part以外,只有在上一层章节存在时,才可以使用下一层章节。... 设置章节格式参考毕业论文LaTeX模板。 -
【LaTeX教程】4.LaTeX的字体字号设置
2021-01-27 21:15:15【LaTeX教程】4.LaTeX的字体字号设置 【LaTeX教程】5.LaTeX文档的基本结构 【LaTeX教程】6.LaTeX中的特殊字符 【LaTeX教程】7.LaTeX中的插图 【LaTeX教程】8.LaTeX中的表格 【LaTeX教程】9.LaTeX数学公式初步 ... -
latex—中文目录乱码
2021-11-23 21:23:14先下载gbk2uni工具 ...高级设置—>环境变量—>系统变量—>Path—>新建—>D:\gbk2uni (注意:添加完一定要点确定!) latex配置 找到Options—>Options Interface—>Menus and T -
latex 图片相关设置
2021-04-20 15:09:27latex 图片相关设置 基本格式: \begin{figure}[图片位置设置] 图片格式(左对齐,居中,右对齐等) \includegraphics[图片大小]{图片存放位置} \twofiguretitle{\kaishu \wuhao 中文名}{\wuhao英文名} \label{标签}... -
LaTeX 中表格和图片的目录
2020-11-03 12:41:43表格和图片的目录可以让读者快速定位文档中某些特定的内容。本篇文章介绍如何在文档中创建图片或表格的目录,以及如何改变目录的默认标题。 -
LaTex 解决目录红框问题
2021-05-17 21:08:17先导入包 \usepackage{hyperref} 在文档的前面加上如下代码就解决了,意思是设置链接的颜色: \hypersetup{ colorlinks=true, linkcolor=black } -
LaTex创建四级目录
2020-11-21 14:03:02默认情况下,目录的深度是3级。也就是说,对于 ctexart/article 文类,只对 section,subsection,subsubsection 编目。如果你的文档结构用到了 paragraph 一级,那么它将不会被编入目录中。 但是只要你愿意,它也是... -
LaTex 解决目录红框
2019-05-24 20:45:41LaTex 使用 \usepackage{hyperref} 默认生成的目录 会显示 红框 在文档的前面加上如下代码就解决了,意思是设置链接的颜色: \hypersetup{ colorlinks=true, linkcolor=black } ... -
latex 设置行间距
2021-01-17 17:02:31LaTeX页面布局专题——版面设置_理学_高等教育_教育专区。o LaTeX 页面布局专题——版面设置 LaTeX 页面布局专题——页眉和页脚 LaTeX 页面布局专题——装订线 LaTeX......断行:段落之间空一行; ?空行:\\\\ \\\\ ?...