明天介绍标题、标签和引用和创建列表,详细的内容参考overleaf官网。
如果把第三天的图片居中,需要以下指令:
\centerline{\includegraphics[width=4cm, height = 5cm]{beauty.jpg}}
我们可以像下面这样,在 figure 环境中对图片添加标题、标签和引用。
\begin{figure}[h]
\centering
\includegraphics[width=0.25\textwidth]{mesh}
\caption{a nice plot}
\label{fig:mesh1}
\end{figure}
As you can see in the figure \ref{fig:mesh1}, the
function grows near 0. Also, in the page \pageref{fig:mesh1}
is the same example.
\includegraphics[width=0.25\textwidth]{mesh}
\textwidth函数来指定宽度,将会使你的 LATEX 文 档更具通用性。可以点击 includegraphics参数详解进行学习。
例如:
\includegraphics[width=\textwidth]{mesh}
将所插入图形缩放到和文本行的宽度一样宽。而下面的命令
\includegraphics[width=0.80\textwidth]{mesh}
使得插入图形的宽度为文本行宽的 80%。
在这个示例中,有三个重要的命令:
\caption{a nice plot}:此命令为图形设置标题。你可以将这条命令放置在图的上方或下方。
\label{fig:mesh1}:如果你需要在文档中引用图像,请使用这条命令为图像设置标签。标签可以为图像编上号,并与下一个命令结合,对图片进行引用,mesh1只是标签名,就这里可以是任意名称,阿猫阿狗都行,引用时保持名称一致就行。
\ref{fig:mesh1}:这条命令在编译后将显示替换为被引用图片对应的编号。
创建列表
无序列表
\begin{itemize}
\item The individual entries are indicated with a black dot, a so-called bullet.
\item The text in the entries may be of any length.
\end{itemize}
默认情况下,各个条目用黑点表示。条目中的文本可以是任何长度。
\begin{enumerate}
\item This is the first entry in our list
\item The list numbers increase with each entry we add
\end{enumerate}
与无序列表一样,每个条目前必须添加 \item,它将自动生成标记该项目的数字,由从 1 开始。