diff options
author | Karl Berry <karl@freefriends.org> | 2021-08-19 20:22:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-08-19 20:22:35 +0000 |
commit | a04b63f61f76e6bbcf8fb89494dc8c155a5f3082 (patch) | |
tree | 9b51d66820c7d47d1aeba35fab96de29a7932fa5 /Master/texmf-dist/tex/xelatex | |
parent | deb160ee05dd9a1a711de6e70d467e5653f2ade5 (diff) |
mynsfc (19aug21)
git-svn-id: svn://tug.org/texlive/trunk@60280 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls | 195 |
1 files changed, 68 insertions, 127 deletions
diff --git a/Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls b/Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls index bb824140b11..944bfd12070 100644 --- a/Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls +++ b/Master/texmf-dist/tex/xelatex/mynsfc/mynsfc.cls @@ -12,29 +12,37 @@ %% License: Released under the LaTeX Project Public License v1.3c or later %% See: http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- -%% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{mynsfc} - [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} + [2020/08/18 v1.30 A XeLaTeX class for writing NSFC proposals.] \ExecuteOptions{} -\ProcessOptions +\ProcessOptions* +%% Options +\RequirePackage{kvoptions} +\DeclareBoolOption[false]{subfig} +\DeclareBoolOption[false]{boldtoc} +\DeclareStringOption[zhkai]{tocfont} +\DeclareStringOption[0070c0]{toccolor} +\ProcessKeyvalOptions* %% Load default class -\LoadClass[a4paper,fleqn]{article} +\LoadClass[a4paper,UTF8,fontset=fandol,zihao=-4]{ctexart} +\setCJKmainfont{FandolSong}[% + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold] +\setCJKfamilyfont{zhkai}{FandolKai-Regular.otf}[AutoFakeBold=2] +\RequirePackage[hmargin=1.25in,vmargin=1in]{geometry} +\setlength{\parskip}{0pt \@plus2pt \@minus0pt} %% Load required packages \RequirePackage{titlesec} \RequirePackage{marvosym} -\RequirePackage{bm,amsmath,amssymb} +\RequirePackage{amsmath,amssymb} \RequirePackage{paralist} \RequirePackage{graphicx} \ifmynsfc@subfig \RequirePackage[config]{subfig} \else -\RequirePackage{subcaption} +\RequirePackage{caption,subcaption} \fi \RequirePackage{xcolor} \RequirePackage{calc} @@ -47,18 +55,36 @@ \urlstyle{same} %% Load and setup package biblatex \RequirePackage[backend=biber, - url=true, + doi=false, + url=false, isbn=false, defernumbers=true, style=ieee]{biblatex} -\appto{\bibfont}{\wuhao} -\defbibheading{reftype}[\bibname]{\subsection*{#1}} -\defbibheading{cvtype}[\bibname]{\paragraph{#1}} +\setlength{\bibitemsep}{2pt} +\appto{\bibfont}{\normalfont\zihao{5}\linespread{1}\selectfont} +\defbibheading{reftype}[参考文献]{\subsection*{#1}} +\defbibheading{cvtype}[\bibname]{\subsubsection*{#1}} \defbibfilter{conference}{type=inproceedings or type=incollection} +\NewBibliographyString{patentcn} + +\DefineBibliographyStrings{english}{% + and = {\&}, + patentcn = {中国发明专利\adddot}, +} + \RequirePackage{xpatch}% or use http://tex.stackexchange.com/a/40705 +\@ifpackagelater{biblatex}{2016/05/10} +{ +\renewcommand*{\mkbibnamegiven}[1]{% + \ifitemannotation{self}{\textbf{#1}}{#1}} +\renewcommand*{\mkbibnamefamily}[1]{% + \ifitemannotation{self}{\textbf{#1}}{#1}% + \ifpartannotation{family}{corr}{\textsuperscript{*}}{}} +} +{ \@ifpackagelater{biblatex}{2016/03/01} { \newcommand*{\list@bold@authors}{} @@ -100,135 +126,50 @@ \xapptobibmacro{name:last-first}{\endgroup}{}{} \xapptobibmacro{name:delim}{\endgroup}{}{} } -\newcommand{\dummyMacro}{} -%% Setup Chinese fonts with xeCJK -\RequirePackage[AutoFakeBold]{xeCJK} -\def\CJK@null{\kern\CJKnullspace\Unicode{48}{7}\kern\CJKnullspace} -\punctstyle{quanjiao} -\defaultfontfeatures{Mapping=tex-text} % after fontspec -\setCJKmainfont{仿宋_GB2312} -\setCJKsansfont{SimHei} -\setCJKmonofont{仿宋_GB2312} -\setCJKfamilyfont{song}{仿宋_GB2312} -\setCJKfamilyfont{hei}{SimHei} -\setCJKfamilyfont{kai}{KaiTi} -\setmainfont{Times New Roman} -\setmonofont{Courier Std} -\newcommand{\kai}{\CJKfamily{kai}} % 仿宋体 -\newcommand{\song}{\CJKfamily{song}} % 宋体 -\newcommand{\hei}{\CJKfamily{hei}} % 黑体 -\def\kaiti{\kai} -\def\songti{\song} -\def\heiti{\hei} -\newlength\mynsfc@linespace -\newcommand{\mynsfc@choosefont}[2]{% - \setlength{\mynsfc@linespace}{#2*\real{#1}}% - \fontsize{#2}{\mynsfc@linespace}\selectfont} -\def\mynsfc@define@fontsize#1#2{% - \expandafter\newcommand\csname #1\endcsname[1][\baselinestretch]{% - \mynsfc@choosefont{##1}{#2}}} -\mynsfc@define@fontsize{chuhao}{42bp} -\mynsfc@define@fontsize{xiaochu}{36bp} -\mynsfc@define@fontsize{yihao}{26bp} -\mynsfc@define@fontsize{xiaoyi}{24bp} -\mynsfc@define@fontsize{erhao}{22bp} -\mynsfc@define@fontsize{xiaoer}{18bp} -\mynsfc@define@fontsize{sanhao}{16bp} -\mynsfc@define@fontsize{xiaosan}{15bp} -\mynsfc@define@fontsize{sihao}{14bp} -\mynsfc@define@fontsize{banxiaosi}{13bp} -\mynsfc@define@fontsize{xiaosi}{12bp} -\mynsfc@define@fontsize{dawu}{11bp} -\mynsfc@define@fontsize{wuhao}{10.5bp} -\mynsfc@define@fontsize{xiaowu}{9bp} -\mynsfc@define@fontsize{liuhao}{7.5bp} -\mynsfc@define@fontsize{xiaoliu}{6.5bp} -\mynsfc@define@fontsize{qihao}{5.5bp} -\mynsfc@define@fontsize{bahao}{5bp} -\setlength{\textwidth}{\paperwidth} -\setlength{\textheight}{\paperheight} -\setlength\marginparwidth{0mm} -\setlength\marginparsep{0mm} -\addtolength{\textwidth}{-50mm} -\setlength{\oddsidemargin}{0mm} -\setlength{\evensidemargin}{\oddsidemargin} -\setlength{\headheight}{20pt} -\setlength{\topskip}{0mm} -\setlength{\skip\footins}{15pt} -\setlength{\topmargin}{-15mm} -\setlength{\footskip}{13mm} -\setlength{\headsep}{6mm} -\addtolength{\textheight}{-50mm} -\setlength{\parskip}{0pt \@plus2pt \@minus0pt} -\renewcommand\normalsize{% - \@setfontsize\normalsize{12bp}{20bp} - \abovedisplayskip=10bp \@plus 2bp \@minus 2bp - \abovedisplayshortskip=10bp \@plus 2bp \@minus 2bp - \belowdisplayskip=\abovedisplayskip - \belowdisplayshortskip=\abovedisplayshortskip} +} +\newcommand{\tocformat}{% + \CJKfamily{\mynsfc@tocfont}% + \color[HTML]{\mynsfc@toccolor}} \def\ps@mynsfc@empty{% \let\@oddhead\@empty% \let\@evenhead\@empty% \let\@oddfoot\@empty% \let\@evenfoot\@empty} -\newenvironment{hcomment}{\vskip-3pt\color{gray}}{\vskip6pt} -\renewcommand{\figurename}{图} -\renewcommand{\tablename}{表} -\renewcommand{\contentsname}{内容目录} -\DeclareCaptionLabelFormat{mynsfc@cap}{{\wuhao#1\rmfamily#2}} -\DeclareCaptionLabelSeparator{mynsfc@sep}{\hspace{1em}} -\DeclareCaptionFont{mynsfc@capfont}{\wuhao} -\captionsetup{labelformat=mynsfc@cap, - labelsep=mynsfc@sep, - font=mynsfc@capfont, - justification=centering} -\newlength\mynsfc@CJK@twochars -\newcommand{\mynsfc@unicode}[2]{\char\numexpr#1*256+#2\relax} -\def\mynsfc@CJK@space{\mynsfc@unicode{48}{7}} -\def\CJKindent{% - \settowidth\mynsfc@CJK@twochars{\mynsfc@CJK@space\mynsfc@CJK@space}% - \parindent\mynsfc@CJK@twochars} \renewcommand{\maketitle}{% \begin{center}% - \heiti\erhao\@title% + \kaishu\zihao{3}\bfseries\@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 - -\titlespacing{\part}{0ex}{4ex}{2ex} - -\@addtoreset{section}{part} -\titleformat{\section}{\heiti\xiaosan}{\thesection}{0.25em}{} +\ctexset{ + part/name = {(,)}, + part/aftername = {}, + part/number = \chinese{part}, + part/format = \tocformat\bfseries\zihao{4}, + part/indent = 2em, +} +\titleformat{\section}[block]{\tocformat\zihao{4}} + {\bfseries\hskip2em\thesection{.}}{1ex}{} \titlespacing{\section}{0em}{4ex}{2ex} - -\titleformat{\subsection}{\hei\sihao}{\thesubsection}{0.25em}{} +\let\oldsection\section +\renewcommand{\section}[2]{\oldsection{\textbf{#1}{#2}}} +\@addtoreset{section}{part} +\titleformat{\subsection}{\tocformat\bfseries\zihao{-4}} + {\thesubsection{.}}{0.25em}{} \titlespacing{\subsection}{0em}{2ex}{1ex} - -\titleformat{\subsubsection}{\heiti\banxiaosi}{\thesubsubsection}{0.25em}{} -\titlespacing{\subsubsection}{0em}{2ex}{1ex} +\renewcommand{\thesubsubsection}{(\arabic{subsubsection})} +\titleformat{\subsubsection}{\CJKfamily{\mynsfc@tocfont}\bfseries\zihao{-4}} + {\thesubsubsection}{0.25em}{} +\titlespacing{\subsubsection}{0ex}{2ex}{1ex} +\captionsetup{font=small} +\newcommand{\cemph}[1]{\textbf{\color[HTML]{\mynsfc@toccolor}#1}} \let\mynsfc@begindocumenthook\@begindocumenthook \let\mynsfc@enddocumenthook\@enddocumenthook \def\AtBeginDocument{\g@addto@macro\mynsfc@begindocumenthook} \def\AtEndDocument{\g@addto@macro\mynsfc@enddocumenthook} \def\@begindocumenthook{\mynsfc@begindocumenthook} \def\@enddocumenthook{\mynsfc@enddocumenthook} -\AtBeginDocument{\ps@mynsfc@empty\CJKindent} +\AtBeginDocument{\ps@mynsfc@empty} %% -%% Copyright (C) 2015,2016 by Fei Qi <fred.qi@ieee.org> +%% Copyright (C) 2015-2021 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 |