Newer
Older
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
\chapter{图片、表格与代码}
\section{图片示例}
\begin{figure}[htbp]
\includegraphics[width=0.5\textwidth]{njuname}
\caption{南京大学名称}
\label{fig:njuname}
\end{figure}
你可以使用\lstinline|figure|环境插入图片,如\cref{fig:njuname},代码如下:
\begin{lstlisting}[language=TeX]
\begin{figure}
\includegraphics[width=0.5\textwidth]{njuname}
\caption{南京大学名称}
\end{figure}
\end{lstlisting}
\subsection{文字环绕图像}
% wrapfigure后面不能有空行
\begin{wrapfigure}{r}{0cm}
% \label{fig:njulogo}
\includegraphics[width=.3\textwidth]{njulogo}
\caption{环绕图像测试}
\end{wrapfigure}
\zhlipsum[3][name=xiangyu]
\section{表格示例}
\begin{table}[htbp]
\caption{经过测试的环境}
\label{tab:mytab}
\begin{tabular}{ccc}
\toprule
OS & Tex & 测试情况 \\
\midrule
Windows 10 & TexLive 2021 & ✔ \\
Windows 10 & MikTex & ✔ \\
Windows 10 & TexLive 2020 & ✔ \\
Ubuntu 20.04 & TexLive 2021 & ✔ \\
南大Tex & Overleaf & ✔ \\
\bottomrule
\end{tabular}
\end{table}
你可以使用\lstinline|table|环境插入标准三线表,如\cref{tab:mytab}所示,代码如下:
\begin{lstlisting}[language=TeX]
\begin{table}[htbp]
\caption{经过测试的环境}
\begin{tabular}{ccc}
\toprule
OS & Tex & 测试情况 \\
\midrule
Windows 10 & TexLive 2021 & ✔ \\
Windows 10 & MikTex & ✔ \\
Windows 10 & TexLive 2020 & ✔ \\
Ubuntu 20.04 & TexLive 2021 & ✔ \\
南大Tex & Overleaf & ✔ \\
\bottomrule
\end{tabular}
\end{table}}
\end{lstlisting}
\section{代码示例}
\subsection{行内代码}
The new command pretty-prints the code. The exclamation marks delimit
the code and can be replaced by any character not in the code;
|\lstinline$var i:integer;$| gives the same result.
\lstinline!\lstinline|\textit{<Your code>}|! % 套娃失败了