文章目录
CTEX官网,在线帮助文档,各种发行版资源
文件类型
*.bst : bibliographic style files参考文献格式文件,elsevier的类文件elsarticlr.cls提供了三种bst文件
- elsarticle-num.bst: used for the numbered scheme
- elsarticle-num-names.bst : for numbered with new options of natbib.sty. It is enabled by the natbib.sty
- elsarticle-harv.bst : for the author year scheme.It is enabled by the natbib.sty too.
宏包
LaTeX 有所谓宏包的概念,\usepackage{foo} 即可使用宏包 foo 中定义的内容。所谓宏包就是一些写好的内容打包出来以便大家使用而已。这跟 C 语言的 include 是一致的,将文件加载进来进行使用。利用宏包,我们可以使用很多现成的好用的样式。
其实宏包,就是一系列控制序列的合集。这些控制序列太常用,以至于人们会觉得每次将他们写在导言区太过繁琐,于是将他们打包放在同一个文件中,台湾方面称之为「巨集套件」,哈哈哈
常用快捷键
ctrl+T 注释,块注释
crtl+U 取消注释
ctrl+Q退出
Delete Line : Ctrl+K
Go to line : Ctrl+G
Go Back : Alt+Left
Go Forward : Alt+Right
Bibliography : F8
Glossary : F9
F6编译
F5编译和打开pdf
按escape,关掉预览pdf,F7打开预览pdf(view)
texstudio VS texworks
-
源文件有中文时:
texworks必须写\documentclass{ctexart}才可以正确编译
texstudio写\documentclass{article}也可以正确编译,只是有关中文的直接忽略不输出,对应位置用空白代替,整个文章里面正确编译的东西还是会输出 -
texstudio有自动补齐功能,太爽了,texworks没有
命令行查看latex文档
C:\Users\Administrator>texdoc texdoc
C:\Users\Administrator>texdoc article
第一句代码直接打开文件texdoc.pdf, 路径D:\texlive\2019\texmf-dist\doc\support\texdoc,这里还有编译生成texdoc.pdf文件的源码texdoc.tex
第二句代码直接打开classes.pdf
在texlive的安装路径下有很多doc文件,说明各种宏包的用法等,而且基本都有配套的tex源代码
中文编译xelatex VS pdflatex
当源文件名中带有中文时,使用XeLaTeX 编译将出错,此时可以将文件名改为非中文名(例如数字和字母组合),重新编译,即可解决问题。或者换用 PDFLaTeX 进行编译也可以解决问题。
但源文件中有中文,则应该使用xelatex搭配\documentclass{ctexart},完美显示中文
如果使用文件类\documentclass{ctexart}搭配 pdflatex 编译就会产生中文乱码现象
latex文章结构
所有的LaTeX文章都包含两部分,导言区preamble和正文body
导言区(preamble):从源文件第一行到\begin{document}之间的所有内容
主要是引入一些宏包和用户定制的命令
The preamble of an article is everything from the first line of the source file down to the line
\begin{document}
导言区的指令instructions是影响整篇文章的,实际上导言区唯一需要的指令只有\documentclass{},其他的都可选,比如\usepackage{},然后用户自定义的,命令也放在这里
\usepackage{graphicx}画图要用
The preamble concludes with the proclamations. 导言区以proclamations结束
proclamations:A proclamation is a theorem, lemma, definition, corollary, note, or other similar construct. The intrart.tex article
defines four proclamations.
如:
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{definition}{Definition}
\newtheorem{notation}{Notation}
正文:\begin{document}和\end{document}之间的内容
正文被分为几部分,top matter,main matter, back matter
top matter
the top matter containing title page information and the abstract题目页和摘要
不包括\begin{document}
包括\maketitle
如
main matter
back matter
参考书目
正文结束,就写参考书目
At the end of the body, the bibliographic entries are typed between the lines
\begin{thebibliography}{9}
and
\end{thebibliography}
There are fewer than 10 references in this article, so we tell LATEX to make room for
single-digit numbering by providing the argument 9 to the thebibliography environment. We use 99 if the number of references is between 10 and 99. The typeset
bibliography is titled References.
用texlive的bmeps转换图像格式,jpg to eps
Microsoft Windows [版本 10.0.17134.112]
(c) 2018 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>F:
F:\>cd latexprojects
F:\latexprojects>cd samples
F:\latexprojects\samples>bmeps bianmu.jpg bianmu.eps
F:\latexprojects\samples>
在latex中显示图片
\begin{figure}[hbt]
\centering\includegraphics{bianmu}
\caption{}\label{Fi:bianmu}
\end{figure}
但是图像环境是float漂浮的,即latex来决定图像到底放在哪里。
另外要说的是,latex并不是只能够显示eps格式的图像,jpg也可以的
% 图像环境
\begin{figure}[hbt]
\centering\includegraphics{SCENE}
\caption{scene}\label{Fi:SCENE}
\end{figure}