From 119dd66bd04be86e878563dfdc69216266e9a52f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 19 Feb 2019 22:19:26 +0000 Subject: hithesis (19feb19) git-svn-id: svn://tug.org/texlive/trunk@50062 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/hithesis/hithesis.cfg | 10 +- Master/texmf-dist/tex/latex/hithesis/hithesis.cls | 152 ++++++++------ Master/texmf-dist/tex/latex/hithesis/hithesis.sty | 245 +++++++++++++++++++++- 3 files changed, 340 insertions(+), 67 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/hithesis/hithesis.cfg b/Master/texmf-dist/tex/latex/hithesis/hithesis.cfg index b93cdbd30d1..5b7e59d5d0c 100644 --- a/Master/texmf-dist/tex/latex/hithesis/hithesis.cfg +++ b/Master/texmf-dist/tex/latex/hithesis/hithesis.cfg @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2017-2018 by Chu Yanshuo +%% Copyright (C) 2017-2019 by Chu Yanshuo %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3a @@ -23,14 +23,14 @@ %% This is the configuration file of the hithesis package with LaTeX2e. %% \ProvidesFile{hithesis.cfg} -[2017/11/5 1.0.9 Harbin Institute of Technology] +[2018/12/05 2.0.6 Harbin Institute of Technology Thesis Template] \theorembodyfont{\normalfont} \theoremheaderfont{\normalfont\heiti} \theoremsymbol{\ensuremath{\square}} \newtheorem*{proof}{证明} \theoremstyle{plain} \theoremsymbol{} -\theoremseparator{:} +\theoremseparator{} \newtheorem{assumption}{假设}[chapter] \newtheorem{definition}{定义}[chapter] \newtheorem{proposition}{命题}[chapter] @@ -62,7 +62,6 @@ \newcommand{\cabstractcname}{摘\hspace{\ccwd}要} \newcommand{\cabstractename}{Abstract (In Chinese)} \newcommand{\eabstractcname}{Abstract} -\def\hit@doctor@eabstract@ename{ABSTRACT} \newcommand{\eabstractename}{Abstract (In English)} \newcommand{\hit@ckeywords@title}{关键词:} \def\hit@ckeywords@separator{;} @@ -79,7 +78,7 @@ \or\def\CJK@today{\CJK@todaysmall} \or\def\CJK@today{\CJK@todaybig} \fi} -\cdate{\ifhit@bachelor\CJK@todaysmall\else\CJK@todaybig@short\fi} +\cdate{\ifhit@bachelor\CJK@todaysmall\else\CJK@todaysmall@short\fi} \edate{\ifcase \month \or January\or February\or March\or April\or May% \or June\or July \or August\or September\or October\or November \or December\fi\unskip,\ \ \the\year} @@ -186,6 +185,7 @@ {《\hit 研究生学位论文撰写规范》}} \def\UGR{\href{http://jwc.hit.edu.cn/2566/list.htm} {《\hit 本科生毕业论文撰写规范》}} +\def\hit@inline@sep{,} \endinput %% %% End of file `hithesis.cfg'. diff --git a/Master/texmf-dist/tex/latex/hithesis/hithesis.cls b/Master/texmf-dist/tex/latex/hithesis/hithesis.cls index f3659498d67..e9dc36c4c86 100644 --- a/Master/texmf-dist/tex/latex/hithesis/hithesis.cls +++ b/Master/texmf-dist/tex/latex/hithesis/hithesis.cls @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2017-2018 by Chu Yanshuo +%% Copyright (C) 2017-2019 by Chu Yanshuo %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3a @@ -25,7 +25,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{hithesis} -[2017/11/5 1.0.9 Harbin Institute of Technology] +[2018/12/05 2.0.6 Harbin Institute of Technology Thesis Template] \RequirePackage{ifthen} \RequirePackage{kvoptions} \SetupKeyvalOptions{ @@ -40,6 +40,12 @@ \hit@masterfalse \hit@doctorfalse \expandafter\csname hit@#1true\endcsname} +\newif\ifhit@geometrynewone +\newif\ifhit@geometrynewtwo +\define@key{hit}{newgeometry}{% + \hit@geometrynewonefalse + \hit@geometrynewtwofalse + \expandafter\csname hit@geometrynew#1true\endcsname} \DeclareBoolOption[false]{arialtoc} \DeclareBoolOption[false]{arialtitle} \DeclareBoolOption[true]{raggedbottom} @@ -51,10 +57,15 @@ \DeclareBoolOption[true]{fulltime} \DeclareBoolOption[false]{subtitle} \DeclareBoolOption[false]{debug} -\DeclareBoolOption[false]{newgeometry} \DeclareBoolOption[false]{openright} \DeclareBoolOption[false]{capcenterlast} \DeclareBoolOption[false]{subcapcenterlast} +\DeclareBoolOption[false]{absupper} +\DeclareBoolOption[false]{bsmainpagenumberline} +\DeclareBoolOption[false]{bsfrontpagenumberline} +\DeclareBoolOption[true]{bsheadrule} +\DeclareBoolOption[true]{newtxmath} +\DeclareBoolOption[false]{splitbibitem} \DeclareStringOption{fontset} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} \ProcessKeyvalOptions* @@ -103,7 +114,9 @@ \RequirePackage{xparse} \RequirePackage{amsmath} \RequirePackage[defaultsups]{newtxtext} +\ifhit@newtxmath \RequirePackage{newtxmath} +\fi \RequirePackage{courier} \RequirePackage{graphicx} \RequirePackage{pdfpages} @@ -143,7 +156,18 @@ ignoreall, nomarginpar, } -\ifhit@newgeometry% +\ifhit@geometrynewtwo% +\geometry{ + centering, + text={150true mm,236true mm}, + left=30true mm, + head=5true mm, + headsep=2true mm, + footskip=0true mm, + foot=5.2true mm +} +\else% +\ifhit@geometrynewone% \geometry{ centering, text={150true mm,240true mm}, @@ -155,14 +179,15 @@ } \else% \geometry{%根据PlutoThesis 原版定义而来 - text={150true mm,224true mm}, - top=35.5true mm, - left=30true mm, - head=5true mm, - headsep=2.5true mm, - foot=8.5true mm +text={150true mm,224true mm}, +top=35.5true mm, +left=30true mm, +head=5true mm, +headsep=2.5true mm, +foot=8.5true mm } -\fi +\fi% +\fi% \ifhit@debug% \RequirePackage{layout} \RequirePackage{layouts} @@ -171,6 +196,7 @@ \RequirePackage{fancyhdr} \RequirePackage{tabularx} \RequirePackage{varwidth} +\RequirePackage{changepage} \RequirePackage{multicol} \RequirePackage{amssymb} \RequirePackage[below]{placeins}%允许上一个section的浮动图形出现在下一个section的开始部分,还提供\FloatBarrier命令,使所有未处理的浮动图形立即被处理 @@ -245,14 +271,6 @@ \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } - -\fancypagestyle{hit@plain}{% - \fancyhead{} - \fancyfoot[C]{\xiaowu\thepage} - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0pt} -} - \fancypagestyle{hit@headings}{% \fancyhf{} \ifhit@doctor @@ -265,23 +283,32 @@ \fi \ifhit@bachelor \fancyhead[C]{\songti\xiaowu[0]\hit@cschoolname\hit@bachelor@cxuewei\hit@bachelor@cthesisname}% - \fancyfoot[C]{\xiaowu \thepage} + \fancyfoot[C]{\xiaowu\if@mainmatter\ifhit@bsmainpagenumberline-~\thepage~-\else\thepage\fi\else\ifhit@bsfrontpagenumberline-~\thepage~-\else\thepage\fi\fi} + \ifhit@bsheadrule + \renewcommand{\headrule}{ + \vskip 1.190132pt + \hrule\@height2.276208pt\@width\headwidth + \vskip 0.75pt + \hrule\@height.75pt\@width\headwidth + } \else - \fancyfoot[C]{\xiaowu -~\thepage~-} + \renewcommand{\headrulewidth}{0pt} + \fi + \else + \fancyfoot[C]{\xiaowu-~\thepage~-} + \renewcommand{\headrule}{ + \vskip 1.190132pt + \hrule\@height2.276208pt\@width\headwidth + \vskip 0.75pt + \hrule\@height.75pt\@width\headwidth + } \fi % 此处可能和word模板不一致 % 页眉中小五汉字,0行距时,占用9bt,页眉高度为14pt, 所以以下数字之和要保持等于14pt-9bt=4.96634pt % 根据PlutoThesis模板中rule宽度定义为2.25, 0.75, 保持粗线和细线之间的间距为细线宽度。 % 如果页眉是多行的情况,rule向下溢出 - \renewcommand{\headrule}{ - \vskip 1.190132pt - \hrule\@height2.276208pt\@width\headwidth - \vskip 0.75pt - \hrule\@height.75pt\@width\headwidth - } \renewcommand{\footrulewidth}{0pt} } - \AtBeginDocument{%此处解决页眉经典bug \pagestyle{hit@empty} \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\enspace#1}{}}} @@ -312,6 +339,7 @@ \apptocmd{\@makefntext}{\let\@makefnmark\hit@makefnmark}{}{} \allowdisplaybreaks[4] \predisplaypenalty=0 %公式之前可以换页,公式出现在页面顶部 +\postdisplaypenalty=0 \renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation} \def\make@df@tag{\@ifstar\hit@make@df@tag@@\make@df@tag@@@} \def\hit@make@df@tag@@#1{\gdef\df@tag{\hit@maketag{#1}\def\@currentlabel{#1}}} @@ -326,12 +354,9 @@ \def\hit@maketag#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)}} \def\tagform@#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)\equcaption{#1}}} \renewcommand{\eqref}[1]{\textup{(\ref{#1})}} -\setlength{\floatsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 21bp\fi} -\setlength{\intextsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 21bp\fi} -\setlength{\textfloatsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 21bp\fi} -\setlength{\@fptop}{0bp} -\setlength{\@fpsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 21bp\fi} -\setlength{\@fpbot}{0bp} +\setlength{\intextsep}{\ifhit@glue 8.50398bp \@plus 2.83465bp \@minus 0bp\else 8.50398bp\fi} +\setlength{\textfloatsep}{\ifhit@glue 8.50398bp \@plus 2.83465bp \@minus 0bp\else 8.50398bp\fi} +\setlength{\floatsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 20.50398bp\fi} \g@addto@macro\appendix{\renewcommand*{\thefigure}{\thechapter-\arabic{figure}}} \g@addto@macro\appendix{\renewcommand*{\thetable}{\thechapter-\arabic{table}}} \g@addto@macro\appendix{\renewcommand*{\theequation}{\thechapter-\arabic{equation}}} @@ -339,14 +364,6 @@ \renewcommand{\topfraction}{0.85} \renewcommand{\bottomfraction}{0.65} \renewcommand{\floatpagefraction}{0.60} -\let\hit@oldfigure\figure -\let\hit@oldendfigure\endfigure -\def\figure{\begingroup\hit@oldfigure} -\def\endfigure{\vskip-1em\hit@oldendfigure\endgroup} -\let\hit@oldtable\table -\let\hit@oldendtable\endtable -\def\table{\begingroup\hit@oldtable} -\def\endtable{\vskip-1em\hit@oldendtable\endgroup} \long\def\@makecaption#1#2{% \vskip\abovecaptionskip \wuhao\sbox\@tempboxa{#1\ifhit@bachelor\hskip\ccwd\else\enskip\fi#2}% @@ -410,7 +427,9 @@ \setlength{\listparindent}{0pt} % 段落缩进量 }} {\end{list}} -\theoremstyle{plain} +\renewtheoremstyle{plain} +{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]} +{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ ##3\theorem@separator]} \theorembodyfont{\songti\rmfamily} \theoremheaderfont{\heiti\rmfamily} \theoremsymbol{$\square$} @@ -492,15 +511,18 @@ { \phantomsection \markboth{#2}{#2} - \addcontentsline{toc}{chapter}{\ifhit@arialtitle\sffamily\heiti\else\heiti\fi #2} - \IfValueT{#3}{\addcontentsline{toe}{chapter}{\bfseries #3}} + \ifthenelse% + {\equal{#2}{\eabstractcname}}% + {\addcontentsline{toc}{chapter}{\texorpdfstring{\ifhit@arialtitle\sffamily\heiti\else\heiti\fi \ifhit@absupper\MakeUppercase{#2}\else#2\fi}{#2}}} + {\addcontentsline{toc}{chapter}{\texorpdfstring{\ifhit@arialtitle\sffamily\heiti\else\heiti\fi #2}{#2}}} + \IfValueT{#3}{\addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries #3}{#3}}} \hit@chapter*{#2} } } \newcommand{\BiAppChapter}[2] % 该附录命令适用于有章节的完整附录 {\phantomsection \chapter{#1} - \addcontentsline{toe}{chapter}{\bfseries \xiaosi Appendix \thechapter~~#2} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries \xiaosi Appendix \thechapter~~#2}{Appendix \thechapter~~#2}} } \let\hit@chapter\chapter \RenewDocumentCommand{\chapter}{s o m o}{% @@ -509,7 +531,7 @@ {% if \chapter* \hit@chapter*{#3}% \IfValueT{#4}{% - \addcontentsline{toe}{chapter}{\bfseries #4} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries #4}{#4}} } }% {% if \chapter @@ -517,7 +539,7 @@ {\hit@chapter{#3}}% {\hit@chapter[#2]{#3}}% \IfValueT{#4}{% - \addcontentsline{toe}{chapter}{\bfseries\relax Chapter \thechapter\hspace{0.5em}\ignorespaces #4} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries\relax Chapter \thechapter\hspace{0.5em}\ignorespaces #4}{Chapter \thechapter\hspace{0.5em}\ignorespaces #4}} } } } @@ -588,6 +610,7 @@ \hit@def@term{natclassifiedindex} %国内图书分类号 \hit@def@term{intclassifiedindex} %国际图书分类号 +\hit@def@term{ctitlecover} %中文标题封面 \hit@def@term{ctitle} %中文标题 \hit@def@term{csubtitle} %中文副标题 \hit@def@term{cxueke} %中文学科 @@ -650,7 +673,7 @@ \vspace*{1.2cm} \begin{center} \parbox[t][3.4cm][t]{\textwidth}{ - \begin{center}\erhao[0]\heiti\hit@ctitle\end{center} } + \begin{center}\erhao[0]\heiti\hit@ctitlecover\end{center} } \parbox[t][9cm][t]{\textwidth}{ \begin{center}\xiaoer[0]\songti\textbf{\hit@cauthor}\end{center} } @@ -710,15 +733,15 @@ \ifhit@fulltime\vspace{1.4cm}\else% \begin{center}\xiaoyi[1]\songti\textbf{\hit@cbraceleft\hit@cstudenttype\hit@cbraceright}\end{center} \fi% - \parbox[t][2.8cm][t]{\textwidth}{% - \begin{center}\erhao\heiti\hit@ctitle\end{center} -\ifhit@subtitle\begin{center}\hspace{-4em}\xiaoer\heiti\pozhehao\hit@csubtitle\end{center}\fi} - \parbox[t][5.1cm][t]{\textwidth}{%英文标题太长时可以采用\xiaoer + \parbox[t][7.8cm][t]{\textwidth}{% + \begin{center}\erhao\heiti\hit@ctitlecover\end{center} +\ifhit@subtitle\begin{center}\hspace{-4em}\xiaoer\heiti\pozhehao\hit@csubtitle\end{center}\fi \begin{center}% \settowidth{\hit@etitlelength}{\erhao\hit@etitle\ifhit@subtitle\hit@title@esep\hit@esubtitle\fi}% \ifdim\hit@etitlelength>450mm\xiaoer\else\erhao\fi% \textbf{\MakeUppercase{\hit@etitle}% \ifhit@subtitle\hit@title@esep\MakeUppercase{\hit@esubtitle}\fi}\end{center}} + \parbox[t][7.4cm][t]{\textwidth}{ \begin{center}\xiaoer\songti\textbf{\hit@cauthor}\end{center}} \parbox[t][1.4cm][t]{\textwidth}{ @@ -744,7 +767,7 @@ \begin{center}\songti\bfseries\hit@cdegree\hit@cthesisname\end{center} \ifhit@fulltime\relax\else\begin{center}\songti\textbf{\hit@cbraceleft\hit@cstudenttype\hit@cbraceright}\end{center}\fi} \parbox[t][5cm][t]{\textwidth}{\erhao - \begin{center}\heiti\hit@ctitle\end{center} + \begin{center}\heiti\hit@ctitlecover\end{center} \ifhit@subtitle\begin{center}\hspace{-4em}\xiaoer\heiti\pozhehao\hit@csubtitle\end{center}\fi} \parbox[t][9.8cm][b]{\textwidth} {\sihao @@ -960,10 +983,14 @@ \newenvironment{publication}{% \ifhit@openright\cleardoublepage\else\clearpage\fi \hit@appendix@chapter*{\hit@publication@ctitle}[\hit@publication@etitle]}{} - \newenvironment{ceindex}{% \ifhit@openright\cleardoublepage\else\clearpage\fi - \hit@appendix@chapter*{\indexname}[\hit@index@etitle]\begin{multicols*}{2}}{\end{multicols*}} + \hit@appendix@chapter*{\indexname}[\hit@index@etitle] + \setlength{\columnsep}{4em} + \begin{adjustwidth}{2em}{2em} + \begin{multicols*}{2}}{\end{multicols*} + \end{adjustwidth} + } \newlist{idxwordlist}{description}{3} \setlist[idxwordlist, 1]{% @@ -1013,7 +1040,7 @@ \thispagestyle{hit@empty}% \phantomsection\addcontentsline{toc}{chapter}{\ifhit@bachelor\hit@declarename@bachelor\else\hit@authorization@ctitle\fi}% \ifhit@doctor% -\addcontentsline{toe}{chapter}{\bfseries \hit@authorization@etitle}% +\addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries \hit@authorization@etitle}{\hit@authorization@etitle}}% \fi% }]{#1}% }% @@ -1021,10 +1048,10 @@ \newcommand\bibstyle@numerical{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} \newcommand\bibstyle@authoryear{\bibpunct{(}{)}{;}{a}{,}{,}} -\newcommand\bibstyle@inline{\bibpunct{[}{]}{,}{n}{,}{,}} +\newcommand\bibstyle@inline{\bibpunct{[}{]}{,}{n}{,}{\hit@inline@sep}} \citestyle{numerical} \DeclareRobustCommand\inlinecite{\@inlinecite} -\def\@inlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup} +\def\@inlinecite#1{\begingroup\citestyle{inline}\let\@cite\NAT@citenum\citep{#1}\endgroup} \let\onlinecite\inlinecite \renewenvironment{thebibliography}[1]{% \ifhit@openright\cleardoublepage\else\clearpage\fi\phantomsection% @@ -1041,10 +1068,17 @@ \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}}% \sloppy\frenchspacing + \ifhit@splitbibitem + \clubpenalty0 + \@clubpenalty \clubpenalty + \widowpenalty0% + \interlinepenalty-50% + \else \clubpenalty4000 \@clubpenalty \clubpenalty \widowpenalty4000% \interlinepenalty4000% + \fi \sfcode`\.\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% diff --git a/Master/texmf-dist/tex/latex/hithesis/hithesis.sty b/Master/texmf-dist/tex/latex/hithesis/hithesis.sty index 11c154a8795..b1508de9c77 100644 --- a/Master/texmf-dist/tex/latex/hithesis/hithesis.sty +++ b/Master/texmf-dist/tex/latex/hithesis/hithesis.sty @@ -1,17 +1,40 @@ -\ProvidesPackage{hithesis}[2017/08/25 1.0.0 Harbin Institute of Technology +\ProvidesPackage{hithesis}[2018/02/19 1.0.10 Harbin Institute of Technology Thesis Template Extension] % 此文件声明不在规范中要求的格式所使用的宏包。 % (所以,格式基本上是自由发挥的。) + +\setCJKfamilyfont{siyuan}[]{SourceHanSerifCN-Regular} +\newcommand{\highlight}[1]{{\CJKfamily{siyuan}\textbf{#1}}} + + + +% 根据窝工规范中对数字书写规范的规定(6): +% 凡4位或4位以上的数都从个位起每3位数空半个数码(1/4汉字)。 +% 注意此处,除此任何空格都是错误的(包括\:\;\ 等) +\RequirePackage{siunitx} +\sisetup{group-minimum-digits=4, group-separator= \hspace{0.25em}} + % 处理数学公式中的黑斜体的宏包 \RequirePackage{bm} % 不同于 \mathcal \mathfrak 之类的英文花体字体 \RequirePackage{mathrsfs} % 支持彩色 -\RequirePackage{color} +\RequirePackage{xcolor} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% set global color theme of thesis % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\definecolor{colorzero}{rgb}{0, 0, 0} +\definecolor{colorone}{rgb}{1, 0, 0} +\definecolor{colortwo}{rgb}{0, 0, 1} +\definecolor{colorthree}{rgb}{0, 1, 0} % 图形和表格的控制旋转 \RequirePackage{rotating} + + % 算法的宏包,注意宏包兼容性,先后顺序为float、hyperref、algorithm(2e),否则无法 % 生成算法列表。我工算法混乱问题详见hithesis文档。各个实验室设置具体方法详见 % hithesis文档或者示例中给出的地址。 @@ -58,9 +81,19 @@ breaklines=true % 术语宏包,用来处理首次全写,之后缩写的问题 \RequirePackage{glossaries} +\setacronymstyle{short-long} +\renewcommand*{\genacrfullformat}[2]{% + \glsentrylong{#1}% +} \makeglossaries % 添加术语举例 -% \newacronym{dual}{DLP}{对偶规划(Dual linear programming, DLP)} + +\newacronym{tssbp}{树结构折筷过程}{树结构折筷过程(Tree-structured Stick-breaking process)} +\def\gtssbp{\gls{tssbp}\sindex[china]{shu!树结构折筷过程}\sindex[english]{Tree-structured Stick-breaking process}} + +\newacronym[shortplural=SCNAs,longplural={体细胞拷贝数变异(Somatic copy number alternation,SCNA)}]{scna}{SCNA}{体细胞拷贝数变异(Somatic copy number alternation,SCNA)} +\def\gscna{\gls{scna}\sindex[china]{ti!体细胞拷贝数变异}\sindex[english]{Somatic copy number alternation}\ignorespaces} +\def\gscnas{\glspl{scna}\sindex[china]{ti!体细胞拷贝数变异}\sindex[english]{Somatic copy number alternation}\ignorespaces} % tikz做图宏宏包 \usepackage{tikz} @@ -68,6 +101,212 @@ breaklines=true % \tikzstyle{nodestyle}= [circle, fill=gray!60] % \tikzstyle{edgestyle}= [-latex] +\tikzstyle{maternal}= [colorone] +\tikzstyle{paternal}= [colortwo] +\tikzstyle{variant}= [colorthree!80!colorzero] +\tikzstyle{reference}= [colorzero] + +\tikzstyle{aallele}= [colorzero,rotate=90] +\tikzstyle{ballele}= [colorthree!80!colorzero,rotate=90] + +\tikzstyle{refseg}= [colorzero,draw=colorzero, opacity=0.2] +\tikzstyle{mseg}= [colorone,draw=colorone, opacity=0.2] +\tikzstyle{pseg}= [colortwo,draw=colortwo, opacity=0.2] +\tikzstyle{vseg}= [colorthree!80!colorzero,draw=colorthree!80!colorzero, opacity=0.6] + +\tikzstyle{bncell}= [draw=colorzero,opacity=0.2,line width=2pt, rounded corners=1pt] +\tikzstyle{btcell}= [draw=colorone,opacity=0.6, line width=2pt, rounded corners=1pt] + +\tikzstyle{tncell}= [colorzero,opacity=0.9] +\tikzstyle{ttcell}= [colorone,opacity=0.6] +\tikzstyle{tscell}= [colorzero] +\tikzstyle{refcell}= [colorzero] + +\tikzstyle{evolve}= [->,draw=colortwo,opacity=0.3,line width=1.5pt] +\tikzstyle{fakeevolve}= [->,draw=colorzero,opacity=0.3,line width=1.5pt] + +\tikzstyle{refline}= [dashed,draw=colorzero,line width=1pt] +\tikzstyle{tnline}= [dashed,draw=colorzero,opacity=0.3,line width=1pt] + +\newcommand{\gseg}[9]{% + \pgfmathsetmacro{\sstartx}{#1} + \pgfmathsetmacro{\slengx}{#2} + \pgfmathsetmacro{\sy}{#3} + \pgfmathsetmacro{\sdy}{#4} + \pgfmathsetmacro{\sdx}{#5} + \pgfmathsetmacro{\sdxh}{#7} + \pgfmathsetmacro{\sdxt}{#8} + \fill[#6](\sstartx,\sy)--(\sstartx-\sdx,\sy+\sdy)-- + (\slengx+\sstartx+1.5-\sdx,\sy+\sdy)--(\slengx+\sstartx+1.5,\sy)-- + (\slengx+\sstartx+1.5-\sdx,\sy-\sdy)--(\sstartx-\sdx,\sy-\sdy)--cycle; + \draw[#9] (\sstartx-\sdxh,\sy) -- (\sstartx, \sy); + \draw[#9] (\slengx+\sstartx+1.5, \sy) -- (\slengx+\sstartx+1.5+\sdxt,\sy); +} +\newcommand{\gsegr}[9]{% + \pgfmathsetmacro{\sstartx}{#1} + \pgfmathsetmacro{\slengx}{#2} + \pgfmathsetmacro{\sy}{#3} + \pgfmathsetmacro{\sdy}{#4} + \pgfmathsetmacro{\sdx}{#5} + \pgfmathsetmacro{\sdxh}{#7} + \pgfmathsetmacro{\sdxt}{#8} + \fill[#6](\sstartx-0.5,\sy)--(\sstartx+\sdx-0.5,\sy+\sdy)-- + (\slengx+\sstartx+1.5+\sdx-0.5,\sy+\sdy)--(\slengx+\sstartx+1.5-0.5,\sy)-- + (\slengx+\sstartx+1.5+\sdx-0.5,\sy-\sdy)--(\sstartx+\sdx-0.5,\sy-\sdy)--cycle; + \draw[#9] (\sstartx-\sdxh-0.5,\sy) -- (\sstartx-0.5, \sy); + \draw[#9] (\slengx+\sstartx+1.5-0.5, \sy) -- (\slengx+\sstartx+1.5+\sdxt-0.5,\sy); +} + +\newcommand{\rcell}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node at (\x+10, \y) {Reference}; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[aallele]{C}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{refseg}{1.5}{1}{reference}; +} + +\newcommand{\ncell}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+8, \y) {M}; + %\node [paternal] at (\x+8, \y-0.5) {P}; + \draw[bncell](\x-2,\y+0.5)--(\x+7,\y+0.5)-- + (\x+7,\y-1)--(\x-2,\y-1)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-0.5) node[ballele]{T}; + \draw (\x+2,\y-0.5) node[aallele]{C}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[ballele]{A}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + +\newcommand{\tcellone}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+8, \y) {M}; + %\node [maternal] at (\x+8, \y-0.5) {M}; + %\node [paternal] at (\x+8, \y-1) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+7,\y+0.5)-- + (\x+7,\y-1.5)--(\x-2,\y-1.5)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-0.5) node[aallele]{A}; + \draw (\x+2,\y-0.5) node[ballele]{G}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[aallele]{C}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-1) node[ballele]{T}; + \draw (\x+2,\y-1) node[aallele]{C}; + \draw (\x+3,\y-1) node[aallele]{T}; + \draw (\x+4,\y-1) node[ballele]{A}; + \gseg{\x}{4}{\y-1}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + +\newcommand{\tcellthree}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+12, \y) {M}; + %\node [paternal] at (\x+12, \y-0.5) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+11,\y+0.5)-- + (\x+11,\y-1)--(\x-2,\y-1)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \gseg{\x}{2}{\y}{0.2}{0.5}{mseg}{1.5}{0}{maternal}; + \gseg{\x+4}{0}{\y}{0.2}{0.5}{vseg}{0.5}{0.5}{variant}; + \draw (\x+7,\y) node[aallele]{T}; + \draw (\x+8,\y) node[aallele]{C}; + \gseg{\x+6}{2}{\y}{0.2}{0.5}{mseg}{0}{1}{maternal}; + \draw (\x+1,\y-0.5) node[ballele]{T}; + \draw (\x+2,\y-0.5) node[aallele]{C}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[ballele]{A}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + +\newcommand{\tcellfour}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+18, \y) {M}; + %\node [paternal] at (\x+18, \y-0.5) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+15,\y+0.5)-- + (\x+15,\y-1)--(\x-2,\y-1)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \gseg{\x}{2}{\y}{0.2}{0.5}{mseg}{1.5}{0}{maternal}; + \gseg{\x+4}{0}{\y}{0.2}{0.5}{vseg}{0.5}{0.5}{variant}; + \draw (\x+7,\y) node[aallele]{T}; + \gseg{\x+6}{1}{\y}{0.2}{0.5}{mseg}{0}{0}{maternal}; + \gseg{\x+9}{0}{\y}{0.2}{0.5}{vseg}{0.5}{0.5}{variant}; + \draw (\x+12,\y) node[aallele]{C}; + \gseg{\x+11}{1}{\y}{0.2}{0.5}{mseg}{0}{1}{maternal}; + \draw (\x+1,\y-0.5) node[ballele]{T}; + \draw (\x+2,\y-0.5) node[aallele]{C}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[ballele]{A}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + +\newcommand{\tcelltwo}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+8, \y) {M}; + %\node [maternal] at (\x+8, \y-0.5) {M}; + %\node [paternal] at (\x+8, \y-1) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+7,\y+0.5)-- + (\x+7,\y-1.5)--(\x-2,\y-1.5)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-0.5) node[aallele]{A}; + \draw (\x+2,\y-0.5) node[ballele]{G}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[ballele]{G}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-1) node[ballele]{T}; + \draw (\x+2,\y-1) node[aallele]{C}; + \draw (\x+3,\y-1) node[aallele]{T}; + \draw (\x+4,\y-1) node[ballele]{A}; + \gseg{\x}{4}{\y-1}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + + +\newcommand{\tcellfive}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+8, \y) {M}; + %\node [maternal] at (\x+8, \y-0.5) {M}; + %\node [paternal] at (\x+8, \y-1) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+9.5,\y+0.5)-- + (\x+9.5,\y-1.5)--(\x-2,\y-1.5)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-0.5) node[aallele]{A}; + \draw (\x+2,\y-0.5) node[ballele]{G}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[aallele]{C}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-1) node[ballele]{T}; + \gseg{\x}{1}{\y-1}{0.2}{0.5}{pseg}{1.5}{0}{paternal}; + \draw (\x+4.5,\y-1) node[ballele]{A}; + \draw (\x+5.5,\y-1) node[aallele]{T}; + \draw (\x+6.5,\y-1) node[aallele]{C}; + \gsegr{\x+3.5}{3}{\y-1}{0.2}{0.5}{pseg}{0.5}{1.5}{paternal}; +} % 最后定义一些常见的数学公式样式。格式和内容分离,是LaTeX的巨大优势 % 例如如下定义: -- cgit v1.2.3