电竞比分网-中国电竞赛事及体育赛事平台

分享

一直在用的一篇ctex模板

 牛廚館 2019-05-08
%\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{數值分析:第四次上機課作業(yè)}}
\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 <stdio.h>
#include<iostream>
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<<i-1<<endl;
for(i=1;i<=n;i++)
{
printf("%lf\n",b[i]);
};
cout<<"\n";
return 0;
}
\end{lstlisting}
%第二種
\lstinputlisting{HelloWorld.c}

%自定義環(huán)境實例
\begin{exa}
對于$$y=\frac{1}{1+25x^2}$$,分別作5,10,16次逼近,并在圖中表示。
\end{exa}
\fi   %注釋結束
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%正文







\begin{thebibliography}{1}
\bibitem{1}孫志忠,袁慰平,聞震初:
  數值分析,\emph{東南大學出版社}(2011).
\end{thebibliography}
\end{CJK}
\end{document}
--------------------- 
作者:qq_37119273 
來源:CSDN 
原文:https://blog.csdn.net/qq_37119273/article/details/53769388 
版權聲明:本文為博主原創(chuàng)文章,轉載請附上博文鏈接!

    本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多