LaTeX学习笔记

使用LaTeX对论文进行排版,首先需要安装Texlive和TeX studio
1.初识LaTeX
在LaTeX中,"%"后面的内容表示注释

\docutmentclass{article}%文档可选类型book,letter,report,不同的类型会有不同的排版
%导言区 进行全局设置
\title{HRO}
\author{Zhiwei ye}
\date{today}
%文稿区
\begin{document}
\maketitle%只对有标题类型的文档进行输出,无标题的如letter则会报错
Hello word! %普通文本
f ( x ) = 3 x + x 2 f(x)=3x+x2 f(x)=3x+x2 %$符号表述数学模式中,用来输入数学公式
\end{document}

2.字体设置
\usepackage{ctex} 字体包
①%以下为三种不同的字体设置
\textrm{ hello how are you}
\texttt{ hello how are you}
\textsf{ hello how are you}
②%也可以使用字体申明

%以下可以对字体的管辖范围用{}进行设置
{\textrm hello how are you, i am fine and you me,too}

③字体系列设置(粗细、宽度)
\textmd{Medium Series} \textbf{Boldface Series}
{mdseries Medium Series} {bfseries Boldface Series}

④字体形状(直立、斜体 伪斜体、大小写)
\textup{Upright Shape} 或 声明的方式: {\upshape Upright Shape}
\textit{Italic Shape}
\textsl{Slanted Shape}
\textsc{Small Caps Shape}

⑤中文字体的设置 必须导入ctex包
{\songti 宋体}
{\heiti 黑体}
{\kaiti 楷体}
也可以设置中文字体的{\textbf 粗体}和{\textit 斜体}

⑥字体大小的设置
字体大小的设置是根据normalsize设置的,normalsizee的大小是可以进行设置的
\docutmentclass[10pt]{article} %此处设置默认为10磅,此处的值并非可随意设置,可选值为:10,11,12
%下面的字体大小依次为从小到大
{\tiny Helllo}\
{\scriptsize Hello}\
{\footnotesize hello}\
{\small hello}\
{normalsize hello}\
{\lage hello}\
{\Large hello}\
{\LARGE hello}\
{\huge hello}\
{\Huge hello}

⑦中文字号设置
\zihao{5}

在命令窗口输入 texdoc ctex可以调入详细字体设置文档
在这里插入图片描述

3.文档的基本结构设置
\begin{document}
\section{Introduction}
Subscribers may reproduce tables of contents or prepare lists of articles including abstracts for internal circulation within their institutions. Permission of the Publisher is required for resale or distribution outside the institution and for all other derivative works, including compilations and translations. If excerpts from other copyrighted works are included, the author(s) must obtain written permission
from the copyright owners and credit the source(s) in the article. Elsevier has preprinted forms for use by authors in these cases.
%空一行用于另起一个段落,一个空行与多个空行的效果是一样的
“\”命令:换行 \par 产生新的段落
For gold open access articles: Upon acceptance of an article, authors will be asked to complete an ‘Exclusive License Agreement’ (more information). Permitted third party reuse of gold open access articles is determined by the author’s choice of user license.
\section{Experiment}
\subsection{Figures}
\subsection{Tables}
\subsubsection{Experiment Condition}
\section{Result}
\section{Acknowledgement}
\section{Reference}
\end{document}
%文档类型亦可以为ctex类型,具体格式要求查看其使用手册

4.LaTeX中的特殊字数
①{空白字符}
在这里插入图片描述

当需要产生多个空白字符的时候
A\quad B 产生1em(当前字体中M的宽度)的空格
A\qquad B 产生2em的空格
A\enspace B 产生0.5em的空格
A\thinspace B 产生六分之一的em的空格
\空格 输出一个空格
A~B 产生一个硬空格

②控制符
# $ % 与编程中转义字符类似
③排版符号
④产生LaTeX的标志符号
如\lex{} \latex{}
如需产生别的标志符号,需要用usepackage{}引入宏包
⑤引号 与平常使用相同
⑥连字符、非英文字符、重音符号
在这里插入图片描述

结果如下图:
在这里插入图片描述

5.插图
在导言区需要引入\usepackage{graphicx}宏包
%语法 \includegraphics[<旋转,缩放等可选参数>]{<文件名>}
文件格式包括:EPS/PDF/PNG/JPEG/BMP
\graphicspath{{f1/},{}}%用来指定图像路径,中间多个花括号表示分组
在文稿区:
\LaTeX{}中的插图
\includegraphics[<可选参数>]{在路径文件目录下的文件名}
如:\includegraphics[scale=0.5]{CS} 缩放比例
\includegraphics[height=2cm]{CS} 指定高度
\includegraphics[width=2cm]{CS}
\includegraphics[width=0.2\textwidth]{CS} 版型文本0.2倍的文本宽度
亦可以使用多个可选参数,参数之间用”,”连接
具体细节:texdoc graphicx 查看
%本网站有任总结的很好,搜一下就好
\begin{figure}[h]
\centering%居中
\includegraphics[width=4cm,height=5cm]{y}
\caption{figure title}
\end{figure}
%两张并列一行,且各自有各自的标题
\begin{figure}[h]
\begin{minipage}[t]{0.45\linewidth}
\centering
\includegraphics[width=5.5cm,height=3.5cm]{ABC}
\caption{ABC}
\end{minipage}
\begin{minipage}[t]{0.45\linewidth} %图片占用一行宽度的45%
\hspace{2mm}
\includegraphics[width=5.5cm,height=3.5cm]{y}
\caption{y}
\end{minipage}
\end{figure}

6 .表格
\begin{tabular}{l,c,c,c,c,r}%设置其对齐方式以及其列数 p{1.5cm}指定表格宽度,当大于宽度时,换行
%不同的列间用&分割 用\结束本行,并产生新的一行
%用|产生列与列之间的竖线,可放置任意位置 \begin{tabular}{l|c|c|c|c|r}
%\hline产生表格的横线
name&Chinese&Math&English&PE&Music\
\hline
Lucy&90&99&98&87&96\
\hline
Lily&90&99&98&87&96\
\hline \hline%产生双横线
Mike&90&99&98&87&96
\end{tabular}
在这里插入图片描述

Texdoc tabu 命令查看表格具体说明文档
7.浮动体
图像浮动体----可用来设置图像相关 系统会自动对其进行编号,编号与表格相互独立
\begin{figure}
content…
\end{figure}
表格浮动体,跟图像类似,亦可设置居中、标题等信息,系统自动编号
\begin{table}
content…
\end{table}
标签设置及交叉引用:如图一所示

8.数学公式
(1)行内公式:数学模式
f ( x ) = x 2 + 3 x f(x)=x^2+3x f(x)=x2+3x
②(\f(x)=x^2+3x)
③也可以使用math环境排本,将这些公式置于环境中
\begin{math}
content…
\end{math}
(2)上下标,使用规则一致
上标:^
如:f(x)=x_^{20}+20 %较小的数值可不适用花括号,如果为字符串,或者较大的数字,则应该加{}
下标:_ 下划线
(3)希腊字母
在这里插入图片描述

数学公式中的正弦、余弦、正切函数等都可以
在这里插入图片描述

例如:
在这里插入图片描述
在这里插入图片描述

(4)分式:
3 / 4 3/4 3/4
或使用frac函数: 3 4 \frac{3}{4} 43
(5)行间公式:三种方式如下
KaTeX parse error: Expected group after '_' at position 7: f(x)=x_̲^{20}+20
[f(x)=x_^{20}+20]
使用\begin{displaymath}
content…
\end{displaymath}
如需要对公式进行标号equation,将需要编号的公式置于环境中
\begin{equation}
content…
\end{equation}
在这里插入图片描述

上图为公式的交叉应用,先用\tabel为公式添加标签,再\ref引用
若不需要自动编号,则为:
\begin{equation*}
content…
\end{equation*}
(6)多行公式的排版
\usepackage{amsmath}
\usepackage{amssymb}

\begin{gather}
内容… 实现公式排版,并对公式进行编号,使用“\”换行
\end{gather}

\begin{gather*}
内容…不带编号的公式进行排版
f(x)=x1+x2 \notag\ %使用notag阻止本行公式进行编号,其它照常
\end{gather*}
(7)用align和align*环境(用&进行对齐)
\begin{align}
内容…
\end{align}

\begin{align*}
内容…
\end{align*}
(8)如下公式的输入
在这里插入图片描述

使用text实现在数学公式中输入中文,否则无法实现
在这里插入图片描述

9 .参考文献
方法①使用thebibliography环境排版
\begin{thebibliography}{widestlabel}
\bibitem{参考文献}
\bibitem{参考文献}
\bibitem{参考文献} \empf{}命令强调参考文献中的某些内容
\end{thebibliography}
设置并应用 使用\cite命令引用参考文献 引用参数设置:不同文章,有不同的标志
在这里插入图片描述

缺点:每一天参考文献都需要仔细排版,比价麻烦,且可移植性较差

方法②一次管理,多次使用,Bib TeX方法,配置好TexStudio,将Bib Tex设置为默认参考文献工具,2020貌似直接设置好了的
创建一个新文件,其格式定义如下,并将文件保存为”.bib”后缀名的参考文献数据库文件
可以在谷歌学术找到文章BibTex样式的参考文献,直接如下图,粘贴过来即可,一个文献数据库里面可以有多个
在这里插入图片描述
不同关键字之间用”,”号分割,使用{}进行分组
在导言区用\bibliographystyle{plain}%用来指定参考文献的排本样式
%\usepackage{natbib}使用该宏包选择更多的样式
\begin{document}
这是一个参考文献的应用:\cite{mittelbach2004}%参数为引用参考文献的引用标志
\bibliography{test,cnki}%参数为不同的用户自建立的参考文献数据库,用”,”分割
\nocite{*参数}%在此处排版不需引用的参考文献
\end{document}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值