- Latex中添加程序代码
\begin{lstlisting}[language=C]
double phi(double x[], int xd)
{
double y = 1.0;
for (int i = 0; i < xd; i++) {
y = y * exp(-x[i]*x[i]);
}
return y;
}
\end{lstlisting}
2.插入图片
\begin{figure}[H]
\centering
\includegraphics[width=0.8\linewidth]{explicit.jpg}
\caption{显式格式数值解}
\end{figure}
3.定义定理
需要先导入包\usepackage{amsmath}
然后在引言区,就是在usepackage后面,定义
\newtheorem{myDef}{Definition}
\newtheorem{myTheo}{Theorem}
当然,第一个括号里的随便定义。
\begin{myDef}
Let $\chi=\left(\vec{x}_1, \cdots, \vec{x}_N\right)$ be a finite sequence of points in the d-dimensional space $\left[0,1\right]^d$. Then the number
\begin{equation}
D_N^*(\vec{x}_1, \cdots, \vec{x}_N) = \sup\limits_{\vec{u}\in \left[0,1\right]^d} |\frac{I([\vec{0},\vec{u}), N, \chi)}{N}-\lambda\left([\vec{0},\vec{u})\right)|,
\end{equation}
is called the star discrepancy of sequence $\chi$. Here $I(Q, N, \chi) = \sum_{i=1}^N \chi_{Q}(\vec{x}_i)$ gives the number of the sequence $\chi$ in $Q$.
\end{myDef}
- 更改段落文字颜色
{\color{blue}中间这些文字相应变成蓝色
}