summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/mynsfc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-09-05 22:06:45 +0000
committerKarl Berry <karl@freefriends.org>2016-09-05 22:06:45 +0000
commit3a82053daf0f0df0ccfacaf1de278674f1d47aae (patch)
tree0fd48b363f0550fb83ebcfb9c3f9511df3a7f30b /Master/texmf-dist/tex/xelatex/mynsfc
parent230fe59e35208b77a89adf5a05e0b133bd1703a3 (diff)
mynsfc (5sep16)
git-svn-id: svn://tug.org/texlive/trunk@41996 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/mynsfc')
-rw-r--r--Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls64
1 files changed, 51 insertions, 13 deletions
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 <fred.qi@ieee.org>
+%% Copyright (C) 2015,2016 by Fei Qi <fred.qi@ieee.org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either