学习Latex时的第一个tex内容
学习视频为https://www.bilibili.com/video/BV1S741127Sg/https://www.bilibili.com/video/BV1CtfMBGEPp/环境的语法结构最完整的结构\begin{环境名}[参数列表]内容\end{环境ming}简化版本一般在行内使用\环境名[参数列表]{内容…}最简化版本(一般单独为一行时使用)\环境 内容%!Mode::TeX:UTF-8\documentclass[11pt,a4paper,UTF8]{article}%这里是增加对中文的支持\usepackage{ctex}\usepackage{amsmath,amscd,amsbsy,amssymb,latexsym,url,bm,amsthm}\usepackage[vlined,boxed,commentsnumbered,ruled]{algorithm2e}\usepackage{epsfig,graphicx,subfigure}\usepackage{enumitem,balance,mathtools}\usepackage{wrapfig}\usepackage{mathrsfs, euscript}\usepackage{xcolor}\usepackage{hyperref}\usepackage{caption}\usepackage{lipsum}\usepackage{float}\usepackage{verbatim}\newtheorem{theorem}{Theorem}\newtheorem{lemma}{Lemma}\newtheorem{proposition}{Proposition}\newtheorem{corollary}{Corollary}\newtheorem{exercise}{Exercise}\newtheorem*{solution}{Solution}\renewcommand{\thefootnote}{\fnsymbol{footnote}}\newcommand{\postscript}[2]{\setlength{\epsfxsize}{#2\hsize}\centerline{\epsfbox{#1}}}\renewcommand{\baselinestretch}{1.0}\setlength{\oddsidemargin}{-0.365in}\setlength{\evensidemargin}{-0.365in}\setlength{\topmargin}{-0.3in}\setlength{\headheight}{0in}\setlength{\headsep}{0in}\setlength{\textheight}{10.1in}\setlength{\textwidth}{7in}\makeatletter\renewenvironment{proof}[1][Proof]{\par\pushQED{\qed}\normalfont\topsep6\p\plus6\p\relax\trivlist\item[\hskip\labelsep\bfseries#1\addpunct{.}]\ignorespaces}{\popQED\endtrivlist\endpefalse} \makeatother\makeatletter\renewenvironment{solution}[1][Solution]{\par\pushQED{\qed}\normalfont\topsep6\p\plus6\p\relax\trivlist\item[\hskip\labelsep\bfseries#1\addpunct{.}]\ignorespaces}{\popQED\endtrivlist\endpefalse} \makeatother\title{\LaTeX 初体验}\author{小杜}\date{2026年3月4日}%ctrl k 删除一行 %\noindent:改标签以下都取消缩进 %空行一段文字 或\par一个段落行首会强制缩进 %段内换行使用\\或\newline %[H][H]表示在这里加了[H]的结构能更好的从编码顺序进行展示\begin{comment}导入\usepackage{verbatim}这是一个多行注释结构\end{comment}%开始文档\begin{document}\noindent %生成首页\maketitle\begin{comment}内容...\end{comment}%生成摘要\begin{abstract}%\LaTeX 是latex的特殊展示格式 这是一份\LaTeX 示例文档 第二行 第三行xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxdadadasdhhh dsadasdadas 第四行\end{abstract}%目录\tableofcontents %插图\listoffigures %另起一页\newpage 这是我的第一个\LaTeX 文档\begin{comment}关于章节的总结 章节的编号会自动生成 主章节\section{章节的名字}子章节\subsection{子章节的名字}取消章节的编号加*号\subsection*{子章节的名字}\end{comment}\section{章节一、常用的排版命令}常用的排版命令如下\subsection{文字与段落}\textbf{加粗}、\emph{斜体}、\underline{下划线}、\large{加大}、\Large{超级加大}\subsection{罗列环境}常用enumrate、itemize来进行罗列每个罗列内容可能有多个条目每个条目用$\backslash$item来书写比如\begin{enumerate}\item 带数字的罗列第一条\item 带数字的罗列第二条\item 带数字的罗列第三条\end{enumerate}\begin{itemize}\item 不带数字的罗列\begin{itemize}\item 二级罗列\item 二级罗列二\end{itemize}\item 不带数字的罗列二\end{itemize}\subsection{分栏环境}有时为了打印以及排版需要需要将页面分为双栏或多栏的环境这些通常是用$\backslash$minipage命令实现的比如把页面分成两栏每栏的宽度为原来单栏的一半这可以用\noindent\begin{minipage}[h]{0.48\textwidth}我是左边的一栏为了显示清晰我需要有很长很长很长的长度所以我要撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑\end{minipage}\hspace{2mm}\begin{minipage}[h]{0.48\textwidth}我是右边的一栏为了显示清晰我需要有很长很长很长的长度所以我要撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑\end{minipage}\begin{comment}插入图片的总结 一行中只有一张图片1、图片结构\begin{figure}内容...\end{figure}2、图片居中结构\begin{center}内容...\end{center}3、插入图片的命令 这个图片建议放在你的latex文件的同一个文件夹下后续直接使用相对路径引用\includegraphics[width倍数\textwidth]{相对路径}4、这一行图片的名字和引用名字\caption{这一行图片的名字}\label{这一行图片的引用名字}如果一行中有两张图片 方法一1、图片结构\begin{figure}内容...\end{figure}2、子图片结构\subfigure[子图片的名字]{插入图片的命令}3、这一行图片的名字和引用名字\caption{这一行图片的名字}\label{这一行图片的引用名字}方法二使用分栏来做1、设置一行中某一栏的结构\begin{minipage}[t]{倍数\textwidth}内容...\end{minipage}2、用方法一的第二步、子图片结构往这一栏中放图片3、这一行图片的名字和引用名字\caption{这一行图片的名字}\label{这一行图片的引用名字}在文章中引用图片语法\ref{某一行图片的引用名字}\end{comment}\subsection*{图片环境}图~\ref{fig:a}展示了一张图片的插入图~\ref{fig:b}和\ref{fig:c}展示了两张图片的插入。\begin{figure}[H]\begin{center}\includegraphics[width\textwidth]{fg.jpg}\end{center}\caption{FG}\label{fig:a}\end{figure}\begin{figure}[H]\subfigure[峰哥帅的]{\includegraphics[width0.48\textwidth]{fg.jpg}}\subfigure[峰哥酷的]{\includegraphics[width0.48\textwidth]{fg.jpg}}\caption{FGG}\label{fig:b}\end{figure}\begin{figure}[H]\begin{center}\begin{minipage}[t]{0.3\textwidth}\begin{center}\subfigure[fg1]{\includegraphics[width\textwidth]{fg.jpg}}\end{center}\end{minipage}\begin{minipage}[t]{0.3\textwidth}\begin{center}\subfigure[fg2]{\includegraphics[width\textwidth]{fg.jpg}}\end{center}\end{minipage}\begin{minipage}[t]{0.3\textwidth}\begin{center}\subfigure[fg3]{\includegraphics[width\textwidth]{fg.jpg}}\end{center}\end{minipage}\end{center}\caption{FGG}\label{fig:c}\end{figure}\begin{comment}生成表格1、表格结构\begin{table}[H]\begin{center}\begin{tabular}{c|cccc}% c和|表示表格的列结构 内容...\hline 某一列内容某一列内容某一列内容\hline 某一列内容某一列内容某一列内容 某一列内容某一列内容某一列内容 某一列内容某一列内容某一列内容\hline\hline表格的边框线这个内容需要单独为一行表示单元格的对齐符\end{tabular}\end{center}\end{table}\end{comment}\subsection*{列表环境}\LaTeX 的表格书写一般直接根据模板修改即可比如表~\ref{tab:a}事例\begin{table}[H]\begin{center}\begin{tabular}{c|c|cccccc}\hline $\theta_1\backslash\theta_2$$$$-$$*$$/$\\\hline1$$$$$*$$/$\\2$($$)$$*$$/$\\\hline\end{tabular}\end{center}\caption{运算符表}\label{tab:a}\end{table}\begin{comment}数学公式 行内公式与正文在一起一对$ $保存起来 行间公式单独为一行一对保存起来 上\下标 字母a加上下标数字1a_1 字母a加上上标数字1a^1 tip如果上\下标加的内容是一个公式那么使用一对{}把公式包起来。 累加符\sum\积分符\int\无穷符\infty 分数表达 分子/分母\frac{分子}{分母}左\右大括号指一次性可以把一个分数包起来\left(\right)向量 在字母a上加向量符\vec{a}点 cdot 一个矩阵表达\left[\begin{array}{c}c表示一列...\\...\\...\end{array}\right]多矩阵组成的公式\begin{equatoin*}\left[\begin{array}{cccc}四列........\\........\\........\end{array}\right]\left[\begin{array}{cccc}四列........\\........\\........\end{array}\right]\end{equatoin*}equation公式(会给公式编号)\begin{equation}书写公式\end{equation}equation公式(公式分多步骤展示但这个多行公式只有一个编号)\begin{equation}\begin{split}%如果有公式在一行中形如表达式表达式这样几部分构成那么需要加上split结构 第一行公式\\(换行)第二个公式....公式内容需要对齐时可以用进行对齐\end{split}书写公式\end{equation}gather公式(公式分多步骤展示这个多行公式每一行都有编号)\begin{gather}分步骤 公式\\公式\end{gather}equation公式的引用\eqref(公式的标签名)\end{comment}\section*{数学公式}行内公式表示在正文中的数学公式$a^2 b^2c^2$\par 行间公式一个公式独立一行$$\sum_{i1}^{n}d(v_i)2\sum_{i1}^{m}e_i$$使用equation环境的公式,会依次给equation表达式进行编号\begin{equation}\int_{0}^{\infty}f(x)dx\end{equation}多个等号的公式\begin{equation}\begin{split}\frac{a_{n_1}^2-a_{n_2}^2}{a_{n_1}a_{n_2}}\left(\frac{(a_{n_1}a_{n_2})(a_{n_1}-a_{n_2})}{a_{n_1}a_{n_2}}\right)\\a_{n_1}-a_{n_2}\end{split}\label{eq1}\end{equation}这是一个数学equation公式的交叉引用\eqref{eq1}\par 需要连续多个编号\begin{gather}1\in\mathbb{N}\\\vec{a}\cdot\vec{b}|a||b|\cos\theta\end{gather}这是一个矩阵\begin{equation}\left[\begin{array}{cccc}x\\y\\z\\c\end{array}\right]\end{equation}这是一个矩阵等式\begin{equation*}\left[\begin{array}{cccc}1x_0...x_0^n\\2x_1...x_1^n\end{array}\right]\left[\begin{array}{c}a_0\\a_1\\a_2\end{array}\right]\left[\begin{array}{ccc}1\\2\\3\\4\end{array}\right]\end{equation*}\end{document}
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2483491.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!