首页 > 编程知识 正文

科目二视频教程推荐,简谱速成第二课

时间:2023-05-03 05:38:56 阅读:150068 作者:3901

ShareLatex速成(二)第一次用ShareLatex进入网站后,完成注册。 单击左上角的“New Project”开始我们的第一个项目,然后单击选中“blank project”。

现在,我看到网页的左半部分显示了以下代码。

document class { article }use package [ utf8 ] { input enc }title { first project }author {您的姓名}date{当前时间}

begin{document},end{document} begin{document},end{document}

分别用于向编译系统传达语句的开始和结束。 我们正文的内容都要写在这两者之间才能显示。

(section )可以打开新的文章部分。 括号内是这部分的标题。 这里面写着introduction。 你可以随心所欲地修改他的内容。 忧郁的自行车想填补内容的时候,在section{}的部分下面写下你想写的内容就可以了。 例如,这里我的代码是这样写的。 begin { document }make titlesection { introduction } thisismyfirris

然后,点击右半部分布局中的这个图标,可以进行编译

页面右半部分显示的页面如下所示。

如果我的Introduction下还有很多小部分的内容需要细分,把他们通过小标题分开,但同时都在Introduction下,那时我可以选择在命令中使用subsection

begin { document }make titlesection { introduction }subsection { literature review } thisismyliteraturereview. s 在thisismyliteraturereview subsection { indutrialrelevance } thisismyindustrialrelevance. end { document }中单击recompile时

发送subsection时,它会在当前section下生成并自动编号。 我们有时不想要这个号码。 此时,在section后加上*,写上section*{}即可。

section将文章分成几个部分,相似的有chapter{}命令。 用他可以把文章从新的一页开始。

插入图片要在LaTeX中插入图片,必须首先引入package (包)的概念。 例如,如果需要修理自来水,则需要工具包。 现在想插入图像,在代码部分的最上面写usepackage{graphicx}。

写文章的时候,我们经常需要把图片添加到文章里。 使用word的时候,我们只需要把想要的图片移动到文章的指定位置就可以了。 但是,在LaTeX中是这样添加图像的。 首先,在想添加图像的位置点击begin{figure},蓝色的字符编码会自动出现,单击该按钮后代码会自动出现。

begin { figure }centeringinclude graphics { }caption { caption }label { fig 3360 my _ label }end { figurrred }

这张图片在电脑里的文件名是ruocheng.png,要插入文章需要先把这张图片上传到我们的文章项目。 单击左上角的此图标:

把需要的图像放入upload后,你会发现在main下面已经出现了我们的图像索引。 现在我们可以着手修改代码了。 首先,在begin{figure}后面加上[H]。 这样做的目的是让图像不乱地出现在他写这段代码的地方。 否则,此图像会出现在文章中的许多奇怪之处,但必须充分利用此功能,然后在includegraphics后的大括号中键入图像名称, include graphics { ruocheng.JPEG } 这里一定要带图像格式。 之后,我开始设定图像的大小。 在includegraphics后加上大括号[],includegraphics[width=3cm,height=3cm]{ruocheng.jepg}。 在下一行代码caption中必须写下图像的名称。 现在,在括号中输入Astir,以便该行的代码为caption{Astir}。 以下行同样设置图像的名称。 只是,我想引用这个图像的名字,而不是图像本身的名字。 (虽然听起来很绕圈子…)。 写文章的时候,我们经常需要写“figureXXXshowsthatblabla”。 这里的XXX是图像

文章里的编号,那如果我在文章里加了太多的图片,我如果对其中一个进行改动,之后的图片序号都会受到影响,只改一个还好,要是混乱的改几个,我们就要浪费很多时间改变出现在文章中的图片序号。而用LaTeX就剩了很多麻烦。在这里我们设定图片的引用名为ruocheng, 所以讲代码改为label{ruocheng}。
那么现在整块图片代码就变成了:

begin{figure}[H] centering includegraphics[width=3cm,height=3cm]{ruocheng.jpeg} caption{Astir} label{ruocheng}end{figure}

我们再在之前的section中加入这样一段话“As shown in Figure ref{ruocheng, this man feels released at this moment.”

documentclass{article}usepackage[utf8]{inputenc}usepackage{graphicx}usepackage{float}title{First project}author{750763559 }date{August 2018}begin{document}maketitlesection{Introduction}subsection{Literature review}This is my literature review.subsection{Indutrial relevance}As shown in Figure ref{ruocheng}, this man feels released at this moment.begin{figure}[H] centering includegraphics[width=3cm,height=3cm]{ruocheng.png} caption{Astir} label{ruocheng}end{figure}end{document}

经过编译之后,文章现在变成了这个样子:

这里我们发现,代码里的ref{ruocheng直接变成了图片的编号,这个功能意味着我们可以按图来索引而不是记着图片序号来索引,又省了很多事。

插入reference

LaTeX相当方便的就是对reference的引用,这里我们用Harvard style作为例子。首先我们需要引入包usepackage{harvard},在代码片段的开头加入它。之后我们点击左上角的按钮添加一个文件:

然后给文件命名为mylib.bib,在这里我们就创造了一个属于我们文章的文献库了。接着我们去找文献,目前无论是google学术还是其他的学术搜索引擎都会为我们直接提供bibText格式的代码,我们首先要做的就是把bibText的那一堆代码复制粘贴到刚刚创建的mylib之中去。这里我用百度学术搜索(今天翻墙不给力)。我查找到了如下的ref:

把鼠标放到“引用”这个位置:

点击之后,再点击左下角的倒入链接bibTex:

这时会自动跳出新网页页面:

将这段代码复制粘贴入我们刚创建的mylib.bib之中。然后我们在原文章代码的最底部写上以下代码:

bibliographystyle{agsm} %其他选项包括dcubibliography{mylib}

这时我们在原文章中写上我们需要引用文献的语句:“According to the research from cite{Adam2008Sustainable}, urban planing and design is cool!” 代码如下:

documentclass{article}usepackage[utf8]{inputenc}usepackage{graphicx}usepackage{float}usepackage{harvard}title{First project}author{750763559 }date{August 2018}begin{document}maketitlesection{Introduction}subsection{Literature review}This is my literature review.subsection{Indutrial relevance}As shown in Figure ref{ruocheng}, this man feels released at this moment.begin{figure}[H] centering includegraphics[width=3cm,height=3cm]{ruocheng.png} caption{Astir} label{ruocheng}end{figure}noindentAccording to the research from cite{Adam2008Sustainable}, urban planing and design is cool!bibliographystyle{agsm} %其他选项包括dcubibliography{mylib}end{document}

编译之后右半边页面输出的文章样式变成了:

接下来我们插入第二个reference,用相同的操作获得刚刚找到的第二个链接的bibTex格式的代码,复制它到mylib.bib之中,现在我们的mylib.bib文献库变成了这个样子:

这时我们再点回main.tex,写入我们要引用该文献的句子:“Only because of the research from cite{Nasar1994Urban} that I finally understand the beauty of havard style!”。这时我们的maintext里的代码变成了:

title{First project}author{750763559 }date{August 2018}begin{document}maketitlesection{Introduction}subsection{Literature review}This is my literature review.subsection{Indutrial relevance}As shown in Figure ref{ruocheng}, this man feels released at this moment.begin{figure}[H] centering includegraphics[width=3cm,height=3cm]{ruocheng.png} caption{Astir} label{ruocheng}end{figure}noindentAccording to the research from cite{Adam2008Sustainable}, urban planing and design is cool! Only because of the research from cite{Nasar1994Urban} that I finally understand the beauty of havard style!bibliographystyle{agsm} %其他选项包括dcubibliography{mylib}end{document}

经过编译之后文章变成了:

LaTeX的自动排版是不是非常方便。
现在我们总结一下插入reference(以havard style为标准)的步骤:
1.首先在代码里加入usepackage{havard}
2.在文章末端插入两行代码用来显示我们已经引用的references。
3.创建一个新的文件格式为bib,命名为mylib.bib(当然你也可以用别的名字)。
4.在学术网站上找到bibTex格式的代码,复制粘贴它到mylib之中。
5.在原文中想要引用时,写上代码cite{}, 大括号里面要写上你想要加的reference在我们文献库中的第一行标题,系统可以通过这个自动索引到我们要找到reference。
现在我们已经明白最基础的LaTeX知识,可以上手尝试写文章了!

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。