【LaTeX】

发布于:2025-04-12 ⋅ 阅读:(39) ⋅ 点赞:(0)

基本使用

\documentclass

类型:文章(article)、报告(report)、书(book)

中文的文章是ctexart,中文字体是UTF8

\documentclass[UTF8]{ctexart}

[]说明可以省略不写的意思,默认可选,{}是必须写的意思

/usepackage

写个公式,做个表格。放个图片

“宏包”,加了宏包才能够写公式,做表格,放图片

\usepackage{第一个宏包,第二个宏包,……}

比如说常用的有mathtools,amsmath,graphicx,array之类

\usepackage{mathtools,amsmath,graphicx,array}

在哪里写?

先建立一个“文档环境”,这个环境里面只来访文档内容,什么宏包和文档类型都在这个外面。

环境的建立方式是:

\begin{环境名字}

内容

\end{环境名字}

\documentclass{article}

\begin{document}
	Hello, world!
\end{document}

\documentclass和\usepackage都是“命令

\begin{document}   \end{document}是“环境”

用“\”开头(转义字符),说明是用来控制排版之类的

\documentclass[UTF8]{ctexart}    %我想写一篇文章
\usepackage{mathtools,amsmath,graphicx,array}    %我要写一篇文章啦
\begin{document}    %正在写一篇文章
文章内容
\end{document}

两行内容,中间空一行

\documentclass{article}

\begin{document}
	Hello, world!
	
	Bye!
\end{document}

开始写

文本

段与段之间需要空一行,这样才能让输出文本分段

关于字体的几个命令/环境:

加粗:\textbf{内容}

\documentclass{article}

\begin{document}
	Hello, world!
	\textbf{text}
	
	Bye!
\end{document}

 

字号:\normalsize  \large  \Large  \LARGE  \huge  \Huge

字号大小在一个环境内或者{}之间生效

\documentclass{article}

\begin{document}
	Hello, world!
	\textbf{
		text}
	
	\LARGE
	Bye!
\end{document}

\documentclass{article}

\begin{document}
	Hello, world!
	\textbf{
		text}
	
	\LARGE{
	Bye!
	}
	
	bye!
\end{document}

 

居中:\begin{center}  内容  \end{center}

\documentclass{article}

\begin{document}
	Hello, world!
	\textbf{
		text}
	
	\LARGE{
	Bye!
	}
	
	\begin{center}
		\huge
		bye!
	\end{center}

	bye!
\end{document}

 

文章标题与作者、日期

\title{标题名}

\author{作者名}

\data{日期}

\maketile

章节的划分

一级章节\section{章节名}

二级章节\subsection{章节名}

三级章节\subsubsection{章节名}

添加目录

\tableofcontents

摘要环境

\begin{abstract}

摘要内容

\end{abstract}

大小,页边距

列表环境

\begin{enemerate}

\item第一个

\item第二个

……

\end{enemerate}

公式

图表


网站公告

今日签到

点亮在社区的每一天
去签到