个人承接网站开发项目,wordpress 用途,营销软文800字范文,wordpress创业邦LaTeX 入门 - 语法
一、使用 LaTeX 优点 这里首先说明#xff0c;并不是因为 Word 排版不好才使用 LaTeX。之所以 Word 排版不美观#xff0c;很大一部分是因为上手太简单#xff0c;很少有人在使用 Word 时会像学习 LaTeX 时一样逛论坛、看文档#xff0c;结果排出难看的…LaTeX 入门 - 语法
一、使用 LaTeX 优点 这里首先说明并不是因为 Word 排版不好才使用 LaTeX。之所以 Word 排版不美观很大一部分是因为上手太简单很少有人在使用 Word 时会像学习 LaTeX 时一样逛论坛、看文档结果排出难看的文档后怪工具不方便。这里只列一下 LaTeX 的优点并无对 Word 的特意中伤但从开源角度是可以喷的这取决于个人的价值观念。 完全自定义自主设计比 Word 更专业的排版超文本标记语言设计效率高不需频繁操作鼠标复用性强利用已有模板可实现快速专业的论文排版对数学公式的支持性更好不会像 Word 跑版可更加专注于文章内容本身大部分期刊要求 LaTeX 版本可进行注释且不显示在 pdf 中不会像 Word 一样崩掉不会因版本问题跑版方便代码插入可插入热门语言代码开源。
二、LaTeX 官方文档
LaTeX 官方文档CTEX LaTeX 文档Overleaf LaTeX 文档OI Wiki 文档
三、LaTeX 常用语法总结
Hello World !
\documentclass{article}%文章类型-article,book,letter等
\title{My first Latex document}%文章标题
\author{Suancaiyu1806}%作者姓名
\date{\today}%日期\today表示今天
\begin{document}%文档正文开始
\maketitle%控制序列将文字按预定格式打印 Hello world! \end{document}%文档正文结束文章类型
\documentclass[options]{class} 指明文档的类型及格式。 \documentclass[11pt,twoside,a4paper]{article}%[]中参数使用,隔开%11pt文章主体字体大小默认10pt%twoside双边编排奇偶页左右边距相反%a4paper文档长宽同A4纸%{}中指出文章类型article为论文格式文档类型
class 参数文章类型article论文类型book书籍类型letter信件类型slides幻灯片IEEEtranIEEE Transactions格式的文章proc诉讼、议程minimal主要调试用report较长的报告memoir可更改文档的输出类型基于bookbeamer自我介绍、业务陈述
自定义选项
option 参数含义10pt,11pt,12pt正文字体大小默认10pta4paper, letterpaper…纸张大小fleqn公式左对齐leqno公式编号置于公式左titlepage, notitlepage指定文章标题后是否启用新页面默认情况下article类不启动新页面而report和book启动onecolumn, twocolumn指定此文件要以单列或双列进行排版twoside, oneside单、双边编排奇偶页左右边距相同、相反。book 类默认双边编排landscape横向打印openright, openany仅在右侧页或下一页开始新章节report 默认下一页开始book 默认右侧页开始draft草稿模式
目录
\tableofcontents 添加在导言区即可显示目录。目录要编译两遍以上才正常第一遍在.aux 辅助文件中记录位置第二遍根据辅助文件的内容输出目录。如果目录本身会影响后续内容的页码那么还要编译第三遍。因此将配置时的 latex-workshop.latex.autoClean.run: onBuilt, 注释掉 \documentclass{article} \title{My first Latex document} \author{Suancaiyu1806} \date{\today} \begin{document} \maketitle \tableofcontents%目录添加在导言区Hello world! \end{document}章节、段落 %边距\usepackage{geometry}\geometry{a4paper,left2cm,right2cm,top1cm,bottom1cm}%设置纸张及边距之前设置过纸张这里可不设置%缩进与行间距\usepackage{indentfirst}\indent \linespread{1}%行间距%章节\section{}%一级\subsection{}%二级 \subsubsection{}%三级\usepackage[section]{placeins}%这一个包可以避免图或表在浮动时跨过section\renewcommand\thesection{\chinese{section}、}%此句可设置一级章节标题为中文如一、一级%段落\paragraph{}%一级\subparagraph{}%二级 \subsubparagraph{}%三级%注脚\footnote{FootNote}%注脚%页眉页脚\pagestyle{type}%全部页\thispagestyle{type}%当前页%type: empty-无页眉页脚%plain-没有页眉页脚包含一个居中的页码%headings-没有页脚页眉包含章/节或者字节的名字和页码%myheadings-没有页脚页眉包含有页码\setcounter{page}{number}%手动设置页码编号示例 \documentclass{article} \title{My first Latex document} \author{Suancaiyu1806} \date{\today} \begin{document} \maketitle \tableofcontents \newpage%创建新页面\section{Chapter 1} \subsection{Section 1} \paragraph{I have a dream that one day this nation will rise up and live out the true meaning of its creed: We hold these truths to be self-evident that all men are created equal.}\subsection{Section 2}\paragraph{I have a dream that one day on the red hills of Georgia the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood.}\section{Chapter 2} \subsection{Section 1} \paragraph{I have a dream that one day even the state of Mississippi, a state sweltering with the heat of injustice, sweltering with the heat of oppression, will be transformed into an oasis of freedom and justice.} \subsection{Section 2}\paragraph{I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by the content of their character. I have a dream today!}\end{document}字体
\usepackage{fontspec}%使用fontspec包
\setmainfont{Times New Roman}%设置主字体
\setsansfont{DejaVu Sans}%无衬线字体
\setmonofont{Latin Modern Mono}%等宽字体
\setsansfont{[font.ttf]}%使用当前目录下的字体文件
%%字体大小
\tiny \scriptsize \footnotesize \small \normalsize \large \large \LARGE \huge \Huge\title{\heiti The First Demo}%标题使用 The First Demo
\author{\kaishu 酸菜鱼}%作者使用楷书
\paragraph{\kaishu 酸菜鱼}%段落使用楷书
\paragraph{\huge I have a dream!}%段落字号huge数学公式
Einstein s $Emc^2$. %行内公式
\[ Emc^2. \] %行间公式
$m^{n}$ %上标
$m_{n}$ %下标
\frac{m}{n} %分式n分之m
\sqrt{} %开平方
\sqrt[m]{n} %n开m次方
\sum_{im}^{n} %累计求和从m到n求和
\prod_{im}^{n} %累计求积从m到n求积
\int_{im}^{n} %从m到n积分
\vec a %a向量
\overrightarrow{AB} %A到B的向量
ab\cdotsz %ab…z
\underbrace{ab\cdotsz}_{26} %ab…z
\overline{mn} %mn公式上面加上横杠
\underline{mn} %mn公式下面加上横杠%%一行几个公式
\begin{displaymath}
S_{n1} S_{n} S_{n},
S_{n}12^{n}
\end{displaymath}
%%对行间公式进行标号
\begin{equation}
...
\end{equation}方程组
$$
\left\{
\begin{array}{c}
a_1xb_1yc_1zd_1 \\
a_2xb_2yc_2zd_2 \\
a_3xb_3yc_3zd_3
\end{array}
\right.
$$矩阵
\usepackage{amsmath}$ \begin{matrix} 1 2 \\ 3 4 \\ \end{matrix} $%默认无括号
$ \begin{pmatrix} 1 2 \\ 3 4 \\ \end{pmatrix} $%圆括号
$ \begin{bmatrix} 1 2 \\ 3 4 \\ \end{bmatrix} $%方括号
$ \begin{Bmatrix} 1 2 \\ 3 4 \\ \end{Bmatrix} $%花括号
$ \begin{vmatrix} 1 2 \\ 3 4 \\ \end{vmatrix} $%行列式
$ \begin{Vmatrix} 1 2 \\ 3 4 \\ \end{Vmatrix} $%双竖线使用 \cdots ⋯ , \ddots ⋱ , \vdots ⋮ 来输入省略符号
$$\begin{pmatrix}1 a_1 a_1^2 \cdots a_1^n \\1 a_2 a_2^2 \cdots a_2^n \\\vdots \vdots \vdots \ddots \vdots \\1 a_m a_m^2 \cdots a_m^n \\\end{pmatrix}
$$
$$\left[\begin{array}{cc|c}%分列1 2 3 \\4 5 6\end{array}\right]
$$This is a line: $\bigl( \begin{smallmatrix} a b \\ c d \end{smallmatrix} \bigr)$表格
\usepackage{booktabs}%%三线表
\begin{table}[htbp]\centering\caption{\label{tab:test}示例表格}%题注\setlength{\tabcolsep}{2cm}{%设置表格宽度\begin{tabular}{rccl}%对齐方式右 中 中 左\toprulehead1 head2 head3 head4 \\\midrule1 2 3 4 \\1 2 3 4 \\1 2 3 4 \\1 2 3 4 \\\bottomrule\end{tabular}}
\end{table}\usepackage{booktabs}\begin{table}[htbp]\centering\caption{\label{tab:test}示例表格}\begin{tabular}{|rccl|}%左右有框线\hlinehead1 head2 head3 head4 \\\hline1 2 3 4 \\1 2 3 4 \\1 2 3 4 \\1 2 3 4 \\\hline\end{tabular}
\end{table}\usepackage{amsmath}$$
\begin{array}{c|lcr}%分列对齐方式左 中 右
n \text{左对齐} \text{居中对齐} \text{右对齐} \\
\hline
1 1 2 3 \\
2 4 5 6 \\
3 7 8 110i
\end{array}
$$$$
% outer vertical array of arrays 外层垂直表格
\begin{array}{c}% inner horizontal array of arrays 内层水平表格\begin{array}{cc}% inner array of minimum values 内层最小值数组\begin{array}{c|cccc}\text{min} 0 1 2 3\\\hline0 0 0 0 0\\1 0 1 1 1\\2 0 1 2 2\\3 0 1 2 3\end{array}%同行间% inner array of maximum values 内层最大值数组\begin{array}{c|cccc}\text{max}0123\\\hline0 0 1 2 3\\1 1 1 2 3\\2 2 2 2 3\\3 3 3 3 3\end{array}\end{array}% 内层第一行表格组结束\\%换行% inner array of delta values 内层第二行Delta值数组\begin{array}{c|cccc}\Delta0123\\\hline0 0 1 2 3\\1 1 0 1 2\\2 2 1 0 1\\3 3 2 1 0\end{array}% 内层第二行表格组结束
\end{array}
$$图片 \usepackage{graphicx}%使用graphicx包\includegraphics[width3cm]{images/img2.jpg}%引入图片并设置大小\caption{Suancaiyu 1806}%题注参考文献 %%引用参考文献\cite{ref1}%%插入参考文献\begin{thebibliography}{99}\bibitem{ref1}Suancaiyu. LaTeX 入门.CSDN2020050-1.\bibitem{ref2}Suancaiyu. LaTeX 入门.CSDN2020050-1.\bibitem{ref3}Suancaiyu. LaTeX 入门.CSDN2020050-1.\bibitem{ref4}Suancaiyu. LaTeX 入门.CSDN2020050-1.\end{thebibliography}12. 代码块 \usepackage{xcolor}%高亮\usepackage{listings}%代码块\lstset{}%添加代码格式配置文末%附录%中有有关python代码的配置\begin{lstlisting}[languagelangue]\end{lstlisting}插入附录 \usepackage{appendix}\begin{appendices}\section{Appendice 1}\subsection{Appendice}\section{Appendice 2}\subsection{Appendice}\end{appendices}附录
%%本段是对代码块有关格式配置可直接添加在文档开始前
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82} \lstset{ % backgroundcolor\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor} basicstyle\footnotesize, % the size of the fonts that are used for the code breakatwhitespacefalse, % sets if automatic breaks should only happen at whitespace breaklinestrue, % sets automatic line breaking captionposbl, % sets the caption-position to bottom commentstyle\color{mygreen}, % comment style deletekeywords{...}, % if you want to delete keywords from the given language escapeinside{\%*}{*)}, % if you want to add LaTeX within your code extendedcharstrue, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8 framesingle, % adds a frame around the code keepspacestrue, % keeps spaces in text, useful for keeping indentation of code (possibly needs columnsflexible) keywordstyle\color{blue}, % keyword style %languagePython, % the language of the code morekeywords{*,...}, % if you want to add more keywords to the set numbersleft, % where to put the line-numbers; possible values are (none, left, right) numbersep5pt, % how far the line-numbers are from the code numberstyle\tiny\color{mygray}, % the style that is used for the line-numbers rulecolor\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here)) showspacesfalse, % show spaces everywhere adding particular underscores; it overrides showstringspaces showstringspacesfalse, % underline spaces within strings only showtabsfalse, % show tabs within strings adding particular underscores stepnumber1, % the step between two line-numbers. If its 1, each line will be numbered stringstyle\color{orange}, % string literal style tabsize2, % sets default tabsize to 2 spaces %titlemyPython.py % show the filename of files included with \lstinputlisting; also try caption instead of title
}