%% %% --------------------------------------------------------------- %% css.cbx --- A citation style of journal of management world in china %% modified from gb7714-2015 %% Maintained by huzhenzhen %% E-mail: hzzmail@163.com %% Released under the LaTeX Project Public License v1.3c or later %% --------------------------------------------------------------- %% %%用法:类似于标准的样式在biblatex加载时设置样式 %%文献表正常处理,标注命令主要用cite和textcite \ProvidesFile{chinese-jmw.cbx}[v1.0a a biblatex citation style for jmw] %================================================== %加载gb样式 %================================================== \RequireCitationStyle{gb7714-2015ay} % % % 增加一个控制标注中标点是英文还是中文的选项 % 20220222,v1.0a,hzz \DeclareBibliographyOption{gbcitepunctcn}[true]{%biblatex低版本 \ifstrequal{#1}{false}{\execgbpunctencite}{}} \def\gbpunctcommacite{,}% \def\gbpunctmarkcite{、}% \def\gbpunctsemicoloncite{;}% \def\gbpunctparenlcite{(}% \def\gbpunctparenrcite{)} \def\execgbpunctencite{% \def\gbpunctcommacite{\addcomma\addspace}% \def\gbpunctmarkcite{\addcomma\addspace}% \def\gbpunctsemicoloncite{\addsemicolon\addspace}% \def\gbpunctparenlcite{(}% \def\gbpunctparenrcite{)}% } %================================================== %选项设置 %================================================== \ExecuteBibliographyOptions{ maxcitenames=2, mincitenames=1, } \DeclareDelimFormat[textcite]{delimandincitecn}{和}%\addcomma\space \DeclareDelimFormat[parencite]{delimandincitecn}{\gbpunctmarkcite}%\addcomma\space \DeclareDelimFormat[textcite]{delimandincite}{和}%\addcomma\space \DeclareDelimFormat[parencite]{delimandincite}{ and }%\addcomma\space \DeclareDelimFormat[textcite]{delimandothersincite}{\str@andotherscn}%\addcomma\space \DeclareDelimFormat[parencite]{delimandothersincite}{et al\adddot}%\addcomma\space \DefineBibliographyStrings{english}{ andincitecn = {\printdelim{delimandincitecn}}, andincite = {\printdelim{delimandincite}}, %andothersincitecn={\str@andotherscn}, andothersincite={\printdelim{delimandothersincite}}, } %================================================== %引用命令设置,主要用cite和textcite %包括标点设置 %================================================== \renewcommand*{\multicitedelim}{\gbpunctsemicoloncite}%\addsemicolon\addspace; \renewcommand*{\textcitedelim}{% \iffinalcitedelim {\ifnumgreater{\value{textcitetotal}}{2} {}{}%\iftextcitepunct{\finalandsemicolon}{\finalandcomma} \addspace\gbpunctmarkcite}%\addspace\bibstring{andincitecn} {\iftextcitepunct{\addsemicolon\space}{\addspace\gbpunctmarkcite}}%\addcomma }%\space \DeclareDelimFormat[textcite]{nameyeardelim}{\addspace}%\addcomma\space \DeclareDelimFormat[parencite]{nameyeardelim}{\gbpunctcommacite} \DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% \DeclareDelimFormat[parencite]{andothersdelim}{\iffieldequalstr{userf}{chinese}{}{\addspace}}% %去掉footfullcite后面的点 %注意由于usedriver中biblatex自动把\finenty设置为空,所以userdriver最后本来没有标点 %默认了加了period所以把它去掉 \renewcommand{\bibfootnotewrapper}[1]{% \bibsentence#1}% %标注压缩时,直接用date+extradate代替extradate实现2006a,2006b的效果 %\DeclareDelimFormat*{compcitedelim}{\gbpunctmarkcite}%\addcomma\addspace \newbibmacro*{cite:extradate}{% \iffieldundef{extradate} {} {\printtext[bibhyperref]{\addspace\printlabeldateextra}}}%\printfield{extradate}\printlabeldateextra \printfield{labelyear}\printfield{extradate} %\AtEveryCite{% %\let\parentext=\parentexttrack% %\let\bibopenparen=(% %\let\bibcloseparen=)} %添加前后空格 \DeclareCiteCommand{\parencite}%[\mkbibparens] {\usebibmacro{cite:init}% \unspace\printtext{\gbpunctparenlcite}\usebibmacro{prenote}}%\addspace {\usebibmacro{citeindex}% \usebibmacro{cite}} {} {\usebibmacro{postnote}% \gbpunctparenrcite}%\addspace %原版 %\DeclareCiteCommand{\cite}[\mkbibparens] % {\usebibmacro{cite:init}% % \usebibmacro{prenote}}%) % {\usebibmacro{citeindex}% % \usebibmacro{cite}} % {} % {\usebibmacro{postnote}} % %添加后面空格 %\DeclareCiteCommand{\cbx@textcite} % {\usebibmacro{cite:init}} % {\usebibmacro{citeindex}% % \usebibmacro{textcite}} % {} % {\usebibmacro{textcite:postnote}\addspace} \newbibmacro*{textcite}{% \iffieldequals{namehash}{\cbx@lasthash} {\iffieldundef{shorthand} {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} {\setunit{\addcomma}% \usebibmacro{cite:extradate}} {\setunit{\compcitedelim}% \usebibmacro{cite:labeldate+extradate}% \savefield{labelyear}{\cbx@lastyear}}} {\setunit{\compcitedelim}% \usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}} {\ifnameundef{labelname} {\iffieldundef{shorthand} {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:parens}% \printdelim{nonameyeardelim}\unspace\gbpunctparenlcite}%\bibopenparen \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \usebibmacro{cite:labeldate+extradate}} {\usebibmacro{cite:shorthand}}} {\printnames{labelname}% \setunit{% \global\booltrue{cbx:parens}% \printdelim{nameyeardelim}\unspace\gbpunctparenlcite}%\bibopenparen \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \iffieldundef{shorthand} {\iffieldundef{labelyear} {\usebibmacro{cite:label}} {\usebibmacro{cite:labeldate+extradate}}% \savefield{labelyear}{\cbx@lastyear}} {\usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}}% \stepcounter{textcitecount}% \savefield{namehash}{\cbx@lasthash}}% \setunit{% \ifbool{cbx:parens} {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen {}% \textcitedelim}} \newbibmacro*{textcite:postnote}{% \usebibmacro{postnote}% \ifthenelse{\value{multicitecount}=\value{multicitetotal}} {\setunit{}% \printtext{% \ifbool{cbx:parens} {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen {}}} {\setunit{% \ifbool{cbx:parens} {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen {}% \textcitedelim}}} \let\citet=\textcite \let\citep=\parencite \let\cite=\parencite