LATEX是一个文档准备系统 (Document Preparing System),它非常适用于生成高印刷质量的科技类和数学类文档。它也能够生成所有其他种类的文档,小到简单的信件,大到完整的书籍。LATEX 使用 TEX作为它的排版引擎。LaTeX是一种“非所见即所得”的排版系统,用户需要输入特定的代码,保存在后缀为.tex的文件中,通过编译得到所需的pdf文件。

安装LaTeX与VS Code配置环境

安装Tex Live

下载地址:texlive2023.iso,有效期限:永久有效

右键 install-tl-windows,单击以管理员身份运行,进入安装界面,下面的选项安可选择不安装 TeXworks 前段,设置完安装路径等选项之后点击“安装”,之后静坐 20 分钟 - 3 小时等待安装完成。一定不要点击“Abort”!!!

image-20230912235544547

检查安装是否正常: 按win + R 打开运行,输入cmd,打开命令行窗口;然后输入命令xelatex -v ,如下图,若输出了一些版本信息,则安装正常。

image-20230913000053266

安装SumatraPDF

SumatraPDF比Workshop 插件自带的PDF软件打开速度更快,同时支持双向查找功能,进入官网,Sumatra PDF reader download page,下载完成后,点击exe文件进行安装,修改安装目录一键安装就行,记好文件的安装路径。

安装VS Code插件

在扩展商店安装 LaTeX Workshop 插件,在扩展中搜索LaTeX Workshop,下载第一个插件,等待下载完成。

image-20230914195609741

配置Workshop 插件

在 VSCode 界面下按下 F1,然后键入“setjson”,点击“首选项: 打开设置(JSON)”,将以下代码放入设置区:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{
//------------------------------LaTeX 配置----------------------------------
// 设置是否自动编译
"latex-workshop.latex.autoBuild.run":"never",
//右键菜单
"latex-workshop.showContextMenu":true,
//从使用的包中自动补全命令和环境
"latex-workshop.intellisense.package.enabled": true,
//编译出错时设置是否弹出气泡设置
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
// 编译工具和命令
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
// 用于配置编译链
"latex-workshop.latex.recipes": [
{
"name": "XeLaTeX",
"tools": [
"xelatex"
]
},
{
"name": "PDFLaTeX",
"tools": [
"pdflatex"
]
},
{
"name": "BibTeX",
"tools": [
"bibtex"
]
},
{
"name": "LaTeXmk",
"tools": [
"latexmk"
]
},
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
//文件清理。此属性必须是字符串数组
"latex-workshop.latex.clean.fileTypes": [
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk"
],
//设置为onFaild 在构建失败后清除辅助文件
"latex-workshop.latex.autoClean.run": "onFailed",
// 使用上次的recipe编译组合
"latex-workshop.latex.recipe.default": "lastUsed",
// 用于反向同步的内部查看器的键绑定。ctrl/cmd +点击(默认)或双击
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",

//使用 SumatraPDF 预览编译好的PDF文件
// 设置VScode内部查看生成的pdf文件
"latex-workshop.view.pdf.viewer": "external",
// PDF查看器用于在\ref上的[View on PDF]链接
"latex-workshop.view.pdf.ref.viewer":"auto",
// 使用外部查看器时要执行的命令。此功能不受官方支持。
"latex-workshop.view.pdf.external.viewer.command": "C:/Users/yyq09/AppData/Local/SumatraPDF/SumatraPDF.exe", // 注意修改路径,注意修改路径,注意修改路径(重要的事情说三遍)
// 使用外部查看器时,latex-workshop.view.pdf.external.view .command的参数。此功能不受官方支持。%PDF%是用于生成PDF文件的绝对路径的占位符。
"latex-workshop.view.pdf.external.viewer.args": [
"%PDF%"
],
// 将synctex转发到外部查看器时要执行的命令。此功能不受官方支持。
"latex-workshop.view.pdf.external.synctex.command": "C:/Users/yyq09/AppData/Local/SumatraPDF/SumatraPDF.exe", // 注意修改路径,注意修改路径,注意修改路径(重要的事情说三遍)
// latex-workshop.view.pdf.external.synctex的参数。当同步到外部查看器时。%LINE%是行号,%PDF%是生成PDF文件的绝对路径的占位符,%TEX%是触发syncTeX的扩展名为.tex的LaTeX文件路径。
"latex-workshop.view.pdf.external.synctex.args": [
"-forward-search",
"%TEX%",
"%LINE%",
"-reuse-instance",
"-inverse-search",
"\"C:/Users/yyq09/AppData/Local/Programs/Microsoft VS Code/Code.exe\" \"C:/Users/yyq09/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js\" -r -g \"%f:%l\"", // 注意修改路径,注意修改路径,注意修改路径(重要的事情说三遍)
"%PDF%"
],
}

一份介绍LaTeX的PDF

文件:一份不太简的latex介绍.pdf,有效期限:永久有效

代码基本组成

1
2
3
4
5
6
7
8
9
10
11
12
13
14
% 源代码以一个 \documentclass 命令作为开头,它指定了文档使用的文档类。文档类规定了 LATEX 源代码所要生成的文档的性质——普通文章、书籍、演示文稿、个人简历等等。document 环境当中的内容是文档正文。
\documentclass[UTF8,titlepage,12pt]{ctexart}

%在 \documentclass 和 \begin{document} 之间的位置称为导言区。在导言区中常会使用\usepackage 命令调用宏包,还会进行文档的全局设置。
\usepackage[⟨options⟩]{⟨package-name⟩}
\usepackage{geometry} % 设置页边距的宏包
\usepackage{graphicx} % 插入图片宏包

\begin{document}

这里面写的是论文内容

\end{document}
% 此后内容会被忽略

文档类

源代码的开头须用\documentclass 指定文档类,

1
2
3
4
5
6
\documentclass[⟨options⟩]{⟨class-name⟩}

% 其中 ⟨class-name⟩ 为文档类的名称,如 LATEX 提供的 article、report、book,在其基础上派生的一些文档类,如支持中文排版的 ctexart、ctexrep、ctexbook,或者有其它功能的一些文档类,如 moderncv、beamer 等。

%可选参数 ⟨options⟩ 为文档类指定选项,以全局地规定一些排版的参数,如字号、纸张大小、单双面等等。比如调用 article 文档类排版文章,指定纸张为 A4 大小,基本字号为 11pt,双面排版:
\documentclass[11pt,twoside,a4paper]{article}

image-20230914201227627

image-20230915133931785

宏包

1
2
3
4
\usepackage[⟨options⟩]{⟨package-name⟩}

% 在 Windows 命令提示符或者Linux 终端下输入命令可查阅相应文档
texdoc ⟨pkg-name⟩

过程文件说明

image-20230915135121529

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
% LaTeX提供了命令 \include 用来在源代码里插入文件:

\include{⟨filename⟩}
% ⟨filename⟩ 为文件名(不带 .tex 扩展名)10,如果和要编译的主文件不在一个目录中,则要加上相对或绝对路径
\include{D:/file} % Windows 绝对路径,用正斜线

% \include 在读入 ⟨filename⟩ 之前会另起一页。有的时候我们并不需要这样,而是用 \input 命令,它纯粹是把文件里的内容插入:
\input{⟨filename⟩}
% 当导言区内容较多时,常常将其单独放置在一个 .tex 文件中,再用 \input 命令插入。复杂的图、表、代码等也会用类似的手段处理。
% LaTeX还提供了一个 \includeonly 命令来组织文件,用于导言区,指定只载入某些文件。导言区使用了 \includeonly 后,正文中不在其列表范围的 \include 命令不会起效:

% 介绍一个实用的工具宏包 syntonly。加载这个宏包后,在导言区使用 \syntaxonly 命令,可令LaTeX编译后不生成 DVI 或者 PDF 文档,只排查错误,编译速度会快不少:
\usepackage{syntonly}
\syntaxonly
% 如果想生成文档,则用 % 注释掉 \syntaxonly 命令即可。

功能源代码

最简单的源代码示例

1
2
3
4
\documentclass{article}
\begin{document}
``Hello world!'' from \LaTeX.
\end{document}

排版中文的最简源代码示例

ctex 宏包本身用于配合各种文档类排版中文,而 ctex 文档类对LATEX 的标准文档类进行了封装,对一些排版根据中文排版习惯做了调整,包括 ctexart、ctexrep、ctexbook 等。ctex 宏包和文档类能够识别操作系统和 TEX 发行版中安装的中文字体,因此基本无需额外配置即可排版中文文档。下面举一个使用 ctex 文档类排版中文的最简例子:

1
2
3
4
\documentclass{ctexart}
\begin{document}
“你好,世界!”来自 \LaTeX{} 的问候。
\end{document}

排版文字

字符

空格:空格键和 Tab 键输入的空白字符视为“空格”。连续的若干个空白字符视为一个空格。一行开头的空格忽略不计。行末的换行符视为一个空格;

分段:连续两个换行符,也就是空行,会将文字分段。多个空行被视为一个空行。也可以在行末使用 \par 命令分段。

注释

用 % 字符作为注释。在这个字符之后直到行末,所有的字符都被忽略,行末的换行符也不引入空格。

特殊字符

如果想要输入“# $ % & { } _ ^ ~ \”符号,需要使用以下带反斜线的形式输入,类似编程语言里的“转义”符号。输入反斜线需要用 \textbackslash

连字:

西文排版中经常会出现连字(ligatures),常见的有 ff/fi/fl/ffi/f

image-20230915200725639

标点符号:

中文的标点符号(绝大多数为非 ASCII 字符)使用中文输入法输入即可,一般不需要过多留意。而输入西文标点符号时,有不少地方需要留意。

引号:

LATEX 中单引号 ‘ 和 ’ 分别用 ` 和 ‘ 输入;双引号 “ 和 ” 分别用 和 '' 输入(" 可以输入后双引号,但没有直接输入前双引号的字符,习惯上用 '' 输入以和 更好地对应)。

image-20230915200847438

连字号和破折号:

有三种长度的“横线”可用:连字号(hyphen)、短破折号(en-dash)和长破折号(em-dash)。它们分别有不同的用途:连字号 - 用来组成复合词;短破折号 – 用来连接数字表示范围;长破折号 — 用来连接单词,语义上类似中文的破折号。

image-20230915200927291

省略号

提供了 \ldots 命令表示省略号,相对于直接输入三个点的方式更为合理。\dots 与\ldots 命令等效。

波浪号

~ 命令,它可以用来输入波浪号,但位置靠顶端(~ 命令主要用作重音,参考下一小节)。西文中较少将波浪号作为标点符号使用,在中文环境中一般直接使用全角波浪号(~)

断行和断页

在西文排版实践中,断行的位置优先选取在两个单词之间,也就是在源代码中输入的“空格”。“空格”本身通常生成一个间距,它会根据行宽和上下文自动调整,文字密一些的地方,单词间距就略窄,反之略宽。

文字在单词间的“空格”处断行时,“空格”生成的间距随之舍去。我们可以使用字符 ~ 输入一个不会断行的空格(高德纳称之为 tie,“带子”),通常用在英文人名、图表名称等上下文环境:

image-20230915201232055

断行:

1
2
\\[⟨length⟩] \\*[⟨length⟩]
\newline

有两点区别:一是 \ 可以带可选参数 length,用于在断行处向下增加垂直间距,而 \newline 不带可选参数;二是 \ 也在表格、公式等地方用于换行,而 \newline只用于文本段落中。带星号的 \ 表示禁止在断行处分页。

image-20230915201451306

断页:

1
2
\newpage
\clearpage

通常情况下两个命令都起到另起一页的作用,区别在于:第一,在双栏排版模式中 \newpage起到另起一栏的作用,\clearpage 则能够另起一页;第二,在涉及浮动体的排版上行为不同。

有时候我们不满足于 LATEX 默认的断行和断页位置,需要进行微调,可以用以下命令告诉LATEX 哪些地方适合断行或断页,哪些地方不适合:

1
2
\linebreak[⟨n⟩] \nolinebreak[⟨n⟩]
\pagebreak[⟨n⟩] \nopagebreak[⟨n⟩]

以上命令都带一个可选参数,用数字 n 代表适合/不适合的程度,取值范围为 0–4,不带可选参数时,缺省为 4。比如 \linebreak 或者 \linebreak[4] 意味着此处需要强行断行;\nopagebreak 或 \nopagebreak[4] 意味着禁止在此处断页。

image-20230915201830496

断词

如果 LATEX 遇到了很长的英文单词,仅在单词之间的“空格”处断行无法生成疏密程度匀称的段落时,就会考虑从单词中间断开。对于绝大多数单词,LATEX 能够找到合适的断词位置,在断开的行尾加上连字符 -。如果一些单词没能自动断词,我们可以在单词内手动使用 - 命令指定断词的位置:

image-20230915201919817

章节和目录

在知道了如何输入文字后,我们将在本章了解一个结构化的文档所依赖的各种元素——章节、目录、列表、图表、交叉引用、脚注等等。

章节标题

一篇结构化的、条理清晰文档一定是层次分明的,通过不同的命令分割为章、节、小节。提供了划分章节的命令:

1
\section{⟨title⟩} \subsection{⟨title⟩} \subsubsection{⟨title⟩} \paragraph{⟨title⟩} \subparagraph{⟨title⟩}

这些命令生成章节标题,并能够自动编号。上述命令除了生成带编号的标题之外,还向目录中添加条目,并影响页眉页脚的内容,每个命令有两种变体:

image-20230915202923233

目录

只需在合适的地方使用命令:

1
\tableofcontents

这个命令会生成单独的一章(report/book)或一节(article),标题默认为“Contents”,\tableofcontents 生成的章节默认不写入目录(\section* 或\chapter*),可使用 tocbibind 等宏包修改设置。正确生成目录项,一般需要编译两次源代码。

有时我们使用了 \chapter* 或 \section* 这样不生成目录项的章节标题命令,而又想手动生成该章节的目录项,可以在标题命令后面使用:

1
\addcontentsline{toc}{⟨level⟩}{⟨title⟩}

其中 level 为章节层次 chapter 或 section 等,title 为出现于目录项的章节标题。titletoc、tocloft 等宏包提供了具体定制目录项格式的功能,详情请参考宏包的帮助文档。

文档结构的划分:

所有标准文档类都提供了一个 \appendix 命令将正文和附录分开,使用 \appendix 后,最高一级章节改为使用拉丁字母编号,从 A 开始。

image-20230915203436425

以上三个命令还可和 \appendix 命令结合,生成有前言、正文、附录、后记四部分的文档。

标题页

LATEX 支持生成简单的标题页。首先需要给定标题和作者等信息:

1
\title{⟨title⟩} \author{⟨author⟩} \date{⟨date⟩}

在 \title、\author等命令内可以使用 \thanks 命令生成标题页的脚注,用 \and 隔开多个人名。在信息给定后,就可以使用 \maketitle 命令生成一个简单的标题页了。

article 文档类的标题默认不单独成页,而 report 和 book 默认单独成页。可在 \documentclass 命令调用文档类时指定 titlepage 或 notitlepage 选项以修改默认的行为。LATEX 标准类还提供了一个简单的 titlepage 环境,生成不带页眉页脚的一页。

交叉引用

交叉引用是 LATEX 强大的自动排版功能的体现之一。在能够被交叉引用的地方,如章节、公式、图表、定理等位置使用 \label 命令:

1
\label{⟨label-name⟩}

之后可以在别处使用 \ref 或 \pageref 命令,分别生成交叉引用的编号和页码:

1
\ref{⟨label-name⟩} \pageref{⟨label-name⟩}

image-20230915204639049

为了生成正确的交叉引用,一般也需要多次编译源代码。\label 命令可用于记录各种类型的交叉引用,使用位置分别为:

image-20230915204702640

在使用不记编号的命令形式(\section、\caption、带可选参数的 \item 命令等)时不要使用 \label 命令,否则生成的引用编号不正确。

脚注和边注

使用 \footnote 命令可以在页面底部生成一个脚注:

1
\footnote{⟨footnote⟩}

使用 \marginpar 命令可在边栏位置生成边注:

1
\marginpar[⟨left-margin⟩]{⟨right-margin⟩}

如果只给定了 right-margin,那么边注在奇偶数页文字相同;如果同时给定了 left-margin,则偶数页使用 left-margin 的文字。

特殊环境

列表

LATEX 提供了基本的有序和无序列表环境 enumerate 和 itemize,两者的用法很类似,都用 \item 标明每个列表项。enumerate 环境会自动对列表项编号。

1
2
3
4
5
\begin{enumerate}
\item
\end{enumerate}

% 其中 \item 可带一个可选参数,将有序列表的计数或者无序列表的符号替换成自定义的符号。列表可以嵌套使用,最多嵌套四层。

image-20230915210026309

image-20230915210052049

关键字环境 description 的用法与以上两者类似,不同的是 \item 后的可选参数用来写关键字,以粗体显示,一般是必填的:

1
2
3
\begin{description}
\item[⟨item title⟩] …
\end{description}

image-20230915210203022

对齐环境

center、flushleft 和 flushright 环境分别用于生成居中、左对齐和右对齐的文本环境。

1
2
3
\begin{center} … \end{center}
\begin{flushleft} … \end{flushleft}
\begin{flushright} … \end{flushright}

除此之外,还可以用以下命令直接改变文字的对齐方式:

1
\centering \raggedright \raggedleft

image-20230915210420071

center 等环境会在上下文产生一个额外间距,而 \centering 等命令不产生,只是改变对齐方式。比如在浮动体环境 table 或 figure 内实现居中对齐,用 \centering 命令即可,没必要再用 center 环境。

引用环境

LATEX 提供了两种引用的环境:quote 用于引用较短的文字,首行不缩进;quotation 用于引用若干段文字,首行缩进。引用环境较一般文字有额外的左右缩进。

摘要环境

摘要环境 abstract 默认只在标准文档类中的 article 和 report 文档类可用,一般用于紧跟\maketitle 命令之后介绍文档的摘要。如果文档类指定了 titlepage 选项,则单独成页;反之,单栏排版时相当于一个居中的小标题加一个 quotation 环境,双栏排版时相当于 \section* 定义的一节。

代码环境

代码环境 verbatim,它以等宽字体排版代码,回车和空格也分别起到换行和空位的作用;带星号的版本更进一步将空格显示成“␣”

image-20230915211009094

要排版简短的代码或关键字,可使用 \verb 命令:

1
\verbdelim⟩⟨code⟩⟨delim⟩

delim 标明代码的分界位置,前后必须一致,除字母、空格或星号外,可任意选择使得不与代码本身冲突,习惯上使用 | 符号。同 verbatim 环境,\verb 后也可以带一个星号,以显示空格:

image-20230915211131414

\verb 命令对符号的处理比较复杂,一般不能用在其它命令的参数里,否则多半会出错。

verbatim 宏包优化了 verbatim 环境的内部命令,并提供了 \verbatiminput 命令用来直接读入文件生成代码环境。fancyvrb 宏包提供了可定制格式的 Verbatim 环境;listings 宏包更进一步,可生成关键字高亮的代码环境,支持各种程序设计语言的语法和关键字。

表格

LATEX 里排版表格不如 Word 等所见即所得的工具简便和自由,不过对于不太复杂的表格来讲,完全能够胜任。排版表格最基本的 tabular 环境用法为:

1
2
3
4
5
\begin{tabular}[⟨align⟩]{⟨column-spec⟩}
⟨item1⟩ & ⟨item2⟩ &\\
\hline
⟨item1⟩ & ⟨item2⟩ &\\
\end{tabular}

其中 column-spec 是列格式标记,在接下来的内容将仔细介绍;& 用来分隔单元格;\ 用来换行;\hline 用来在行与行之间绘制横线。

直接使用 tabular 环境的话,会和周围的文字混排。此时可用一个可选参数 align 控制垂直对齐:t 和 b 分别表示按表格顶部、底部对齐,其他参数或省略不写(默认)表示居中对齐。

image-20230915211730441

但是通常情况下 tabular 环境很少与文字直接混排,而是会放在 table 浮动体环境中,并用 \caption 命令加标题。

列格式

tabular 环境使用 column-spec 参数指定表格的列数以及每列的格式。

image-20230915211826114

表格中每行的单元格数目不能多于列格式里 l/c/r/p 的总数(可以少于这个总数),否则出错。

@ 格式可在单元格前后插入任意的文本,但同时它也消除了单元格前后额外添加的间距。@格式可以适当使用以充当“竖线”。特别地,@{} 可直接用来消除单元格前后的间距:

image-20230915212227554

列宽

在控制列宽方面,LATEX 表格有着明显的不足:l/c/r 格式的列宽是由文字内容的自然宽度决定的,而 p 格式给定了列宽却不好控制对齐(可用 array 宏包的辅助格式),更何况列与列之间通常还有间距,所以直接生成给定总宽度的表格并不容易。

tabularx 宏包为我们提供了方便的解决方案。它引入了一个 X 列格式,类似 p 列格式,不过会根据表格宽度自动计算列宽,多个 X 列格式平均分配列宽。X 列格式也可以用 array 里的辅助格式修饰对齐方式:

image-20230915213417917

横线

我们已经在之前的例子见过许多次绘制表格线的 \hline 命令。另外 \cline{i-j} 用来绘制跨越部分单元格的横线:

image-20230915213527433

在科技论文排版中广泛应用的表格形式是三线表,形式干净简明。三线表由 booktabs 宏包支持,它提供了 \toprule、\midrule 和 \bottomrule 命令用以排版三线表的三条线,以及和\cline 对应的 \cmidrule。除此之外,最好不要用其它横线以及竖线:

image-20230915213558255

合并单元格

LATEX 是一行一行排版表格的,横向合并单元格较为容易,由 \multicolumn 命令实现:

1
\multicolumn{⟨n⟩}{⟨column-spec⟩}{⟨item⟩}

其中 n 为要合并的列数,column-spec 为合并单元格后的列格式,只允许出现一个 l/c/r 或p 格式。如果合并前的单元格前后带表格线 |,合并后的列格式也要带 | 以使得表格的竖线一致。

image-20230915213802887

上面的例子还体现了,形如 \multicolumn{1}{column-spec}{item} 的命令可以用来修改某一个单元格的列格式。

纵向合并单元格需要用到 multirow 宏包提供的 \multirow 命令:

1
\multirow{⟨n⟩}{⟨width⟩}{⟨item⟩}

width 为合并后单元格的宽度,可以填 * 以使用自然宽度。

image-20230915213946338

行距控制

LATEX 生成的表格看起来通常比较紧凑。修改参数 \arraystretch 可以得到行距更加宽松的表格。

image-20230915214139736

完整代码案例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
\documentclass[UTF8,titlepage,12pt]{ctexart}

\usepackage{caption} % 去除图例、表头的冒号的宏包
\usepackage{float} % 设置图片浮动位置的宏包
\usepackage{geometry} % 设置页边距的宏包
\usepackage{graphicx} % 插入图片宏包
\usepackage{cite} % 导入引用的包,能够使用\cite
\usepackage{amsthm,amsmath,amssymb,mathrsfs}
\newcommand{\upcite}[1]{\textsuperscript{\cite{#1}}} % 自定义上标引用文献
\usepackage{setspace} % 控制封面中的行间距
\newcommand{\huawenxingkai}{\CJKfamily{hwxk}} % 使用STXingkai华文行楷字体
\usepackage{pdfpages} %用于导入外部PDF文件页
\newcommand {\tabfont}[1]{\small {\kaishu {#1}}} % 自定义表格字体(局部使用):小号楷书
\usepackage{booktabs} % 表格顶部加粗线\toprule命令的宏包
\usepackage{fancyhdr} % 用于生成页眉的宏包
\usepackage{fontspec}
\usepackage{amsmath} % 让公式按照章节编号
\usepackage{titlesec} % 设置章节条的字体字号
\usepackage{algorithm} % 编写伪代码的宏包
\usepackage{algpseudocode} % 编写伪代码的宏包

\newfontfamily\headingfont[]{SimHei}
\titleformat{\section}[hang]
{\bfseries\headingfont\fontsize{16pt}{16pt}\selectfont\centering}{\thesection}{0.5em}{}[]
\titleformat{\subsection}[hang]
{\bfseries\headingfont\fontsize{12pt}{12pt}\selectfont}{\thesubsection}{0.5em}{}[]
\titleformat{\subsubsection}[hang]
{\bfseries\headingfont\fontsize{12pt}{12pt}\selectfont}{\thesubsubsection}{0.5em}{}[]

\numberwithin{equation}{section} % 让公式按照章节编号
\setmainfont{Times New Roman} % 设置英文字体为新罗马
\geometry {a4paper,left=3.0cm,right=2.0cm,top=3.1cm,bottom=2.5cm} % 设置页边距
\bibliographystyle{unsrt} % 参考文献排版风格(unsrt: 按照引用的先后排序, plain: 按字母的顺序排列,比较次序为作者、年度和标题)
\def\bibfont{\fontsize{16}{10}\selectfont}
\captionsetup{labelformat=default,labelsep=space} %去除图例、表头的冒号,需要\usepackage{caption}宏包
\linespread{1.5} % 1.5倍行距
\setCJKfamilyfont{hwxk}{STXingkai} % 使用STXingkai华文行楷字体
\pagestyle{fancy} % 用于生成页眉
\fancyhf{} % 用于清除默认页眉版式
\chead{\fontsize{10.4pt}{15pt}\selectfont 北京航空航天大学电子信息工程学院} % 页眉内容(字体大小,行距,内容)
\cfoot{\thepage} % 页码位于页脚居中
% \setlength{\headheight}{36.0pt} % 防止\headheight的太小报错(此报错与添加与页眉相关)
\setlength{\headheight}{36.0pt}

\begin{document}

\includepdf[pages={1-5}]{./Insert PDF/Cover.pdf}
\thispagestyle{empty}

\clearpage % 另起一页

\fancyhf{}
\fancyhead[L]{
\begin{minipage}[c]{0.06\textwidth}
\includegraphics[height=12.0mm]{graphics/buaamark.pdf}
\end{minipage}
}
\fancyhead[C]{\heiti{\fontsize{14.0pt}{5pt}\selectfont\:\:\:\:\:\:\:\:\:\:\:计(论\:文)}}
\fancyhead[R]{\fontsize{10.5pt}{5pt}\selectfont\thepage 页}

\includepdf[pages={1,2}]{./Insert PDF/Abstract.pdf}
\clearpage % 另起一页

\setcounter{tocdepth}{3} %设定目录深度为3,即只显示到三级标题为止
{\tableofcontents
} % 生成目录,并设置目录页页眉

\clearpage % 另起一页


\setcounter{page}{1} % 设置页码为第一页
\section{绪论}
\subsection{课题背景及目的}

这里可以写课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的、课题背景及目的。

% 这里是引用图片的方式
\begin{figure}[H]
\centering
\includegraphics[width=0.7\textwidth]{Pictures/1.png}
\caption{\kaishu{这里是引用图片的说明}}
\end{figure}

论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容。


\subsection{国内外研究现状}

这里可以写国内外研究现状\upcite{VQA_Method},国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状、国内外研究现状\ref{fig:fig2}。

\begin{figure}[H]
\centering
\includegraphics[width=0.9\textwidth]{Pictures/2.png}
\caption{\kaishu{GVQA模型流程示意\upcite{GVQA}}}
\label{fig:fig2}
\end{figure}

论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容。

\clearpage % 另起一页
\section{新一个一级标题}

标题说明、标题说明、标题说明、标题说明、标题说明、标题说明、标题说明、标题说明、标题说明。

\subsection{新一个二级标题}
\subsubsection{新一个三级标题}
论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容。

% 这里是输入公式
\begin{equation}
\operatorname{IoU}(X, Y)=\frac{X \bigcap Y}{X \bigcup Y}
\end{equation}
论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容。

\begin{equation}
\left\{
\begin{aligned}
t_{x}&=\left(x-x_{a}\right) / w_{a} \\
t_{y}&=\left(y-y_{a}\right) / h_{a} \\
t_{w}&=\log \left(w / w_{a}\right) \\
t_{h}&=\log \left(h / h_{a}\right)
\end{aligned}
\right.
\end{equation}

论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容。

% 这里是绘制表格
\begin{table}[H]
\renewcommand\arraystretch{1.5} % 调整表格行间距
\begin{center}
\caption{\kaishu 这里是表格的标题}
\begin{tabular}{c|c|c}
\toprule % 表格顶部加粗线
\hline
\tabfont{第一列} & \tabfont{第二列} & \tabfont{第三列}\\
\hline
\tabfont{Class Accuracy} & \tabfont{$54.46\%$} & \tabfont{$54.96\%$}\\
\hline
\tabfont{clsAc@3} & \tabfont{$77.53\%$} & \tabfont{$77.70\%$}\\
\hline
\tabfont{clsAc@5} & \tabfont{$83.97\%$} & \tabfont{$84.24\%$}\\
\hline
\tabfont{clsAc@10} & \tabfont{$90.01\%$} & \tabfont{$90.23\%$}\\
\hline
\bottomrule % 表格底部加粗线
\end{tabular}
\end{center}
\end{table}

% 这里是代码位置
\begin{algorithm}[H]
\caption{辅助梯度监督集成算法}
\begin{algorithmic}[0] % 0:不显示行号,1:显示每行行号
\Require 主客体对关系频率统计张量,编码数据矩阵,稀有阈值$\alpha_{rare}$,GS Loss权重$\lambda$
\For {$i\ in$ 主体序列$\{1, 2, ... ,1702\}$}
\For {$j\ in$ 客体序列$\{1, 2, ... ,1702\}$}
\State 寻找$(i,j)$物体对出现频率最高的关系m,其频率为$max$
\State $threshold = max \times \alpha_{rare}$
\For {$k\ in$ $(i,j)$关系序列\{1, 2, ... ,310\}}
\If {$k$号关系出现次数 $< threshold$}
\State 调用k号关系的编码数据矩阵$\boldsymbol{X}_{i}$
\State 输入到全连接层进行关系预测
\State 计算关系预测损失$\mathcal{L}_{\text {Rel}}$
\State 第一次反向梯度传播得到在输入处的梯度$\hat{\boldsymbol{G}}_{i}$
\State 抽取m号关系的编码数据矩阵$\boldsymbol{X}_{j}$,保持与$\boldsymbol{X}_{i}$规模一致
\State 计算$\boldsymbol{G}_i=\boldsymbol{X}_{i}-\boldsymbol{X}_{j}$
\State 计算$\mathcal{L}_{\mathrm{GS}}\left(\boldsymbol{G}_{i}, \hat{\boldsymbol{G}}_{i}\right)=1-\left(\boldsymbol{G}_{i} \cdot \hat{\boldsymbol{G}}_{i}\right) /\left(\left\|\boldsymbol{G}_{i}\right\|\left\|\hat{\boldsymbol{G}}_{i}\right\|\right)$
\State 计算总损失$\mathcal{L}=\mathcal{L}_{\text {Rel}}+\lambda \mathcal{L}_{\mathrm{GS}}$
\State 第二次反向梯度传播
\State 更新模型参数
\EndIf
\EndFor
\EndFor
\EndFor
\end{algorithmic}
\end{algorithm}

论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容、论文内容。

\clearpage % 另起一页
\section*{结论}
\addcontentsline{toc}{section}{结论}

这里是结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论、结论。

\clearpage % 另起一页
\section*{致谢}
\addcontentsline{toc}{section}{致谢}

这里是致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢、致谢。

\clearpage % 另起一页
\addcontentsline{toc}{section}{参考文献}
\bibliography{Reference} % 导入参考文献(.bib)
\end{document}

参考文献Reference.bib如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
@InProceedings{GVQA,
author = {Agrawal, Aishwarya and Batra, Dhruv and Parikh, Devi and Kembhavi, Aniruddha},
title = {Don't Just Assume; Look and Answer: Overcoming Priors for Visual Question Answering},
booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2018}
}

@InProceedings{Teney_Multi_Environments,
author = {Teney, Damien and Abbasnejad, Ehsan and van den Hengel, Anton},
title = {Unshuffling Data for Improved Generalization in Visual Question Answering},
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
month = {October},
year = {2021}
}

@InProceedings{What_Makes_a_Difference,
author="Teney, Damien
and Abbasnedjad, Ehsan
and van den Hengel, Anton",
editor="Vedaldi, Andrea
and Bischof, Horst
and Brox, Thomas
and Frahm, Jan-Michael",
title="Learning What Makes a Difference from Counterfactual Examples and Gradient Supervision",
booktitle="Computer Vision -- ECCV 2020",
year="2020",
publisher="Springer International Publishing",
address="Cham"
}

@article{Ensemble_based_methods,
author = {Christopher Clark and Mark Yatskar and Luke Zettlemoyer},
title = {Don't Take the Easy Way Out: Ensemble Based Methods for Avoiding Known Dataset Biases},
journal = {CoRR},
year = {2019},
url = {http://arxiv.org/abs/1909.03683},
eprinttype = {arXiv},
eprint = {1909.03683},
timestamp = {Tue, 17 Sep 2019 11:23:44 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1909-03683.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{Causality_2000,
title={CAUSALITY: MODELS, REASONING, AND INFERENCE, by Judea Pearl, Cambridge University Press, 2000},
journal={Econometric Theory},
publisher={Cambridge University Press},
author={Neuberg, Leland Gerson},
year={2003}
}

@InProceedings{He_2020_CVPR,
author = {He, Kaiming and Fan, Haoqi and Wu, Yuxin and Xie, Saining and Girshick, Ross},
title = {Momentum Contrast for Unsupervised Visual Representation Learning},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}
}

@inproceedings{Learning_to_Contrast,
title = "Learning to Contrast the Counterfactual Samples for Robust Visual Question Answering",
author = "Liang, Zujie and
Jiang, Weitao and
Hu, Haifeng and
Zhu, Jiaying",
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.emnlp-main.265",
doi = "10.18653/v1/2020.emnlp-main.265"
}

@InProceedings{Cascade_RCNN,
author = {Cai, Zhaowei and Vasconcelos, Nuno},
title = {Cascade R-CNN: Delving Into High Quality Object Detection},
booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2018}
}

@InProceedings{SSD,
author="Liu, Wei
and Anguelov, Dragomir
and Erhan, Dumitru
and Szegedy, Christian
and Reed, Scott
and Fu, Cheng-Yang
and Berg, Alexander C.",
editor="Leibe, Bastian
and Matas, Jiri
and Sebe, Nicu
and Welling, Max",
title="SSD: Single Shot MultiBox Detector",
booktitle="Computer Vision -- ECCV 2016",
year="2016",
publisher="Springer International Publishing",
address="Cham",
pages="21--37"
}

@InProceedings{YOLO,
author = {Redmon, Joseph and Divvala, Santosh and Girshick, Ross and Farhadi, Ali},
title = {You Only Look Once: Unified, Real-Time Object Detection},
booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2016}
}

@inproceedings{Attention_is_All_you_Need,
author = {Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and Uszkoreit, Jakob and Jones, Llion and Gomez, Aidan N and Kaiser, \L ukasz and Polosukhin, Illia},
booktitle = {Advances in Neural Information Processing Systems},
editor = {I. Guyon and U. Von Luxburg and S. Bengio and H. Wallach and R. Fergus and S. Vishwanathan and R. Garnett},
pages = {},
publisher = {Curran Associates, Inc.},
title = {Attention is All you Need},
url = {https://proceedings.neurips.cc/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf},
volume = {30},
year = {2017}
}

@article{VQA_v1,
author = {Aishwarya Agrawal and
Dhruv Batra and
Devi Parikh},
title = {Analyzing the Behavior of Visual Question Answering Models},
journal = {CoRR},
volume = {abs/1606.07356},
year = {2016},
url = {http://arxiv.org/abs/1606.07356},
eprinttype = {arXiv},
eprint = {1606.07356},
timestamp = {Mon, 13 Aug 2018 16:48:39 +0200},
biburl = {https://dblp.org/rec/journals/corr/AgrawalBP16.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}

@InProceedings{VQA_v2,
author = {Goyal, Yash and Khot, Tejas and Summers-Stay, Douglas and Batra, Dhruv and Parikh, Devi},
title = {Making the v in VQA Matter: Elevating the Role of Image Understanding in Visual Question Answering},
booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {July},
year = {2017}
}

@article{Human_attention_map,
title = {Human Attention in Visual Question Answering: Do Humans and Deep Networks Look at the Same Regions?},
journal = {Computer Vision and Image Understanding},
year = {2017},
note = {Language in Vision},
issn = {1077-3142},
doi = {https://doi.org/10.1016/j.cviu.2017.10.001},
url = {https://www.sciencedirect.com/science/article/pii/S1077314217301649},
author = {Abhishek Das and Harsh Agrawal and Larry Zitnick and Devi Parikh and Dhruv Batra},
keywords = {Visual Question Answering, Attention}
}

@inproceedings{GAN_Edit,
author = {Shetty, Rakshith R and Fritz, Mario and Schiele, Bernt},
booktitle = {Advances in Neural Information Processing Systems},
editor = {S. Bengio and H. Wallach and H. Larochelle and K. Grauman and N. Cesa-Bianchi and R. Garnett},
pages = {},
publisher = {Curran Associates, Inc.},
title = {Adversarial Scene Editing: Automatic Object Removal from Weak Supervision},
url = {https://proceedings.neurips.cc/paper/2018/file/c911241d00294e8bb714eee2e83fa475-Paper.pdf},
volume = {31},
year = {2018}
}

@inproceedings{Faster_RCNN,
author = {Ren, Shaoqing and He, Kaiming and Girshick, Ross and Sun, Jian},
booktitle = {Advances in Neural Information Processing Systems},
editor = {C. Cortes and N. Lawrence and D. Lee and M. Sugiyama and R. Garnett},
pages = {},
publisher = {Curran Associates, Inc.},
title = {Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks},
volume = {28},
year = {2015}
}


@article{VG,
author = {Krishna, Ranjay and Zhu, Yuke and Groth, Oliver and Johnson, Justin and Hata, Kenji and Kravitz, Joshua and Chen, Stephanie and Kalantidis, Yannis and Li, Li-Jia and Shamma, David and Bernstein, Michael and Li, Fei-Fei},
year = {2017},
month = {05},
pages = {},
title = {Visual Genome: Connecting Language and Vision Using Crowdsourced Dense Image Annotations},
volume = {123},
journal = {International Journal of Computer Vision}
}


@InProceedings{GQA,
author = {Hudson, Drew A. and Manning, Christopher D.},
title = {GQA: A New Dataset for Real-World Visual Reasoning and Compositional Question Answering},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2019}
}

@InProceedings{Resnet,
author = {He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian},
title = {Deep Residual Learning for Image Recognition},
booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2016}
}

@InProceedings{Mask_RCNN,
author = {He, Kaiming and Gkioxari, Georgia and Dollar, Piotr and Girshick, Ross},
title = {Mask R-CNN},
booktitle = {Proceedings of the IEEE International Conference on Computer Vision (ICCV)},
month = {Oct},
year = {2017}
}


@InProceedings{GNN_Rel_Pred,
title = {Inductive Relation Prediction by Subgraph Reasoning},
author = {Teru, Komal and Denis, Etienne and Hamilton, Will},
booktitle = {Proceedings of the 37th International Conference on Machine Learning},
pages = {9448--9457},
year = {2020},
editor = {III, Hal Daumé and Singh, Aarti},
volume = {119},
series = {Proceedings of Machine Learning Research},
month = {13--18 Jul},
publisher = {PMLR}
}

@ARTICLE{LSTM,
author={Hochreiter, Sepp and Schmidhuber, Jürgen},
journal={Neural Computation},
title={Long Short-Term Memory},
year={1997},
volume={9},
number={8},
pages={1735-1780},
doi={10.1162/neco.1997.9.8.1735}
}

@article{VQA_Method,
title = {Visual question answering: Datasets, algorithms, and future challenges},
journal = {Computer Vision and Image Understanding},
volume = {163},
pages = {3-20},
year = {2017},
note = {Language in Vision},
issn = {1077-3142},
author = {Kushal Kafle and Christopher Kanan}
}

@mastersthesis{VQA_Wyx,
author = {王宇新},
title = {视觉问答系统中的场景图生成},
school = {北京航空航天大学},
address = {北京},
year = {2022},
month = {05}
}

@InProceedings{Context_Coding,
author = {Zhang, Hang and Dana, Kristin and Shi, Jianping and Zhang, Zhongyue and Wang, Xiaogang and Tyagi, Ambrish and Agrawal, Amit},
title = {Context Encoding for Semantic Segmentation},
booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2018}
}