Chinaunix首页 | 论坛 | 博客
  • 博客访问: 392106
  • 博文数量: 103
  • 博客积分: 3073
  • 博客等级: 中校
  • 技术积分: 1078
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-23 15:04
文章分类

全部博文(103)

文章存档

2012年(13)

2011年(76)

2010年(14)

分类: LINUX

2010-03-27 17:16:16

% a4paper - A4纸 11pt -字体 twoside -双面 openany -新章节可在偶数页开始
\documentclass[a4paper,11pt,twoside,openany]{article}
%------------------------------纸张大小----------------------------------
% 定义转换成pdf文档的纸张大小,应与\paperwidth \paperheight一致
%\special{pdf: pagesize width 20cm height 30cm}
% true的含义是保持尺寸不会随一些参数的变化而变化,具体可见Knuth的TeXbook
%\paperwidth 20 true cm                  % 纸张宽
%\paperheight 30 true cm                 % 纸张高
%------------------------------页面布局----------------------------------
%\textwidth 10 true cm                   % 正文宽
%\textheight 20 true cm                  % 正文高
%\headheight 14pt                       % 页眉高
%\headsep    16pt                        % 页眉距离
%\footskip   27pt                        % 页脚距离
%\marginparsep 10pt                      % 边注区距离
%\marginparwidth 100pt                  % 边注区宽
%----------------------------页边空白调整-------------------------------
\def\marginset#1#2{                      % 页边设置 \marginset{left}{top}
\setlength{\oddsidemargin}{#1}         % 左边(书内侧)装订预留空白距离
\iffalse                   % 如果考虑左侧(书内侧)的边注区则改为\iftrue
\reversemarginpar \addtolength{\oddsidemargin}{\marginparsep}
\addtolength{\oddsidemargin}{\marginparwidth} \fi

\setlength{\evensidemargin}{0mm}       % 置0
\iffalse                   % 如果考虑右侧(书外侧)的边注区则改为\iftrue
\addtolength{\evensidemargin}{\marginparsep}
\addtolength{\evensidemargin}{\marginparwidth} \fi

% \paperwidth = h + \oddsidemargin+\textwidth+\evensidemargin + h
\setlength{\hoffset}{\paperwidth}
\addtolength{\hoffset}{-\oddsidemargin}
\addtolength{\hoffset}{-\textwidth}
\addtolength{\hoffset}{-\evensidemargin}
\setlength{\hoffset}{0.5\hoffset}
\addtolength{\hoffset}{-1in}           % h = \hoffset + 1in

\setlength{\voffset}{-1in}             % 0 = \voffset + 1in
\setlength{\topmargin}{\paperheight}
\addtolength{\topmargin}{-\headheight}
\addtolength{\topmargin}{-\headsep}
\addtolength{\topmargin}{-\textheight}
\addtolength{\topmargin}{-\footskip}
\addtolength{\topmargin}{#2}           % 上边预留装订空白距离
\setlength{\topmargin}{0.5\topmargin} }
% 调整页边空白使内容居中,两参数分别为纸的左边和上边预留装订空白距离
\marginset{10mm}{12mm}
%-----------------------------字体支持-----------------------------------
\usepackage{times}                       % 使用 Times New Roman 字体
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{enumerate}
\usepackage{CJK,CJKnumb,CJKulem}         % 中文支持宏包
%\usepackage{ccmap}                      % 使pdfLatex生成的文件支持复制等
%\usepackage[mtbold,mtpluscal,mtplusscr]{mathtime}%数学环境用Times New Roman
%-----------------------------页眉页脚-----------------------------------
\usepackage{fancyhdr}                    % 页眉页脚相关宏包
\pagestyle{fancy}                        % 页眉页脚风格
%-----------------------------段落字体格式-------------------------------
\usepackage{color}                       % 支持彩色
\usepackage{indentfirst}                 % 首行缩进宏包
%\setlength{\parindent}{2em}             % 段落缩进
\setlength{\parskip}{0.7ex plus0.3ex minus0.3ex} % 段落间距
%\linespread{1.2}                        % 行距倍数
\renewcommand{\baselinestretch}{0.2}     % 行距倍数(同上)
%\renewcommand{\CJKglue}{\hskip 0pt plus 0.08\baselineskip} % 汉字字距
%\newcommand{\aaa}{这是测试}             % 自定义文字块例子
\newcommand{\song}{\CJKfamily{song}}     % 宋体
\newcommand{\hei}{\CJKfamily{hei}}       % 黑体
\newcommand{\fs}{\CJKfamily{fs}}         % 仿宋
\newcommand{\kai}{\CJKfamily{kai}}       % 楷体
\newcommand{\li}{\CJKfamily{li}}         % 隶书
\newcommand{\you}{\CJKfamily{you}}       % 幼圆
\newcommand{\wuhao}{\fontsize{10.5pt}{12.6pt}\selectfont}      % 五号字体
\newcommand{\xiaosi}{\fontsize{12pt}{14pt}\selectfont}         % 小四字体
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont} % 四号字体
%\marginparpush                          %
%-----------------------------超链接和标签-------------------------------
\iffalse % 将这里改为\iftrue即可使用
\ifx\pdfoutput\undefined % Not run pdftex
% \ifx
%    \usepackage[dvips]{hyperref}
% \else
\usepackage[dvipdfm]{hyperref}
% \fi
\AtBeginDvi{\special{pdf:tounicode GBK-EUC-UCS2}} % GBK -> Unicode
\else
\usepackage[pdftex]{hyperref}
\fi
\hypersetup{CJKbookmarks,%
bookmarksnumbered,%
colorlinks,%
linkcolor=blue,%
citecolor=blue,%
hyperindex,%
plainpages=false,%
pdfstartview=FitH} \fi
%--------------------------------注释------------------------------------
\iffalse % 将这里改为\iftrue即可使用
%注释掉一段内容
\usepackage{verbatim}

\usepackage{makeidx}

\begin{comment}
This is a comment example.
\end{comment}
\fi
%\makeatletter % @ is now a normal "letter" for Tex
%\makeatother % @ is restored as a "non-letter" for Tex
%--------------------------------其他宏包--------------------------------
%\usepackage{amsmath,amsthm,amsfonts,amssymb,bm} % 数学宏包
%\usepackage{graphicx,psfrag}                    % 图形宏包
%\usepackage{makeidx}                            % 建立索引宏包
\usepackage{listings}                           % 源代码宏包
\usepackage{xcolor} % 使用颜色宏包
\lstset{numbers=left, numberstyle=\tiny,
keywordstyle=\color{blue!70},
commentstyle=\color{red!50!green!50!blue!50},
rulesepcolor=\color{red!20!green!20!blue!20},extendedchars=true,
escapeinside=''}
%---------------------------------正文-----------------------------------
\makeindex
\begin{document} % 开始正文
% song-宋体 hei-黑体 fs-仿宋 kai-楷体 li-隶书 you-幼圆 com为 song+hei
\begin{CJK*}{GBK}{com}                           % 开始中文环境
\CJKtilde                                        % 重定义~代表的空白距离
\CJKindent                                       % 段首缩进
\CJKcaption{GB}                                  % 中文章节标题
\author{Yu-Liang Yang}                                     % 作者
\title{模型(model)}                             % 生成标题
\maketitle
%\thispagestyle{empty}                           % 设置首页的页眉页脚风格
%\setlength{\baselineskip}{3ex plus1ex minus1ex} % 调整行距

\tableofcontents
%\listoftables
%\listoffigures
\setcounter{tocdepth}{2}% for bookmark levels
\newpage

\section{\textit{zt.dm.xml}}
\subsection{\textit{定义}}
\subsection{\textit{存在的意义}}
\subsection{\textit{如何定义一个dm}}
\subsubsection{\textit{定义示例}}
\begin{lstlisting}[language={XML},numbers=left, numberstyle=\tiny]


\end{lstlisting}
\newpage
\subsubsection{\textit{由xml导出的java代码}}
\section{\textit{zt.const.xml}}
\subsection{\textit{定义}}
\subsection{\textit{存在的意义}}
\subsection{\textit{如何定义一个const}}
\section{\textit{zt.cs.interact.xml}}
\subsection{\textit{定义}}
\subsection{\textit{存在的意义}}
\subsection{\textit{如何定义一个interact}}
\subsubsection{\textit{定义示例}}
\section{\textit{zt.newdao.xml}}
\subsection{\textit{定义}}
\subsection{\textit{存在的意义}}
\subsection{\textit{如何定义dao}}
\subsubsection{\textit{定义示例}}
\section{\textit{zt.persist.xml}}
\subsection{\textit{如何定义一个persist}}
\subsubsection{\textit{定义示例}}
\subsubsection{\textit{由xml导出的dbpojo}}
\newpage
\end{CJK*}     % 结束中文环境
\end{document} % 结束正文

阅读(1775) | 评论(0) | 转发(0) |
0

上一篇:opcontrol

下一篇:segmentation fault

给主人留下些什么吧!~~