无涯教程 - Latex 格式(Format)
格式参数用于为文件或文档提供独特的样式,有多种格式化文档的方法,如下所列:
可选参数
流行的可选参数是:
- twocolumn - 这是2列页面
- titlepage - \maketitle 生成标题页
- openright - 如果使用了两个侧面,则本章从右侧页面开始
- landscape - 用于在横屏中显示
- legno - 将等式编号放在左侧
- flegn - 左对齐方程式与中心对齐
- twoside - 会打印在纸张的两面。
a)Class
此处使用的文档类型是演讲稿和科学期刊中的文章,报告,书籍,幻灯片,海报程序(基于文章类别的类),信件,投影仪(用于撰写演讲稿)等。
该类在程序开始时使用, {article} 是常用的类。
文档类定义了文档的总体布局。
其他类也包含在大括号中,如下所示:
- report - 用于包含较长文档的章节。
- thesis - 用于使用Latex准备论文。
- letter - 用于撰写信件
- books - 书籍
- slides - 用于透明胶片。
b)Groups
为了限制参数并将状态限制在局部,可以将特定部分局部括在花括号中。但是在某些情况下,如果无法使用括号,则可以分别使用\bgroup 和\egroup 来开始和结束一个组。
例如,普通文本{xyz}更多普通文本
可以写为普通文本\bgroup xyz\egroup {}更多普通文本。
c)Packages
它是一种为文档提供或添加额外格式设置函数的方法,例如图片,书目和链接。它还为Latex添加了新函数。所有软件包必须仅包含在序言中。要加载软件包,使用的命令是:
\usepackage{packagename}
它也可以用作\usepackage [options] {package}
一些常用的软件包是:
- color - 提供了一种使用颜色的方法。
- rotating - 用于旋转,尤其是图形和表格。
- fancyhdr - 它自定义页眉和页脚。
- graphicx - 是用于包含图形的命令。
- setspace - 这是一种更改行距的简便方法。
结构格式
- Title
标题用于信函,文章,报告,书类等大多数纸张格式中。要创建标题,需要指定作者,标题和日期的文本,然后使用\maketitle 命令,标题页由Latex生成。 \begin {document} 必须在开始时使用。用于创建标题的命令是\maketitle 。创建标题的代码如下:
\documentclass[12pt]{article}\begin{document}\title{This is my website Learnfk} % 定义标题\author{ The author learnfk} % 定义作者信息\date{ 2021-12-12 } % 定义日期\maketitle\end{document}
输出如下图所示:
如果您根本不需要日期,则可以使用\date {} 命令。
要显示当前日期,可以使用\date {\today} 命令。
Sections : 您可以将文档分为多个部分和子部分。用于创建这些部分的命令是:
- \section{..}
- \subsection{..}
- \subsubsection{..}
- \paragraph{..}
- \subparagraph{..}
这些是articles类的常用命令。您还可以对书籍和报告类别使用\chapter {..} 命令。
以下部分的代码如下:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitle\section{Introduction}Learnfk is a tutorial network for programmers technology introduction\section{About}Including PHP, Java, Latex, Linux\subsection{}The first part of the method.\subsection{}The second part of the method.\section{Results}This is the section for the results\end{document}
输出如下图所示:
- Labeling 要引用文档的其他部分,可以标记任何section命令。您可以使用\label {labelname}标记该部分。 如果要参考标签的章节或页码;您可以使用\ref {labelname}和\pageref {labelname}。 代码如下所示:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitle\section{Introduction}Learnfk is a tutorial network for programmers technology introduction\section{About}Including PHP, Java, Latex, Linux\subsection{}\label{sec1}The first part of the method.\subsection{}The second part of the method.\section{Results}This is the section for the results. You can refer to the section \ref{sec1} on page \pageref{sec1}.\end{document}
输出
对于多页或文件,您可以根据需要轻松地参考页码和部分。
- Table of contents
如果要在文档中创建目录,可以键入命令\tableofcontents 。
- Page Numbering
此格式用于在编写文档之前对页进行编号。它还可以确保主文档从第1页开始。可以在罗马和阿拉伯语之间切换页码。用于对页面进行编号的命令是\pagenumbering {..} ,该命令在\maketitle 命令之后声明。
上述方法的代码如下:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitle\pagenumbering{roman} %页码编号使用字体\tableofcontents %创建目录\newpage\end{document}
输出如下图所示:
。页眉和页脚(Headers and Footers)
出现在头部或脚部。输出屏幕包括头部,身体和脚。默认情况下,除字母外的所有类别均打印页码。
要修改默认操作,可以使用\pagestyle 命令(位于\chapter 之后)或类似的命令。
标准页面样式的类型如下:
- \pagestyle {plain} - 这是报表类和文章的默认样式。页头列出在脚上,而头是空的。
- \pagestyle {headings} - 在这种样式中,脚是空的。标题和页码放在标题中。
- \pagestyle {myheadings} - 指定头部使用的信息;使用以下命令。
\markboth{leftheader}{rightheader} \markright{rightheader}
\markboth 用于双面文件或文档,而\markright 用于双面文档。
- \pagestyle {empty} - 这种样式的页眉和脚都是空的。
- \thispagestyle {style} - 它仅用于更改当前页面的样式。例如,\thispagestyle {empty} 用于手脚没有任何东西。此命令将仅在当前页面上执行,而不会影响其他页面。
如果要以其他方式格式化或自定义页眉和页脚。您可以使用 fancyhdr 命令。 Latex中的此命令用作\usepackage {fancyhdr} 。此处使用的包可以使页眉和页脚在左侧,右侧和中心对齐。您还可以定义多行标题和过滤器,用于偶数和奇数页的单独标题等。
\pagestyle {fancy} 也用于此处。
{}(大括号)中可以包含以下命令:\lhead {},\chead {},\head {},\foot {},\foot {},\rfoot {} 。
如果要隐藏默认情况下绘制的标题下的水平线,可以使用\renewcommand {\headrulewidth} {0pt} 命令。
。Margins
这些命令用于手动设置边距。默认情况下,内部页边距被视为 1英寸。因此,如果要将边距设置为 0.5 英寸,则必须提及该边距 -0.5 英寸。您还可以使用 textheight 和 textwidth 命令设置文本区域的高度和宽度。
下表中给出了设置边距的可用命令:
边距 | 命令 |
---|---|
左页边距 (如果使用单面,则为奇数页) | \oddsidemargin |
左页边距 (如果使用双面,则为偶数页面) | \evensidemargin |
右边距 | \textwidth |
上边距 | \topmargin |
底边距 | \textheight |
用于设置页边距英寸的命令为:
- 要将上边距设置为0.7英寸,请\setlength {\topmargin} {-0.7in}
- 要在右侧页面上将页边距设置为1英寸,请\setlength {\oddsidemargin} {0in}
- 要在双面文档的左侧页面上将页边距设置为1英寸,请\setlength {\evensidemargin} {0in}
- 要保留右边距的空间,请\setlength {\textwidth} {0in}
- 要为文本保留9英寸,\setlength {\textheight} {9in}
。Paragraph
要开始一个段落,可以使用控制顺序\par ,也可以保留空白。该段落的缩进默认为1.5em(是当前字体的磅值的1.5倍)。段落之间没有插入多余的空间。要控制段落的分隔和缩进,使用命令\parindent 和\ parskip 。让我们考虑以下示例:
本示例包含一个简单的段落。代码如下:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitleLearnfk is a tutorial network for programmers technology introduction, including PHP, Java,Latex, Linux and other related \newline tutorials\end{document}
输出如下图所示:
本示例包含一个带有段落分隔和缩进命令的段落。代码如下:
本示例包含一个简单的段落。代码如下:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitle\parindent=3in %缩进\parskip=15pt %与上方的距离Learnfk is a tutorial network for programmers technology introduction, including PHP, Java,Latex, Linux and other related tutorials\parindent=0in\parskip=30ptThis is the topic of learnfk\end{document}
输出如下图所示:
您会注意到上面两个示例之间的区别。
i。References
也称为交叉引用,用于截面,图形,方程式或表格。使用的命令如下:
- \pageref {marker} - 它包含与\label 命令相关的页码。
- \label {marker} - 用于设置标记以备将来参考。
- \ref {marker} - 由与\label 命令相关的部分,图形等组成。
绘制规则
如果要在文档页面上绘制水平或垂直线,可以使用\rule 命令。在Latex中,它将写为:
\rule[lift]{width}{height}
提升是可选参数,它是提高到基线以上的量。宽度是水平尺寸,高度是垂直尺寸。例如,如果要绘制下面给出的线:
您可以使用\rule {\textwidth} {2pt} 命令。
上面示例的代码或程序如下:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitle\rule{\textwidth}{1pt}\section{Introductino}Learnfk is a tutorial network for programmers technology introduction\section{Methods}Including PHP, Java,Latex, Linux and other related tutorials\subsection{}\label{sec1}This first part of the Method\subsection{}This Seond part of the method \ref{sec1} on page \pageref{sec1}.\end{document}hod. \end{document}
输出如下图所示:
您可以根据要求绘制多条线。
例如,要绘制两条线,代码如下:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitle\rule{\textwidth}{1pt}\section{Introductino}Learnfk is a tutorial network for programmers technology introduction\section{Methods}Including PHP, Java,Latex, Linux and other related tutorials\subsection{}\label{sec1}This first part of the Method\subsection{}This Seond part of the method \ref{sec1} on page \pageref{sec1}.\rule{\textwidth}{2pt}\end{document}
下图显示了以上示例的输出:
- Footnotes - Latex会自动为脚注编号。命令 \footnote恰好位于您希望脚注出现的位置。 \footnote 命令与其前面的文本之间不应有多余的空格。该命令写为\footnote {注释文本在此处编写}。 大括号内的文本显示在底部。例如,考虑以下代码:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitle\rule{\textwidth}{1pt}Learnfk is a tutorial network for programmers' technical introduction, \footnote{ LearnFk.com } including PHP, Java, Latex, Linux and other related tutorials \footnote{ LearnFK Tutorials}. Welcome, study hard, day day up! \footnote{ Thanks !}\end{document}
输出如下图所示:
脚注将出现在底部。对于上面的示例,脚注如下图所示:
- Centering - 如果您只在中心放置一条线;那么您可以使用\centerline 命令。例如, \centerline {此处提到的行将显示在中心}。 让我们考虑以下示例:
\documentclass[12pt]{article}\begin{document}\title{This is my WebSite LearnFK} \author{ My name is LearnFk} \date{\today }\maketitle\rule{\textwidth}{1pt}Learnfk is a tutorial network for programmers' technical introduction, \footnote{ LearnFk.com } including PHP, Java, Latex, Linux and other related tutorials \footnote{ LearnFK Tutorials}.\\\\ %\\ 相当于\newline 换行\centerline{Welcome, study hard, day day up!} %centerline 用于居中显示\end{document}
输出如下图所示:
如果要显示多行,则可以按以下方式编写。
\begin{center} ......... \end{center}
- Quotations - 引号可以在以下环境中使用:
\begin{quote} .......... \end{quote}
在段落中,节中的引号之间没有空白行分隔和意图。
Latex 格式(Format) - 无涯教程网无涯教程网提供Latex Latex 格式(Format)入门教程,格式参数用于为文件或文档提供独特的样式,有多种格式化文档的方法,如下所列:可选参数流行的可选参数是:twocolumn - 这是2列页面titlepage&nb...https://www.learnfk.com/latex/latex-formats.html
无涯教程 - Latex 格式(Format)相关推荐
- 无涯教程 - Latex 字体(Fonts)
Latex字体 我们通常在方括号[]中定义纸张大小和字体大小. 可以使用 [10pt] 来描述点的大小.其他字体大小为8pt,9pt,10pt,11pt,12pt,14pt,17pt,20pt. La ...
- 无涯教程 - Latex 列表(Lists)
Latex列表用于添加任何其他软件包,有三种类型的列表.一个是枚举(enumerate)列表,该列表会生成编号列表.第二个是 itemize ,用于项目符号列表.第三个是描述列表(descriptio ...
- LaTeX入门最终集 :LaTeX格式的调整LaTeX中怎么打出数学公式LaTeX的各种上下标
LaTeX入门最终集!LaTeX格式的调整!LaTeX中怎么打出数学公式!LaTeX的各种上下标! 一.资源 Latex设置A4页面及页边距调整 atex 编译Underfull \hbox (bad ...
- 无涯教程: Laravel 8 - Excel和CSV介绍
在此示例中,我们将使用maatwebsite/excel composer程序包执行导入和导出任务. maatwebsite/excel提供了使用数据库模型进行导入和导出的简便方法. 我们使用了maa ...
- 无涯教程:Node.js - Streams介绍
无涯教程网:Stream流是使您可以连续地从源读取数据或将数据写入目标的对象,在Node.js中,有四种类型的流- Readable - 用于读取操作的流. Writable - 用于写 ...
- 无涯教程: Laravel 8 - 队列介绍
有时,你发送电子邮件或站内消息比较费时,这时可以使用队列处理这些任务. 步骤1:下载Laravel 8 首先,我们需要使用下面命令获取最新的Laravel 8版本应用程序. composer crea ...
- 数学公式截图转Latex格式
背景 学理科的人总有不得不写复杂的数学公式的时候,这里推荐一个可以将公式截图直接转为LaTeX格式代码的小工具. Mathpix mathpix Mathpix是一个可以将截图图片上的公式转化为Lat ...
- 如何将Excel中的表格直接转成LaTex格式?
目录 问题描述: 问题解决: 注意事项: 问题描述: 平时,使用OverLeaf,或其他的.tex编辑器,写论文的时候,经常会出现表格.但,平时数据的存放,我习惯性的存放在Excel中.如果实验数据表 ...
- 如何使用word 2016公式编辑器更快的编写LateX格式公式(专业)?
word技巧总结–公式篇 在使用word编辑公式时,常常会用到latex格式编写. 比如想要打出 l 1 l_1 l1,在word中按下'alt +/='键,按小写字母l_1,并没有变成预想的结果 ...
最新文章
- Linux基础知识入门测试
- TCP 网络应用程序开发流程
- 【错误总结】LaTex Warning: citation undefined
- 机器学习基础专题:支持向量机SVM
- C++STL之next_permutation使用
- 异常mongodb:Invalid BSON field name XXXXXX:YYYYY.zz
- 西安下雪了,做了一个室内温度计
- Web上的支持的图片格式以及它们之间的区别
- 第十一节(单例模式初步、类的继承)
- go interface转int_Go 中 slice 的 In 功能实现探索
- 原生态mysql_MySQL 原生操作-速查
- 想成为高薪的Java架构师该如何做?
- sqlserver shiwu
- python如何手动编写开根号的算法_手动开根号方法
- SEO中的简单代码优化
- 类型“Window typeof globalThis”上不存在属性“gspZc”
- GoogleCode新手教程
- SpringCloud Alibaba Sentinel实现熔断与限流
- centos7装机与基础配置
- 【文献阅读】翻译王军武老师的文献--《稠密气固流的连续理论现状回顾》二、第一节 引言
热门文章
- 七剑下天山?七步搞定DB2查询优化!
- Shadow SSDT
- “创业吃过饼,国企养过老,android开发零基础
- 苹果终究拗不过拼多多,iPhone12大跌千元
- matlab画微分方程的矢量场图_一维波动方程数值解 Matlab 教程(从入门到出图)——3数值计算的Matlab实现...
- 模糊数学Fuzzy Set第2讲——Fuzzy Logic Fuzzy Reasoning
- Waves 10 win10 如何卸载干净 / 安装 / 如何处理waves mixer application installation failed / 改变默认安装路径
- CSAPP AttackLab解题记录
- NCB:神经元线粒体应激记忆可通过mtDNA水平升高跨代遗传
- html 两个input挨着,欧洲区预选赛直播 -官方网站