diff --git a/examples/my-nsfc-proposal.tex b/examples/my-nsfc-proposal.tex index 7f59c91..b16cc04 100644 --- a/examples/my-nsfc-proposal.tex +++ b/examples/my-nsfc-proposal.tex @@ -4,8 +4,8 @@ %% Author: Fred Qi %% Created: 2016-02-04 15:26:58(-0700) %% -%% Last-Updated: 2016-07-11 18:33:23(+0800) [by Fred Qi] -%% Update #: 71 +%% Last-Updated: 2016-09-05 16:49:58(+0800) [by Fred Qi] +%% Update #: 73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %%% Commentary: @@ -18,7 +18,7 @@ %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\documentclass[subfig]{mynsfc} +\documentclass[subfig,boldtoc]{mynsfc} \bibliography{IEEEabrv,my-nsfc-proposal} @@ -122,6 +122,20 @@ \section{工作基础} \texttt{initauthors} 中的哈希字符串可以在Biber/bibtex 生成的文件 \texttt{*.bbl} 中找到。 + 需要强调的作者列表有两种形式,分别适用于不同版本的\texttt{biblatex}。 + \begin{description} + \item[3.3+ (20160301)] 由于姓名处理的宏更新,请使用哈希字符串列表指定需要强调 + 的作者。 +\begin{verbatim} + \initauthors{{72b3cccfc646adeb1d6b20320b56fd7d}} +\end{verbatim} + \item[3.2- (20151228)] 使用旧式的姓名处理宏,使用下列形式的作者列表。 +\begin{verbatim} + \forcsvlist{\listadd\boldnames}{{Qi, F\bibinitperiod}} +\end{verbatim} + \end{description} + + % \forcsvlist{\listadd\boldnames}{{Qi, F\bibinitperiod}} \initauthors{{72b3cccfc646adeb1d6b20320b56fd7d}} \printbibliography[prefixnumbers=J,heading=cvtype,title={相关工作}] diff --git a/mynsfc.dtx b/mynsfc.dtx index 1f48c1e..6a76be9 100644 --- a/mynsfc.dtx +++ b/mynsfc.dtx @@ -89,7 +89,7 @@ Running "make install" installs the files in the local TeX tree. %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesClass{mynsfc} %<*class> - [2016/07/11 v1.01 A LaTeX class for writing NSFC proposals.] + [2016/09/05 v1.01 A XeLaTeX class for writing NSFC proposals.] % %<*driver> \documentclass{ltxdoc} @@ -121,12 +121,18 @@ Running "make install" installs the files in the local TeX tree. % \filedate.} } \author{Fred Qi\thanks{E-mail: fred.qi@ieee.org}} \date{ % \filedate 发布} % -%\maketitle +% \maketitle % -%\changes{v1.00}{2015/08/18}{First public release} -%\changes{v1.01}{2016/07/11}{Revised command maketitle} -%\changes{v1.01}{2016/07/11}{Added an option arabicpart} -%\changes{v1.01}{2016/07/11}{Author highlight with latest biblatex} +% \changes{v1.00}{2015/08/18}{First public release} +% \changes{v1.01}{2016/07/11}{Improved command \texttt{maketitle}} +% \changes{v1.01}{2016/07/11}{Added an option \texttt{arabicpart}} +% \changes{v1.01}{2016/07/11}{Author highlight with \texttt{biblatex} newer than +% 3.3 (2016-03-01)} +% \changes{v1.01}{2016/09/05}{Added options \texttt{tocfont} and +% \texttt{boldtoc} to select font on headings} +% \changes{v1.01}{2016/09/05}{Using kvoptions to handle package options} +% \changes{v1.01}{2016/09/05}{Added an option \texttt{toccolor} to show outline +% in a given color specified by a HTML/CSS style hex code} % % \begin{abstract} % 用于自然基金申请书正文部分的撰写。 @@ -145,13 +151,16 @@ Running "make install" installs the files in the local TeX tree. % %<*class> % \begin{macrocode} -%% Options -\newif\ifmynsfc@subfig\mynsfc@subfigfalse -\newif\ifmynsfc@arabicpart\mynsfc@arabicpartfalse -\DeclareOption{subfig}{\mynsfc@subfigtrue} -\DeclareOption{arabicpart}{\mynsfc@arabicparttrue} \ExecuteOptions{} -\ProcessOptions +\ProcessOptions* +%% Options +\RequirePackage{kvoptions} +\DeclareBoolOption[false]{subfig} +\DeclareBoolOption[false]{arabicpart} +\DeclareBoolOption[false]{boldtoc} +\DeclareStringOption[kai]{tocfont} +\DeclareStringOption[0070c0]{toccolor} +\ProcessKeyvalOptions* %% Load default class \LoadClass[a4paper,fleqn]{article} % \end{macrocode} @@ -238,16 +247,6 @@ Running "make install" installs the files in the local TeX tree. } % \end{macrocode} % -% \begin{macro}{\dummyMacro} -% This is a dummy macro. If it did anything, we'd describe its -% implementation here. -% \begin{macrocode} -% \begin{macrocode} -% -\newcommand{\dummyMacro}{} -% \end{macrocode} -% \end{macro} -% % \begin{macrocode} %% Setup Chinese fonts with xeCJK \RequirePackage[AutoFakeBold]{xeCJK} @@ -286,6 +285,15 @@ Running "make install" installs the files in the local TeX tree. % \end{macro} % \end{macro} % +% \begin{macro}{\tocformat} +% \begin{macrocode} +\ifmynsfc@boldtoc + \newcommand{\tocformat}{\CJKfamily{\mynsfc@tocfont}\color[HTML]{\mynsfc@toccolor}\bfseries} +\else + \newcommand{\tocformat}{\CJKfamily{\mynsfc@tocfont}\color[HTML]{\mynsfc@toccolor}} +\fi +% \end{macrocode} +% \end{macro} % \begin{macrocode} \newlength\mynsfc@linespace \newcommand{\mynsfc@choosefont}[2]{% @@ -356,7 +364,7 @@ Running "make install" installs the files in the local TeX tree. % \begin{environment}{hcomment} % Dimmed text used as hint after section titles. % \begin{macrocode} -\newenvironment{hcomment}{\vskip-3pt\color{gray}}{\vskip6pt} +\newenvironment{hcomment}{\vskip-3pt\color[HTML]{\mynsfc@toccolor}}{\vskip6pt} % \end{macrocode} % \end{environment} % @@ -400,7 +408,7 @@ Running "make install" installs the files in the local TeX tree. % \begin{macro}{\maketitle} \renewcommand{\maketitle}{% \begin{center}% - \heiti\erhao\@title% + \tocformat\erhao\@title% \end{center}} % \end{macro} % @@ -413,7 +421,7 @@ Running "make install" installs the files in the local TeX tree. % \begin{macrocode} \ifmynsfc@arabicpart% \renewcommand{\thepart}{\arabic{part}.} -\titleformat{\part}{\heiti\sanhao}{\thepart}{1ex}{} +\titleformat{\part}{\tocformat\sanhao}{\thepart}{1ex}{} \renewcommand{\thesection}{\arabic{section})} \renewcommand{\thesubsection}{\Alph{subsection})} \else% @@ -423,7 +431,7 @@ Running "make install" installs the files in the local TeX tree. {十一}\or{十二}\or{十三}\or{十四}\or{十五}\or% {十六}\or{十七}\or{十八}\or{十九}\or{二十}\fi} \renewcommand{\thepart}{(\nsfc@CJKnumber{\c@part})} -\titleformat{\part}{\heiti\sanhao}{\thepart}{0ex}{} +\titleformat{\part}{\tocformat\sanhao}{\thepart}{0ex}{} \renewcommand{\thesection}{\arabic{section}.} \renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}} \fi @@ -431,13 +439,13 @@ Running "make install" installs the files in the local TeX tree. \titlespacing{\part}{0ex}{4ex}{2ex} \@addtoreset{section}{part} -\titleformat{\section}{\heiti\xiaosan}{\thesection}{0.25em}{} +\titleformat{\section}{\tocformat\xiaosan}{\thesection}{0.25em}{} \titlespacing{\section}{0em}{4ex}{2ex} -\titleformat{\subsection}{\hei\sihao}{\thesubsection}{0.25em}{} +\titleformat{\subsection}{\tocformat\sihao}{\thesubsection}{0.25em}{} \titlespacing{\subsection}{0em}{2ex}{1ex} -\titleformat{\subsubsection}{\heiti\banxiaosi}{\thesubsubsection}{0.25em}{} +\titleformat{\subsubsection}{\tocformat\banxiaosi}{\thesubsubsection}{0.25em}{} \titlespacing{\subsubsection}{0em}{2ex}{1ex} % \end{macrocode} % \end{macro}