一直在用的一篇ctex模板

%\documentclass{article}
\documentclass{ctexart}
\usepackage{CJK}
%美国数学学会的三个数学包
\usepackage{amssymb,amsfonts,amsmath,amsthm}
\usepackage[dvips]{graphicx}
\usepackage{overpic}
\usepackage{subfigure}
%加入代码的灰色底纹
\usepackage{color}
\usepackage{framed}
\definecolor {shadecolor}{rgb}{0.92,0.92,0.92}
%一级子标题居中效果
%\usepackage[center]{titlesec}
%\titleformat*{\section}{\centering}
\usepackage{listings}%插入代码的图
% 注意,代码中不能含有中文,否则为无法编译。
\lstset{
   %行号
  numbers=left,
   %背景框
   framexleftmargin=10mm,
    frame=none,
   %背景色
   %backgroundcolor=\color[rgb]{1,1,0.76},
   backgroundcolor=\color[RGB]{245,245,244},
   %样式
   keywordstyle=\bf\color{blue},
   identifierstyle=\bf,
   numberstyle=\color[RGB]{0,192,192},
   commentstyle=\it\color[RGB]{0,96,96},
   stringstyle=\rmfamily\slshape\color[RGB]{128,0,0},
   %显示空格
   showstringspaces=false
   escapeinside=``}

\usepackage[colorlinks,citecolor=red,CJKbookmarks=true]{hyperref}%红色网址引用
\usepackage{mathrsfs}%对于花体的支持
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}

\newtheorem{thm}{定理}
\newtheorem{fthm}[thm]{Fundamental Theorem}
\newtheorem{dfn}[thm]{定义}
\newtheorem{lem}[thm]{引理}
\newtheorem{cor}[thm]{推论}
\newtheorem{exa}[thm]{例}
\author{陈灿贻 201411132033}
\begin{document}
\begin{CJK}{GBK}{song}
\title{\centering\textbf{数值分析:第四次上机课作业}}
\maketitle
%\tableofcontents
\iffalse  %注释开始
%子图模板
%模板一
\begin{figure}[htbp]
\centering
\subfigure[地形图]{\label{fig:fft:a1}
\begin{minipage}[c]{0.5\textwidth}
\centering
    \includegraphics[width=6.5cm]{fig1.pdf}
\end{minipage}%
}%注意这个”%”绝对不能省,可以试试不打%的效果
\subfigure[污染源二维分布]{
\begin{minipage}[c]{0.5\textwidth}
\centering
  \includegraphics[width=6.5cm]{fig2.pdf}
\end{minipage}
}
\caption{地形图和污染探测点分布}\label{fig:fft1}
\end{figure}
%模板二
\begin{figure}[htbp]
  \centering
\begin{minipage}[c]{0.5\textwidth}
\centering
  \includegraphics[width=6.5cm]{sin1.eps}
\end{minipage}%
}%注意这个”%”绝对不能省,可以试试不打%的效果
\begin{minipage}[c]{0.5\textwidth}
\centering
  \includegraphics[width=6.5cm]{sin2.eps}
\end{minipage}
}
\caption{fft}\label{fig:fft}
\end{figure}
%模板三
\begin{figure}[H]
   {\centering
  \subfigure[无变位]{
    \label{fig:subfig:a} %% label for first subfigure
    \includegraphics[width=0.4\textwidth]{fig5.eps}}
  \hspace{0.5in}
 \subfigure[有变位]{
    \label{fig:subfig:b} %% label for second subfigure
    \includegraphics[width=0.4\textwidth]{fig4.eps}}
  \caption{$\Delta V-H$}
  \label{fig:subfig} %% label for entire figure
  }
\end{figure}
%外加xlabel,ylabel外挂的图片插入
\begin{figure}[bt]
  \centering
  \begin{overpic}[width=\textwidth]{fig1.eps}
  \put(3,38){\rotatebox{90}{\footnotesize{$\textbf{容积/L}$}}}
  %\put(50,24){\rotatebox{0}{\footnotesize{2}}}
  \put(14,71){\footnotesize{$10^3$}}
  %\put(13,62){\footnotesize{4}}
  %\put(34,56){\rotatebox{0}{\footnotesize{5}}}
  \put(50,2){\rotatebox{0}{\footnotesize{$\textbf{高度/m}$}}}
   \end{overpic}
\caption[]{\emph{figure caption here}}
\label{fig_label}
\end{figure}

\begin{figure}[htbp]
\centering
\includegraphics[width=.7\textwidth]{fig16.pdf}
\caption{Growth of the Cataloged Satellite Population in
Earth Orbit: Numbers of Objects}
\label{fig16}
\end{figure}

%引用实例
A reference to this subsection \label{section:this}looks like:
''see section~\ref{section:this} on page~\pageref{section:this}.''
\newline
%脚注实例
Footnotes\footnote{This is a footnote.} are often used by
people using \LaTeX.
%强调
\\
\emph{emphasize} emphasize.\newline
%两种添加代码的方式
\begin{lstlisting}[language={C}]
#include 
#include
using namespace std;
int main(int argc, char *argv[])
{
	cout<<"...\n";
	int i,n;
	double x;
	scanf("%ld",&n);
	x=1.1;
	int a[n];
	double b[n];
	for(i=1;i<=n;i++)
	{	
		a[i]=i;
		b[i]=x;
		x=10+x-4*x*x-x*x*x;
	};
	cout<

你可能感兴趣的:(ctex)