Skip to content

Commit

Permalink
update-20230315
Browse files Browse the repository at this point in the history
  • Loading branch information
hushidong committed Mar 15, 2024
1 parent d3aae9f commit 91535e3
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 59 deletions.
40 changes: 39 additions & 1 deletion biblatex-gb7714-2015.tex
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,20 @@ \subsubsection{新增选项}\label{sec:added:opt}
\caption{文献表作者缺失处理选项gbnoauthor效果}\label{fig:eg:optgbnoauthor}
\end{figure}



\pdfbookmark[4]{gbnoothers}{gbnoothers}
\item[gbnoothers]=true,\textbf{false}. \hfill default is false

为控制是否输出作者列表截断后的等/et al. 信息增加的选项。
\begin{itemize}
\item gbnoothers=false,默认输出等、et al.信息;
\item gbnoothers=true,不输出。
\end{itemize}
该选项是全局选项,设置为true后,全文的作者列表都将不输出。若需要再局部调整,则利用编组局部设置\verb|\settoggle{bbx:gbnoothers}{true}|即可。



\pdfbookmark[4]{gbbiblabel}{gbbiblabel}
\item[gbbiblabel]=\textbf{bracket},parens,plain,dot,box,circle. \hfill default is bracket

Expand Down Expand Up @@ -1098,6 +1112,16 @@ \subsubsection{新增重要命令}\label{sec:add:cmd}

将会为author2007en,author2014en两个条目添加nameformat域信息。
该命令也只能出现在导言区中。

\pdfbookmark[4]{delEntryField}{delEntryField}
\item[delEntryField] \{entrykey or entrykey comma list\}\{field\}

用于给指定的文献条目(集)删除域。即将指定的entrykey 条目或者entrykey comma list 中的各个条目中的 field 域删除。

\verb|\delEntryField{author2007en,author2014en}{usera}|

将会把author2007en,author2014en两个条目中usera域信息删除。



\pdfbookmark[4]{setlocalbibstring}{setlocalbibstring}
Expand Down Expand Up @@ -2011,6 +2035,20 @@ \subsubsection{局部定义的不同样式的文献表}\label{sec:local:biblist:
}
\end{filecontents}

%导言区
%去掉文献Zhang2007-500-503的usera域
\delEntryField{Zhang2007-500-503}{usera}
%在第1个refsection中去掉article类的文献标识符
%利用AtEveryBibitem在对refsection和entrytype判断后局部做设置
\AtEveryBibitem{%
\ifnumequal{\value{refsection}}{1}
{%
\ifentrytype{article}{\settoggle{bbx:gbtype}{false}}{\settoggle{bbx:gbtype}{true}}%
}%
{}%
}

%正文区
\begin{refsection}[resume.bib]
\nocite{ref-8-1-任天令,ref-9-1-Ren}%
\printbibliography[heading=subbibliography,title={研究成果}]
Expand Down Expand Up @@ -2174,7 +2212,7 @@ \subsection{题名}
\href{https://github.com/hushidong/biblatex-solution-to-latex-bibliography/blob/master/biblatex-solution-to-latex-bibliography.pdf}%
{biblatex-solution-to-latex-bibliography}中的第2.10节。

具体例子则可以参考\href{run:./stdgbT7714-2015.pdf}{stdgbT7714-2015.pdf}其中第8节中大量使用这种方式。
具体例子则可以参考\href{run:./stdgbT7714-2015.pdf}{stdgbT7714-2015.pdf}其中第8节中大量使用这种方式。



Expand Down
19 changes: 19 additions & 0 deletions example/updatehistory.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@

%\updateinfo[latest]{date of update: }\label{up:latest}

%\updateinfo[2024-02-10]{date of update: 2024-02-10 to version v1.1p}\label{up:20240210}
\begin{enumerate}

\item 为包含doi或eprint的文献条目添加文献载体标识符OL。(20240307)

add the medium identifier OL for entries containing doi or eprint.

\item 增加命令delEntryField 用于删除指定文献条目的指定域信息。(20240315)

add command delEntryField to delete the specific field for given entries.

\item 增加 gbnoothers 选项用于控制姓名列表截断后的信息的输出。(20240315)

add option gbnoothers to control the output of the information after the truncated name list.

\end{enumerate}



\updateinfo[2024-02-10]{date of update: 2024-02-10 to version v1.1p}\label{up:20240210}
\begin{enumerate}

Expand Down
60 changes: 33 additions & 27 deletions gb7714-2015.bbx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@
%=====================================================================
% 设置宏包选项
%=====================================================================
%
% 增加一个控制是否输出and others信息的选项
% 20240315,v1.1p,hzz
\newtoggle{bbx:gbnoothers}
\DeclareBibliographyOption{gbnoothers}[false]{%biblatex低版本
\settoggle{bbx:gbnoothers}{#1}}
\ExecuteBibliographyOptions{gbnoothers}

%
% 增加一个控制是否调整日期输出位置的选项mergedate
% 为兼容性考虑,但实际不产生作用了,因为如果要使用ay样式可以直接从bibstyle进入
Expand Down Expand Up @@ -1848,37 +1856,31 @@
}
%用于人工的为条目或条目集添加域
\newcommand{\addEntryField}[3]{%
\edef\entrykeya{#1}
\edef\entrykeyb{#2}
\edef\entrykeyc{#3}
\edef\entrykeya{#1}%
\edef\entrykeyb{#2}%
\edef\entrykeyc{#3}%
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
\map[foreach={#1}]{
\step[fieldsource=entrykey, match=\regexp{$MAPLOOP}, final]
\step[fieldset=\entrykeyb, fieldvalue=\entrykeyc]
}
\map{%处理在bib文件中直接给出文献的姓名格式为lowercase的情况
\step[fieldsource=nameformat,match=lowercase,final]
\step[fieldset=namefmtid,fieldvalue={1}]
}
\map{%处理在bib文件中直接给出文献的姓名格式为givenahead的情况
\step[fieldsource=nameformat,match=givenahead,final]
\step[fieldset=namefmtid,fieldvalue={2}]
}
\map{%处理在bib文件中直接给出文献的姓名格式为familyahead的情况
\step[fieldsource=nameformat,match=familyahead,final]
\step[fieldset=namefmtid,fieldvalue={3}]
}
\map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况
\step[fieldsource=nameformat,match=pinyin,final]
\step[fieldset=namefmtid,fieldvalue={4}]
}
\map{%处理在bib文件中直接给出文献的姓名格式为全拼的情况
\step[fieldsource=nameformat,match=quanpin,final]
\step[fieldset=namefmtid,fieldvalue={6}]
}
}
}
}%
}
%用于人工的为条目或条目集删除域
\newcommand{\delEntryField}[2]{%
\edef\entrykeya{#1}%
\edef\entrykeyb{#2}%
\DeclareStyleSourcemap{
\maps[datatype=bibtex,overwrite]{
\map[foreach={#1}]{
\step[fieldsource=entrykey, match=\regexp{$MAPLOOP}, final]
\step[fieldset=\entrykeyb, fieldvalue={}]
}
}
}%
}
%
Expand Down Expand Up @@ -2792,7 +2794,9 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{\namepartprefix}
{\namepartsuffix}%
\fi
\usebibmacro{name:andothers}}
\iftoggle{bbx:gbnoothers}{}%
{\usebibmacro{name:andothers}}%
}
\DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式
\DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family
Expand Down Expand Up @@ -3092,8 +3096,10 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}%
\or
\usebibmacro{name:gbquanpin}{#1}{#3}{#5}{#7}%
\fi
\usebibmacro{name:andothers}}
\fi%
\iftoggle{bbx:gbnoothers}{}%
{\usebibmacro{name:andothers}}%
}%
}
%
Expand Down
60 changes: 33 additions & 27 deletions gb7714-2015ay.bbx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@
%=====================================================================
% 设置宏包选项
%=====================================================================
%
% 增加一个控制是否输出and others信息的选项
% 20240315,v1.1p,hzz
\newtoggle{bbx:gbnoothers}
\DeclareBibliographyOption{gbnoothers}[false]{%biblatex低版本
\settoggle{bbx:gbnoothers}{#1}}
\ExecuteBibliographyOptions{gbnoothers}

%
% 增加一个控制是否输出文献载体的选项
% 20191125,v1,0s,hzz
Expand Down Expand Up @@ -1675,37 +1683,31 @@
}
%用于人工的为条目或条目集添加域
\newcommand{\addEntryField}[3]{%
\edef\entrykeya{#1}
\edef\entrykeyb{#2}
\edef\entrykeyc{#3}
\edef\entrykeya{#1}%
\edef\entrykeyb{#2}%
\edef\entrykeyc{#3}%
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
\map[foreach={#1}]{
\step[fieldsource=entrykey, match=\regexp{$MAPLOOP}, final]
\step[fieldset=\entrykeyb, fieldvalue=\entrykeyc]
}
\map{%处理在bib文件中直接给出文献的姓名格式为lowercase的情况
\step[fieldsource=nameformat,match=lowercase,final]
\step[fieldset=namefmtid,fieldvalue={1}]
}
\map{%处理在bib文件中直接给出文献的姓名格式为givenahead的情况
\step[fieldsource=nameformat,match=givenahead,final]
\step[fieldset=namefmtid,fieldvalue={2}]
}
\map{%处理在bib文件中直接给出文献的姓名格式为familyahead的情况
\step[fieldsource=nameformat,match=familyahead,final]
\step[fieldset=namefmtid,fieldvalue={3}]
}
\map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况
\step[fieldsource=nameformat,match=pinyin,final]
\step[fieldset=namefmtid,fieldvalue={4}]
}
\map{%处理在bib文件中直接给出文献的姓名格式为全拼的情况
\step[fieldsource=nameformat,match=quanpin,final]
\step[fieldset=namefmtid,fieldvalue={6}]
}
}
}
}%
}
%用于人工的为条目或条目集删除域
\newcommand{\delEntryField}[2]{%
\edef\entrykeya{#1}%
\edef\entrykeyb{#2}%
\DeclareStyleSourcemap{
\maps[datatype=bibtex,overwrite]{
\map[foreach={#1}]{
\step[fieldsource=entrykey, match=\regexp{$MAPLOOP}, final]
\step[fieldset=\entrykeyb, fieldvalue={}]
}
}
}%
}
%
Expand Down Expand Up @@ -2648,7 +2650,9 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{\namepartprefix}
{\namepartsuffix}%
\fi
\usebibmacro{name:andothers}}
\iftoggle{bbx:gbnoothers}{}%
{\usebibmacro{name:andothers}}%
}
\DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式
\DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family
Expand Down Expand Up @@ -2948,8 +2952,10 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}%
\or
\usebibmacro{name:gbquanpin}{#1}{#3}{#5}{#7}%
\fi
\usebibmacro{name:andothers}}
\fi%
\iftoggle{bbx:gbnoothers}{}%
{\usebibmacro{name:andothers}}%
}%
}
%
Expand Down
43 changes: 41 additions & 2 deletions gb7714-2015ms.bbx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@
%=====================================================================
% 设置宏包选项
%=====================================================================
%
% 增加一个控制是否输出and others信息的选项
% 20240315,v1.1p,hzz
\newtoggle{bbx:gbnoothers}
\DeclareBibliographyOption{gbnoothers}[false]{%biblatex低版本
\settoggle{bbx:gbnoothers}{#1}}
\ExecuteBibliographyOptions{gbnoothers}

%
% 增加一个控制是否输出文献载体的选项
% 20191125,v1,0s,hzz
Expand Down Expand Up @@ -1263,6 +1271,35 @@
}
}
%用于人工的为条目或条目集添加域
\newcommand{\addEntryField}[3]{%
\edef\entrykeya{#1}%
\edef\entrykeyb{#2}%
\edef\entrykeyc{#3}%
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
\map[foreach={#1}]{
\step[fieldsource=entrykey, match=\regexp{$MAPLOOP}, final]
\step[fieldset=\entrykeyb, fieldvalue=\entrykeyc]
}
}
}%
}
%用于人工的为条目或条目集删除域
\newcommand{\delEntryField}[2]{%
\edef\entrykeya{#1}%
\edef\entrykeyb{#2}%
\DeclareStyleSourcemap{
\maps[datatype=bibtex,overwrite]{
\map[foreach={#1}]{
\step[fieldsource=entrykey, match=\regexp{$MAPLOOP}, final]
\step[fieldset=\entrykeyb, fieldvalue={}]
}
}
}%
}
%
%驱动别名等价于驱动层映射
%
Expand Down Expand Up @@ -1590,8 +1627,10 @@
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\fi
\usebibmacro{name:andothers}}
\fi%
\iftoggle{bbx:gbnoothers}{}%
{\usebibmacro{name:andothers}}%
}
\DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式
\DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family
Expand Down
Loading

0 comments on commit 91535e3

Please sign in to comment.