1、分为导言区和正文区
%导言区
\documentclass{article}%book,report,letter
%正文区(文稿区)
\begin{document}
hello
\end{document}
2、编译文档
注意:一个latex文件有且只有一个document 环境
%表示注释
3、通过更改documentclass 来更改封面。
如article改为book,report等
/document{article}%book,report,letter
%导言区主要用于全局设置,比如利用title输入文章的标题
\title{my first}
\author{YQ}
\date{\today}
%正文区(文稿区)
\begin{document}
\maketitle%对文章输入标题
hello
\end{document}
4、对于
符
号
里
面
的
是
数
学
内
容
,
符号里面的是数学内容,
符号里面的是数学内容,符号外面的是文本内容,如果是双$$符号表示数学公式另起一行
5、对于不同内容换行操作,通过在不同内容之间增加一行空行来实现
二、中文的设置
2、
3、
代码如下:
%导言区
\documentclass{article}%book,report,letter
\title{Study latex}
\author{YQ}
\usepackage{ctex}
\date{\today}
%正文区(文稿区)
\begin{document}
\maketitle
Hello world
你好呀
study latex,and day day up
\end{document}
4、产生带编号的公式
%正文区(文稿区)
\begin{document}
\maketitle
Hello world
你好呀
study latex,and day day up
\begin{equation}
a + b = c
\end{equation}
\end{document}
三、字体设置
在latex中,一个字体有五种属性
字体编码:
正文字体编码:OT1、T1、EU1等
数学字体编码: OML、OMS、OMX等
字体族:罗马字体 打字机字体,无衬线字体
字体系列;粗细,宽度
字体形状:直立斜体,伪斜体,小型大写
字体大小
%字体设置
\textrm{Roman Family} \textsf{Sans Serif Family}
\texttt{Typewriter Family}
\rmfamily Roman Family {\sffamily Sans Serif Family } {\ttfamily Typewriter Family}
其中大括号表示这个字体的声明范围
%字体系列设置(粗细,宽度)
\textmd{Medium Series} \textbf{Boldface Series}
{\mdseries Medium Series} {\bfseries Boldface Series }
```![在这里插入图片描述](https://img-blog.csdnimg.cn/74a25ff3a0324b8fa5f33675c6e969a2.png)
```python
%字体形状(直立、斜体、伪斜体、小型大写)
\textup{Upright shape} \textit{Italic shape}
\textsl{Slanted shape} \textsc{Small caps shape}
{\upshape Upright shape} {\itshape Italic shape}
{\slshape Slanted shape} {\scshape Small caps shape}
%导言区
\documentclass[12pt]{article}%book,report,letter
\title{Study latex}
\author{YQ}
\usepackage{ctex}
\date{\today}
%正文区(文稿区)
\begin{document}
\maketitle
%字体设置
\textrm{Roman Family} \textsf{Sans Serif Family}
\texttt{Typewriter Family}
\rmfamily Roman Family {\sffamily Sans Serif Family } {\ttfamily Typewriter Family}
%字体系列设置(粗细,宽度)
\textmd{Medium Series} \textbf{Boldface Series}
{\mdseries Medium Series} {\bfseries Boldface Series }
%字体形状(直立、斜体、伪斜体、小型大写)
\textup{Upright shape} \textit{Italic shape}
\textsl{Slanted shape} \textsc{Small caps shape}
{\upshape Upright shape} {\itshape Italic shape}
{\slshape Slanted shape} {\scshape Small caps shape}
%中文字体
{\songti 宋体} \quad{\heiti 黑体}
{\quad{\fangsong 仿宋}}
{\quad{\kaishu 楷书}}
中文字体的\textbf{粗体}与\textit{斜体}
%字体大小
{\tiny hello}\\
{\scriptsize hello}\\
{\footnotesize hello}\\
{\small hello}\\
{\normalsize hello}\\
{\large hello}\\
{\LARGE hello}\\
{\huge hello}\\
{\Huge hello}\\
%中文字号设置
\zihao{5} 吃饭
Hello world
你好呀
study latex,and day day up
\begin{equation}
a + b = c
\end{equation}
\end{document}