LaTeX系列1——主结构

初学,可交流,轻喷

复制代码
\documentclass{book}
\begin{document}
\title{Book Title}
\author{Author Name}
\date{\today}
\maketitle

\chapter{Introduction}
This is the introduction chapter of the book.

\section{First Section}
The first section of the book.

\subsection{Subsection}
A subsection within the first section.

\chapter{Another Chapter}
Another chapter in the book.

\end{document}
\chapter{Methodology}
The methodology is explained in this chapter.

\chapter{Conclusion}
In conclusion, the report summarizes key findings.

\end{document}

以上是用LaTeX去排版一本书

格式规范为:'\命令名{命令参数}'

其中有以下几行重要代码:

1.在文档的最前面要用\documentclass{}来指定文档类型,会根据指定的文档类型形成特定的整体布局和格式等(如默认页边距,页眉页脚等)

\documentclass{book} 即为将文档类型定义为Book

2.\begin{document}和\end{document}

首先\begin{}和\end{}是一对命令,用于定义一个环境,在一个环境中可以指定统一的格式或功能

这些环境用于创建不同的元素,如正文、列表、数学公式等,使用\begin{}和\end{}对文档的不同部分进行划分和控制

\begin{document}和\\end{document}意味着对整个文档进行控制

3.\title{Book Title}

\author{Author Name}
\date{\today}
\maketitle

前三行用于指定封面的标题,作者信息和日期

\maketitle指根据信息生成封面,如果没有这行信息,即使有标题作者和时间也不会生成封面

4.\maketitle和\begin{document}的位置关系

\begin{document}要在\maketitle之前,可以理解为封面也属于文档的内容

所以\begin{document} 和 \title{Book Title}

\title{Book Title} \author{Author Name}

\author{Author Name} \date{\today}

\date{\today} \begin{document}

\maketitle \maketitle

以上两种写法都是正确的

5.\chapter表示一级标题,\section表示二级标题,\subsection表示三级标题,\subsubsection表示四级标题?

对于documentclass为book的文档来说是的,但对于其他文档类型不一定,如\documentclass{article}时,\section{}为一级标题,\subsection{}为二级标题,\subsubsection{}为三级标题

相关推荐
我是伪码农5 小时前
Vue 1.23
前端·javascript·vue.js
毕设源码-郭学长10 小时前
【开题答辩全过程】以 基于Web的高校课程目标达成度系统设计与实现为例,包含答辩的问题和答案
前端
wuhen_n10 小时前
高阶函数与泛型函数的类型体操
前端·javascript·typescript
ヤ鬧鬧o.12 小时前
多彩背景切换演示
前端·css·html·html5
lethelyh12 小时前
Vue day1
前端·javascript·vue.js
酉鬼女又兒12 小时前
SQL113+114 更新记录(一)(二)+更新数据知识总结
java·服务器·前端
无风听海12 小时前
AngularJS中 then catch finally 的语义、执行规则与推荐写法
前端·javascript·angular.js
利刃大大12 小时前
【Vue】组件化 && 组件的注册 && App.vue
前端·javascript·vue.js
一起养小猫12 小时前
Flutter for OpenHarmony 实战:按钮类 Widget 完全指南
前端·javascript·flutter
css趣多多12 小时前
Vux store实例的模块化管理
前端