texlive2012 通过

\documentclass[a4paper]{article}
%\documentclass[twocolumn]{article}
 
%\usepackage{graphicx}
\usepackage{listings}
\usepackage{xcolor}
%\usepackage{enumitem}
\usepackage{enumerate}
\usepackage{CJKutf8} %注意这里用的是CJKutf8而不是CJK
\usepackage{tikz} % 画流程图用的
\usepackage{indentfirst}%英文首行缩进
\usepackage{fancyhdr} % 排版格式
\usepackage{hyphenat} % 单词断字
\usepackage{amsmath} % for {aligned}, 公式换行
\usepackage{multicol}% 多栏排版
\usepackage{balance}% 双栏最后一页对齐
\usepackage{subfigure}% 多图
\usepackage{booktabs}% 表格画线,\toprule, \midrule, \bottomrule
 
% in texlive-science
\usepackage{algorithm}
\usepackage{algpseudocode}% an improvement from algorithmicx for algorithmic
 
%======= XXX 要编译两遍才能有标签和引用等效果 =====%
 
\usepackage[top=2.54cm,bottom=2.54cm,left=3.17cm,right=3.17cm]{geometry} % a4paper standard
\usepackage[unicode=true,colorlinks=true]{hyperref} %注意这里不能加CJKbookmarks=true,否则会乱码
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit}
 
\hypersetup{
pdfauthor={ouoline},
%pdftitle={test},
%pdfsubject={Subject},
%pdfkeywords={Keyword1, Keyword2, ...},
%pdfcreator={LaTeX with hyperref package},
%pdfproducer = {dvips + ps2pdf},
%bookmarksnumbered=true,
%colorlinks=no,
pdfborder={0 0 0},
%bookmarksopen=true,
}
%------------------------------------------------------------------%
 
\setcounter{secnumdepth}{5} % 编号的深度,4 表示到 paragraph 一级
%\setcounter{tocdepth}{4} % 目录中的深度
 
%------------------------------------------------------------------%
 
% 自己定义新命令,参数依次是
% \newcommand{新命令名称(带反斜线)}[参数个数(最多9个)]{命令定义}
% 实际上相当于宏替换
\newcommand{\sayhelloto}[1]{hello,#1}
 
%------------------------------------------------------------------%
 
% 放在导言区,设置全局行距
%\linespread{1.6}
 
% 放在导言区,公式编号和章节相关
%\makeatletter % `@' now normal ``letter''
%\@addtoreset{equation}{section}
%\makeatother % `@' is restored as ``non-letter''
%\renewcommand\theequation{\oldstylenums{\thesection}%
%.\oldstylenums{\arabic{equation}}}
 
\begin{document}
 
\begin{CJK*}{UTF8}{gbsn}
\setlength{\parindent}{0pt} % no indent
 
\pagestyle{fancy}
 
%----------------------------------------------------%
 
\tableofcontents % 目录
\listoffigures% 图列表
\listoftables%表格列表
\addcontentsline{toc}{section}{前言}
\section*{前言} % 加了"*"的section不会被自动显示在标签里,但是可以通过\tableofcontents和\addcontentsline增加
 
%----------------------------------------------------%
 
商标\textsuperscript{\textregistered}
数学环境中的上下标$^{up}_{down}$
 
%----------------------------------------------------%
 
\sayhelloto{you} % 用\newcommand定义的新命令
 
%\begin{center}
%\Huge{title}
%\vspace{25pt} % 25pt between title and text
%\end{center}
\title{\Huge{标题}\\{\large 副标题}}
\author{\Large{作者\hspace{10pt}单位}}
\date{\today}
 
\maketitle
 
%----------------------------------------------------%
 
字体从小到大
 
{\tiny tiny}
{\scriptsize scriptsize}
{\footnotesize footnotesize}
{\small small}
{\normalsize normalsize}
{\large large}
{\Large Large}
{\LARGE LARGE}
{\huge huge}
{\Huge Huge}
 
\large % size of fonts
\CJKindent
 
{\rm rm}\\
{\sf sf}\\
{\tt tt, 等宽}\\
{\it it, 斜体}\\
{\sl sl}\\
{\em em, 还是斜体}\\
{\bf bf, 加粗}
 
%------------------------------------------------------------------%
 
% 对齐 可选 center flushleft flushright
\begin{center}
\end{center}
 
%小页环境(可嵌入上面三种对齐环境中形成组合)
\begin{minipage}{3cm}
ttt
\end{minipage}
 
%原样引用
\begin{verbatim}
特殊字符不需转义 % \ # _
\end{verbatim}
 
\begin{multicols}{2} % 2 columns
there is a long long long long long long long long long long long long long long long long long way to go.
\end{multicols}
 
%------------------------------------------------------------------%
 
% 画线命令 \rule{width}{thickness}
\noindent \rule{\textwidth}{1pt}
 
%------------------------------------------------------------------%
 
% 目录层次
%\chapter{chap} % only with "book" or "report" documentclass will this be available
\part{part}
\section{section}
\subsection{subsection}
\subsubsection{subsubsection}
\paragraph{para} % 从这级开始没编号,如果想要编号的话要设置\setcounter{secnumdepth}{5}
\subparagraph{subpara}
 
%------------------------------------------------------------------%
 
\section{中文书签测试} %注意!如果section和subsection等后面有"*"则不会出现在书签中
\subsection{test}
 
\hypertarget{code}{}
\lstset{% general command to set parameter(s)
language=c,
basicstyle=\tt, % 默认对所有字符使用等宽字体
keywordstyle=\color{green},%\bfseries\underbar% underlined bold black keywords
identifierstyle=, % nothing happens
stringstyle=\color{purple},
commentstyle=\color{gray},
showstringspaces=false, % no special string spaces
breaklines=true, % 自动换行
}
 
%表格的列格式参数中使用\extracolsep 命令来增加列之间的空隙。
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}l r}% \textwidth \linewidth
left & right \\
\end{tabular*}
 
\parbox{\linewidth}{left2 \hfill right2}
\makebox[\textwidth][l]{testttttttttttttttttttttttttt}
 
\begin{tabular}{|l|}
\hline
\begin{lstlisting}
#include<stdio.h>
 
int main()
{
printf("Hello,world.\n");
 
return 0;/* comment test */
}
\end{lstlisting}
\\\hline
\end{tabular}
 
%color options :
% red, green, blue, cyan, magenta, yellow, black,darkgray,
% gray, lightgray, orange, violet, purple, and brown
{\color{purple}Perl \verb| Practical Language |}\\
 
%------------------------------------------------------------------%
 
% 公式换行,"&"后表示对齐的字符
 
\vspace{-15pt}
\begin{equation}\label{eq_s}
\begin{aligned}
a &< b\\&< c
\end{aligned}
\end{equation}
 
这里对公式 \ref{eq_s} 进行引用
 
%------------------------------------------------------------------%
 
% 单图
 
\begin{figure}[!t]
\centering
%\includegraphics[width=0.9\linewidth]{pic.jpg}
\caption{这里是内容解析}
\label{ref_label1}
\end{figure}
 
这里对图 \ref{ref_label1} 进行引用
 
%双栏 单栏多图竖排,跨栏的话使用\begin{figure*}
 
\begin{figure}[!t]
\centering
\subfigure[内容解析1] {
\includegraphics[width=2in]{/home/ou/picture/morning.jpg}
\label{p_a}
}
\subfigure[内容解析2] {
%\includegraphics[width=2in]{jpg}
\label{p_b}
}
\subfigure[内容解析3] {
%\includegraphics[width=2in]{jpg}
\label{p_c}
}
\caption{Updating strategy}
\label{ref_label2}
\end{figure}
 
% 跨栏用\begin{table*}
\begin{table}
\caption{Data sets used in this experiment}
\label{exp_data}
\centering
\begin{tabular}{c|r c r r r c}
\toprule
one & two & three\\
\midrule
1.1 & 1.2 & 1.3\\
2.1 & 2.2 & 2.3\\
3.1 & 3.2 & 3.3\\
\bottomrule
\end{tabular}
\end{table}
 
%------------------------------------------------------------------%
 
% 列举
 
\begin{enumerate}[1]% 这里可以自己指定编号的样式,使用enumerate宏包。如果使用enumitem,texlive2009会出错,原因不明
\item second\footnote{备注}
\item first
\end{enumerate}
 
% vspace用来调整间距
\begin{itemize} % [noitemsep] item之间没空行,使用enumitem宏包
%\setlength\baselineskip{-1mm} %用这个命令来调整间距应该比较具有通用性
\item test
\item test2
\end{itemize}
 
\begin{itemize}
\item
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}c@{\extracolsep{\fill}} l@{\extracolsep{\fill}}}
\begin{tabular}{@{}l}
内容标题\\
补充说明\\
\end{tabular}
&
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\
\end{tabular*}
\begin{itemize}
\item 主要内容
\end{itemize}
\end{itemize}
 
%------------------------------------------------------------------%
\newpage
 
\section{流程图示例}
\hyperlink{code}{\color{blue!70!yellow}使用$\backslash$hyperlink 链接代码位置,因为图表会floating,所以链接位置不准,最好使用$\backslash$label和$\backslash$ref进行引用}
 
\color{black}
\begin{tikzpicture} % package tikz
[place/.style={circle,draw=blue!50,fill=blue!20,thick,inner sep=0pt,minimum size=6mm},
transition/.style={rectangle,draw=black!50,fill=black!20,thick,inner sep=0pt,minimum size=4mm}]
\node[place] (waiting) {};
\node[place] (critical) [below=of waiting] {};
\node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
\node[transition] (enter critical) [left=of critical] {};
\draw [->] (critical.west) -- (enter critical.east);
\draw [->] (waiting.west) .. controls +(left:5mm) and +(up:5mm) .. (enter critical.north);
\end{tikzpicture}
 
%--------------------------------------------
 
%伪代码
看算法的伪代码\ref{alg_ref}
 
\begin{algorithm}
\caption{标题:伪代码测试}
\label{alg_ref}
\begin{algorithmic}[1]% 1表示行号格式
\Function{TestFunction}{\null}\Comment{A test Function without parameters}
\If {a == 1}
\State b $\gets$ a + 1
\ElsIf {a == 2}
\State b $\gets$ a - 2
\Else
\State b $\gets$ a + 3
\EndIf
 
\While {a $\neq$ b}
\State b $\gets$ a + 1
\EndWhile
 
\ForAll {a = 5}
\State a $\gets$ b + 1
\EndFor
 
\For {a $\gets$ 0; a $<$ 5; ++a}
\State b $\gets$ a + 1
\EndFor
\EndFunction
\end{algorithmic}
\end{algorithm}
 
%--------------------------------------------
 
%参考文献
 
这里引用参考文献 \cite{abc}
 
\bibliographystyle{IEEEtran}
\balance% 双栏最后一页对齐
\begin{thebibliography}{0}
\bibitem{abc} abcde
\end{thebibliography}
 
\newpage
 
\end{CJK*}
\end{document}

latex 模版的更多相关文章

  1. Latex 模版生成会议论文 不显示Keywords,而是显示 Index Terms- ,改成Keywords 方法

    一. 不管显示何种内容,TEX 文件都是 \begin{IEEEKeywords} 关键词1.关键词2,..... \end{IEEEKeywords} 其中:模版文件 IEEETran.cls存在下 ...

  2. 国内大学毕业论文 LaTeX 模板集合

    西北工业大学学位论文LaTeX模板 http://code.google.com/p/nwputhesis/ 西北工业大学硕博士论文LaTeX模版 http://code.google.com/p/n ...

  3. [Latex]生成Vertical Timeline

    Vertical TimeLine 用Latex生成一个竖直的VerticalTimeline的想法来源于今天翻看王老师的教师寄语,有感于学院走过的操作系统实验的艰辛之路,遂产生了写一个"小 ...

  4. LaTeX 有哪些「新手须知」的内容?

    孟晨 ,在 LaTeX 话题下写错 LaTeX 名字的,一律… 陈硕等 137 人赞同 这是个好问题,虽然提问提得很大.不是很好答,权当抛砖引玉了. 天字第一号原则:不要到网上抄代码,尤其是似懂非懂的 ...

  5. 国内大学毕业论文LaTeX模板集合

    国内大学毕业论文LaTeX模板集合 薛瑞尼的清华大学学位论文LaTeX模板http://sourceforge.net/projects/thuthesis/ 北大论文文档 LaTeX 模板 pkut ...

  6. Markdown转pdf

    最近由于项目需要,要用到把markdown转换成pdf文件下载下来,最开始的时候想到的是先把markdown转成html,用到的是Parsedown:然后再将html转成pdf,用到了html2pdf ...

  7. 【LaTeX排版】LaTeX论文模版

    本文是对前面LaTeX论文排版文章的总结.前面的几篇文章是分别从论文的几个方面来讲述LaTeX的排版问题,这里综合了前面的内容,给出了论文排版的模版. 模版的使用: 1.首先建立一个main.tex文 ...

  8. LaTeX:毕设模版设计问题1 各级标题编号设为黑体

    我用'titlesec'宏包设计各级标题格式指定字体为黑体,结果标题编号仍为Times New Roman .

  9. 用Latex写学术论文:作者(Author)&摘要(Abstract)

    标题&作者 1.标题 \title{} "Line breaks (\\) may be used to equalize the length of the title lines ...

随机推荐

  1. window.open() | close()方法

    Window对象的open()方法可以打开一个新的浏览器窗口(或标签页),window.open()载入指定的URL到新的或已存在的窗口中,返回代表那个窗口的window对象,它有4个可选的参数 1. ...

  2. 读取Webpage表中的内容

    nutch将从网页中抓取到的信息放入hbase数据库中,默认情况下表名为$crawlId_webpage,但表中的内容以16进制进行表示,直接scan或者通过Java API进行读取均只能读取到16进 ...

  3. 最常用的CSS技巧收集笔记

    1.重置浏览器的字体大小  重置浏览器的默认值 ,然后重设浏览器的字体大小你可以使用雅虎的用户界面重置的CSS方案 ,如果你不想下载9MB的文件,代码如下: body,div,dl,dt,dd,ul, ...

  4. Ibatis 后台打印完整的sql语句

    http://blog.csdn.net/deng11342/article/details/9122015 http://www.blogjava.net/libin2722/archive/200 ...

  5. Dijkstra算法C#实现及其布线运用

    大家好,我是小鸭酱,博客地址为:http://www.cnblogs.com/xiaoyajiang 以下是空调布线对Dijkstra算法的运用,采用C#实现. 问题:室内机多台,室外机一台.寻找室内 ...

  6. Swift UI

    概述 Apple近日发布了Swift编程语言,Swift是供iOS和OS X应用编程的新编程语言.相信很多开发者都在学习这门新语言.   废话不多说,下面我就来学习使用Swift创建一个简单的UI应用 ...

  7. [Ioi2007]Miners 矿工配餐(BZOJ1806)

    [Ioi2007]Miners 矿工配餐 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 214  Solved: 128 Description 现有两 ...

  8. Android 代码编辑器中实现代码语法高亮

    想写一款Android手机上的代码编辑器,实现类似c4droid中代码语法高亮 通过Android中的控件WebView中嵌入html网页,html引入CodeMirror这个第三方库就可以了,其实就 ...

  9. hdu 1142 A Walk Through the Forest

    http://acm.hdu.edu.cn/showproblem.php?pid=1142 这道题是spfa求最短路,然后dfs()求路径数. #include <cstdio> #in ...

  10. BZOJ 1001 狼抓兔子

    链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1001 现在小朋友们最喜欢的"喜羊羊与灰太狼",话说灰太狼抓羊不到,但抓兔子 ...