发布时间:2009-12-10 23:05:32
文章类别:TeX介绍
原文地址:http://blog.sina.com.cn/s/blog_5e16f1770100gdi7.html
QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载
% 使用说明: \alphtab 为开始产生处, \resettab为恢复原来表格编号形式处
% 这两个命令为自定义, 使用时应注意: 不可放于 数学环境中. 在表格开始前和结束后使用.
\newcounter{savetab}%
\newcommand{\alphtab}{%
\setcounter{savetab}{\value{table}}%
\stepcounter{savetab}%
\setcounter{table}{0}%
%%\renewcommand{\thetable}{\arabic{savetab}-\alph{table}}}%%article 中的定义
\renewcommand{\thetable}{\arabic{chapter}-\arabic{savetab}\alph{table}}}%%book 中的定义
%{\mbox{\arabic{table}-\alph{table}}}}%
\newcommand{\resettab}{%
\setcounter{table}{\value{savetab}}%
%%\renewcommand{\thetable}{\arabic{table}}}
\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}}
%重新定义enumerat环境的标签形式,一般不推荐这样改
%\renewcommand{\labelenumi}{(\arabic{enumi})~}
%\renewcommand{\labelenumii}{\textcircled{\arabic{enumii}}~}
%\renewcommand{\labelenumiii}{(\alph{enumiii})~}
%\renewcommand{\labelenumiv}{\textcircled{\alph{enumiii}~}}
%To reduce the linespacing in a bibliography
\let\oldthebibliography=\thebibliography
%字号设置
\newcommand{\chuhao}{\fontsize{42pt}{\baselineskip}\selectfont}
\newcommand{\xiaochuhao}{\fontsize{36pt}{\baselineskip}\selectfont}
\newcommand{\yihao}{\fontsize{28pt}{\baselineskip}\selectfont}
\newcommand{\erhao}{\fontsize{21pt}{\baselineskip}\selectfont}
\newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont}
\newcommand{\sanhao}{\fontsize{15.75pt}{\baselineskip}\selectfont}
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont}
\newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}\selectfont}
\newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}\selectfont}
\newcommand{\xiaowuhao}{\fontsize{9pt}{\baselineskip}\selectfont}
\newcommand{\liuhao}{\fontsize{7.875pt}{\baselineskip}\selectfont}
\newcommand{\qihao}{\fontsize{5.25pt}{\baselineskip}\selectfont}
%更改脚注设置
\renewcommand{\thefootnote}{\textcircled{{\tiny\arabic{footnote}}}}
% Use a small font for the verbatim environment
\makeatletter
\renewcommand{\verbatim@font}{%
}
\makeatother
%常用特殊字符的输入
%罗马数字的输入
\def\BigRoman{\uppercase\expandafter{\romannumeral\number\count 255 }}
\def\Romannumeral{\afterassignment\BigRoman\count255=}
%例如 \romannumeral35产生xxxv, \Romannumeral35产生XXXV
%度的输入
\newcommand{\grad}{\ensuremath{^{\circ}}}
%破折号等的输入, 以下三个命令用在\section中时应在前面加上\protect才行.
\renewcommand{\textemdash}{~\ensuremath{\raisebox{1pt}{---\!---}}}%让破折号在行中完全居中
\renewcommand{\textendash}{~\ensuremath{\raisebox{1pt}{--}}}%
\newcommand{\noexistdash}{~\ensuremath{\raisebox{1pt}{--\!--}}}%公式等中的不存在符号
%\hypersetup{pdfpagemode={FullScreen}}
%\newcommand{\mtilde}{\raisebox{-1.5pt}{\makebox[1ex][c]{$\tilde{}$}}}%产生起止符号~
\newcommand{\mtilde}{\ensuremath{\sim}}%产生起止符号~
%重新定义封面的形式
\renewcommand{\maketitle}
{\begin{titlepage}%
\begin{center}
\end{center}
\vspace*{28mm}%距下切口28mm.
\end{titlepage}%
}
\includeonly{}
\iffalse
DMDtoc,DMD-PR,DMD-SE,DMD-GR,DMD-DA,DMD-NA,DMD-LP,DMD-IP,DMD-NP,DMD-GP,DMD-DY,
DMD-GN,DMD-GT,DMD-IT,DMD-QT,DMD-RE,DMD-DF,DMD-SM,DMD-CA,DMD-OR
处理长文档的最佳方式,{}中文件全为*.tex 文件, 本文件和所有 *.tex
文件最好放在同一目录下.\fi
\begin{document}%正文开始
\phantomsection%可以避免PDF标签超级链接不正确的现象
\sloppy\CJKspace\CJKtilde%在中英文之间用~符号隔开,
%CJK 就能自动换行,同时避免英文和中文不能很好地分开的现象
\begin{CJK*}{GBK}{song}%{CJK*}表示中文之间的空格是被忽略的;可用\ 或用{CJK}选项来产生这种空格
%字体定义
\newcommand{\song}[1] {\begin{CJK*}{GBK}{song} #1 \end{CJK*}}
\newcommand{\fs}[1]
\newcommand{\kai}[1]
\newcommand{\hei}[1]
\newcommand{\li}[1]
\newcommand{\you}[1]
%重新定义文档的显示形式
%\renewcommand\abstractname{摘\ \ 要} %article类型
\renewcommand\contentsname{目\ \ 录}
\renewcommand\listfigurename{正文插图目录}
\renewcommand\listtablename{正文表格目录}
%\renewcommand\refname{参考文献}
\renewcommand\bibname{参考文献}
\renewcommand\indexname{索\ \ 引}
\renewcommand\figurename{图}
\renewcommand\tablename{表}
\renewcommand\partname{部分}
\renewcommand\appendixname{附\ \ 录}
%配合前面的ntheorem宏包产生各种定理结构
%\theoremstyle{plain} \theoremseparator{}
%\theoremindent0cm\theoremnumbering{arabic}
\theoremsymbol{}%以上是latex的默认设置
\iffalse%以下的定义是王磊对changebreak的修改, 推荐选用一个!
\newcommand\pretheorem{【}
\newcommand\posttheorem{】}
\makeatletter
\newtheoremstyle{mytheorem}%
\makeatletter \theoremstyle{mytheorem} \fi%
\setlength{\theorempreskipamount}{0.5pt plus0.5pt minus0.5pt}
\setlength{\theorempostskipamount}{0.5pt plus0.5pt
minus0.5pt}
\newcommand\pretheorem{\hspace{-3ex}\Coffeecup~}
\newcommand\posttheorem{}
\makeatletter
\newtheoremstyle{myplain}%
\makeatother \theoremstyle{myplain}
\theoremheaderfont{\normalfont\CJKfamily{hei}}%表明定理标题结构中的内容为加粗的宋体
\theorembodyfont{\normalfont\rm\CJKfamily{kai}}%使以下定理结构中的内容为正的楷体
\theoremseparator{\hspace*{0.75em}}%这里是半个字的空格
\newtheorem{theorem}{定理}[chapter]
%\newtheorem{proof}{证明}[chapter]
\newtheorem{lemma}{引理}[chapter]
\newtheorem{corollary}{推论}[chapter]
\newtheorem{property}{性质}[chapter]
\newcommand\pretheorema{\hspace{-3ex}\phone~}
\newcommand\posttheorema{}
\makeatletter
\newtheoremstyle{myplain_1}%
\makeatother \theoremstyle{myplain_1}
\newtheorem{definition}{定义}[chapter]
\newcommand\pretheoremb{\hspace{-3ex}\HandRight~}
\newcommand\posttheoremb{}
\makeatletter
\newtheoremstyle{myplain_2}%
\makeatother \theoremstyle{myplain_2}
\newtheorem{example}{例}[chapter]
\newcommand\pretheoremc{\hspace{-3ex}\Yinyang~}
\newcommand\posttheoremc{}
\makeatletter
\newtheoremstyle{myplain_3}%
\makeatother \theoremstyle{myplain_3}
\theorembodyfont{\normalfont\rm\CJKfamily{song}}
\newtheorem{casexuhao}{案例}[chapter]%可产生案例的序号
\newcommand\pretheoremd{\hspace{-3.1ex}\EightStarTaper}
\newcommand\posttheoremd{}
\makeatletter
\newtheoremstyle{myplain_4}%
\makeatother \theoremstyle{myplain_4}
\theorembodyfont{\normalfont\rm\CJKfamily{song}}
\setlength{\theorempreskipamount}{0.5pt plus0.5pt minus0.5pt}
\setlength{\theorempostskipamount}{0.5pt plus0.5pt
minus0.5pt}
\theoremseparator{}
\theoremheaderfont{\normalfont\CJKfamily{hei}}
\newtheorem{xuhao}{}[chapter]%可产生习题的序号
%例如在正文中使用时可用命令\begin{definition}[定义标题]
定义的具体内容\end{definition}
%解和证明的输入
\newcommand{\mysolution}{{\CJKfamily{hei}{\noindent\hspace{-3ex}\Writinghand~分析\hspace*{0.5em}\,}}}
\newcommand{\computersolution}{{\CJKfamily{hei}{\noindent\hspace{-3ex}\Keyboard~软件实现\hspace*{0.5em}\,}}}
\newcommand{\myproof}{{\noindent\hspace{-3ex}{\footnotesize\manerrarrow}\CJKfamily{hei}{证明\hspace*{0.5em}}}}
\newcommand{\myproofend}{{\CJKfamily{hei}{证毕.}}}
%配合前面的宏包\usepackage{titlesec},对章的格式定义
\iffalse \makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill
\kern \z@}
\def\@makechapterhead#1{%
\def\@makeschapterhead#1{%
\fi
\renewcommand{\chaptername}{章}
\renewcommand{\chaptermark}[1]{\markboth{第~\thechapter~\chaptername\
\ #1}{}}
\titleformat{\chapter}[hang]
\titlecontents{chapter}[4em]{}
\iffalse
%节的定义
\makeatletter
\def\section{\@ifstar\unnumberedsection\numberedsection}
\def\numberedsection{\@ifnextchar[%]
\def\unnumberedsection{\@ifnextchar[%]
\def\numberedsectionwithonear
\def\unnumberedsectionwithone
\def\numberedsectionwithtwoar