LaTeX 章节的使用

本文详细介绍了如何在LaTeX中使用section,subsection等命令创建并管理章节,包括自动生成编号、取消章节编号、引用其他章节的方法,以及使用label和ref实现内部链接。
摘要由CSDN通过智能技术生成

目录

1、介绍

2、章节的等级

3、取消编号章节

4、章节引用


1、介绍

命令\section{}标志着一个新章的开始,大括号内的文字为章的标题。章的编号是自动生成的,你也可以使用没有编号的章。

\documentclass[]{article}

\begin{document}
	
	\section{Introduction} \label{introduction}
	This is an introductory paragraph with some dummy text. This section will be referenced later.
	
	
	You can reference images; for instance, shows the \textit{Overleaf} logo.
	\vspace{0.5cm}
	
	\section{Math references} \label{mathrefs}
	As mentioned in section \ref{introduction}, different elements can be referenced within a document.

\end{document}

2、章节的等级

等级命令
-1\part{part}
0\chapter{chapter}
1\section{section}
2\subsection{subsection}
3\subsubsection{subsubsection}
4\paragraph{paragraph}
5\subparagraph{subparagraph}

一般来说,\section是最高的等级。对于 report、book等类型,\chapter\part是最高的等级。

3、取消编号章节

取消某个章节的编号,在命令的大括号前加一个星号 “ * ” 即可。(这些章节不会显示在目录中)

\documentclass[]{article}

\begin{document}
	
	\section*{Introduction} \label{introduction}
	This is an introductory paragraph with some dummy text. This section will be referenced later.
	
	
	You can reference images; for instance, shows the \textit{Overleaf} logo.
	\vspace{0.5cm}
	
	\section{Math references} \label{mathrefs}
	As mentioned in section \ref{introduction}, different elements can be referenced within a document.

\end{document}

4、章节引用

使用\label\ref命令来创建引用。在\section命令之后使用\label命令(即应该在章的编号被创建之后来使用\label命令)。这个方法对chapters、subsections 以及 subsubsections 都有效。

\documentclass[]{article}

\begin{document}
	
	\section{Introduction} \label{introduction}
	This is an introductory paragraph with some dummy text. This section will be referenced later.
	
	
	You can reference images; for instance, shows the \textit{Overleaf} logo.
	\vspace{0.5cm}
	
	\section{Math references} \label{mathrefs}
	As mentioned in section \ref{introduction}, different elements can be referenced within a document.

\end{document}

注:命令\pageref会插入元素(对应所使用的\label)所在的页数,即引用元素所在页。

  • 7
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

清纯世纪

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

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

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

打赏作者

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

抵扣说明:

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

余额充值