From 3a82053daf0f0df0ccfacaf1de278674f1d47aae Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 5 Sep 2016 22:06:45 +0000 Subject: mynsfc (5sep16) git-svn-id: svn://tug.org/texlive/trunk@41996 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls | 64 ++++++++++++++++++++----- 1 file changed, 51 insertions(+), 13 deletions(-) (limited to 'Master/texmf-dist/tex/xelatex/mynsfc') diff --git a/Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls b/Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls index 9e20cc13bf9..bb824140b11 100644 --- a/Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls +++ b/Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls @@ -15,10 +15,13 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{mynsfc} - [2015/08/18 v1.00 A LaTeX class for writing NSFC proposals.] + [2016/07/11 v1.01 A LaTeX class for writing NSFC proposals.] %% Options \newif\ifmynsfc@subfig\mynsfc@subfigfalse +\newif\ifmynsfc@arabicpart\mynsfc@arabicpartfalse \DeclareOption{subfig}{\mynsfc@subfigtrue} +\DeclareOption{arabicpart}{\mynsfc@arabicparttrue} +\ExecuteOptions{} \ProcessOptions %% Load default class \LoadClass[a4paper,fleqn]{article} @@ -56,6 +59,32 @@ \RequirePackage{xpatch}% or use http://tex.stackexchange.com/a/40705 +\@ifpackagelater{biblatex}{2016/03/01} +{ +\newcommand*{\list@bold@authors}{} +\newcommand{\initauthors}[1]{ + \renewcommand*{\list@bold@authors}{} + \forcsvlist{\listadd\list@bold@authors}{#1}} + +\newboolean{bold} +\renewcommand*{\mkbibnamefamily}[1]{\ifthenelse{\boolean{bold}}{\textbf{#1}}{#1}} +\renewcommand*{\mkbibnamegiven}[1]{\ifthenelse{\boolean{bold}}{\textbf{#1}}{#1}} + +\newbibmacro*{name:bold}{% + \setboolean{bold}{false}% + \def\do##1{\iffieldequalstr{hash}{##1}{\setboolean{bold}{true}\listbreak}{}}% + \dolistloop{\list@bold@authors}% +} + +\xpretobibmacro{name:family}{\begingroup\usebibmacro{name:bold}}{}{}{}{} +\xpretobibmacro{name:given-family}{\begingroup\usebibmacro{name:bold}}{}{}{}{} +\xpretobibmacro{name:family-given}{\begingroup\usebibmacro{name:bold}}{} + +\xapptobibmacro{name:family}{\endgroup}{}{}{}{} +\xapptobibmacro{name:given-family}{\endgroup}{}{}{}{} +\xapptobibmacro{name:family-given}{\endgroup}{}{}{}{} +} +{ \newbibmacro*{name:bold}[2]{% \def\do##1{\ifstrequal{#1, #2}{##1}{\bfseries\listbreak}{}}% \dolistloop{\boldnames}} @@ -70,6 +99,7 @@ \xapptobibmacro{name:first-last}{\endgroup}{}{} \xapptobibmacro{name:last-first}{\endgroup}{}{} \xapptobibmacro{name:delim}{\endgroup}{}{} +} \newcommand{\dummyMacro}{} %% Setup Chinese fonts with xeCJK \RequirePackage[AutoFakeBold]{xeCJK} @@ -78,6 +108,7 @@ \defaultfontfeatures{Mapping=tex-text} % after fontspec \setCJKmainfont{仿宋_GB2312} \setCJKsansfont{SimHei} +\setCJKmonofont{仿宋_GB2312} \setCJKfamilyfont{song}{仿宋_GB2312} \setCJKfamilyfont{hei}{SimHei} \setCJKfamilyfont{kai}{KaiTi} @@ -157,30 +188,37 @@ \def\CJKindent{% \settowidth\mynsfc@CJK@twochars{\mynsfc@CJK@space\mynsfc@CJK@space}% \parindent\mynsfc@CJK@twochars} +\renewcommand{\maketitle}{% + \begin{center}% + \heiti\erhao\@title% + \end{center}} +\ifmynsfc@arabicpart% +\renewcommand{\thepart}{\arabic{part}.} +\titleformat{\part}{\heiti\sanhao}{\thepart}{1ex}{} +\renewcommand{\thesection}{\arabic{section})} +\renewcommand{\thesubsection}{\Alph{subsection})} +\else% \def\nsfc@CJKnumber#1{\ifcase#1{零}\or% {一}\or{二}\or{三}\or{四}\or{五}\or% {六}\or{七}\or{八}\or{九}\or{十}\or% {十一}\or{十二}\or{十三}\or{十四}\or{十五}\or% {十六}\or{十七}\or{十八}\or{十九}\or{二十}\fi} +\renewcommand{\thepart}{(\nsfc@CJKnumber{\c@part})} +\titleformat{\part}{\heiti\sanhao}{\thepart}{0ex}{} +\renewcommand{\thesection}{\arabic{section}.} +\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}} +\fi -\renewcommand{\thepart}{\nsfc@CJKnumber{\c@part}} -\titleformat{\part}{\kai\bfseries\sanhao}% - {(\thepart)}{0ex}{} \titlespacing{\part}{0ex}{4ex}{2ex} \@addtoreset{section}{part} -\renewcommand{\thesection}{\arabic{section}.} -\titleformat{\section}{\kai\bfseries\xiaosan}% - {\thesection}{0.25em}{} +\titleformat{\section}{\heiti\xiaosan}{\thesection}{0.25em}{} \titlespacing{\section}{0em}{4ex}{2ex} -\renewcommand{\thesubsection}{\bf\arabic{section}.\arabic{subsection}} -\titleformat{\subsection}{\hei\sihao}% - {\thesubsection}{0.25em}{} +\titleformat{\subsection}{\hei\sihao}{\thesubsection}{0.25em}{} \titlespacing{\subsection}{0em}{2ex}{1ex} -\titleformat{\subsubsection}{\kaiti\bfseries\banxiaosi}% - {\thesubsubsection}{0.25em}{} +\titleformat{\subsubsection}{\heiti\banxiaosi}{\thesubsubsection}{0.25em}{} \titlespacing{\subsubsection}{0em}{2ex}{1ex} \let\mynsfc@begindocumenthook\@begindocumenthook \let\mynsfc@enddocumenthook\@enddocumenthook @@ -190,7 +228,7 @@ \def\@enddocumenthook{\mynsfc@enddocumenthook} \AtBeginDocument{\ps@mynsfc@empty\CJKindent} %% -%% Copyright (C) 2015 by Fei Qi +%% Copyright (C) 2015,2016 by Fei Qi %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either -- cgit v1.2.3