diff options
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md | 17 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf | bin | 1175128 -> 1176525 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-map-test.bib | 53 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-map.py | 370 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/biblatex-gb7714-2015/example.bib | 31 |
6 files changed, 469 insertions, 4 deletions
diff --git a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md index ccb4c0cea64..83c8e1eef2f 100644 --- a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md +++ b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/README.md @@ -1,4 +1,4 @@ -<b>Date of last change: 2019-02-07 to version v1.0q</b> +<b>Date of last change: 2019-02-11 to version v1.0q</b> # biblatex-gb7714-2015: a biblatex style package @@ -631,7 +631,18 @@ biber -l zh__stroke jobname > 在正文中引用: ```双语文献引用\cite{易仕和2013--}``` - + + +* <b>我想修改文献条目的日期项诸如格式,请问该如何处理?</b> + +参考文献中日期格式主要有四种修改方式: +1. 利用biblatex选项全局的修改日期格式 +2. 修改日期输出宏,使根据条目类型输出不同的日期格式 +3. 修改日期输出宏,使根据具体条目输出不同的日期格式 +4. 修改参考文献信息,使当前条目原样输出需要的格式 + +具体示例见:[biblatex中如何修改参考文献中日期的著录格式](https://blog.csdn.net/xenonhu/article/details/86933525) + #### 4.3 Citation format/正文引用的标注格式 @@ -860,7 +871,7 @@ biber -l zh__stroke jobname * 2018/11/04 v1.0n * 2018/12/22 v1.0o * 2019/01/19 v1.0p -* 2019/02/07 v1.0q +* 2019/02/11 v1.0q --------------------------------------------------------- diff --git a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf Binary files differindex e4aa64808e1..14dc623e3be 100644 --- a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf +++ b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf diff --git a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex index 3e5ab746768..c7c61b15712 100644 --- a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex +++ b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-gb7714-2015.tex @@ -394,7 +394,7 @@ perl gb7714texttobib.pl in=textfilename out=bibfilename \begin{table}[!htb] \centering \caption{著者年份制常用命令示例}\label{tab:cite:authoryear} -\includegraphics[scale=0.9]{egciteaytab.pdf} +\includegraphics[scale=0.8]{egciteaytab.pdf} \end{table} diff --git a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-map-test.bib b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-map-test.bib new file mode 100644 index 00000000000..920ee7af21d --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-map-test.bib @@ -0,0 +1,53 @@ + +@NEWSPAPER{CITATION_NEWSPAPER, + author = "吴刚", + title = "立陶宛进入欧元时代", + journaltitle = "人民日报", + date = "2015-1-2", + language = "chs", + note = "" +} + +@BOOK{SANGUOYANYI, + author = "罗贯中", + title = "三国演义", + edition = "1", + address = "山西太原", + year = "元末明初", + language = "chs" +} + +@ELECTRONIC{BUPT_Thesis_Format_2004, + title = "关于研究生学位论文格式的统一要求", + author = "北京邮电大学研究生院培养与学位办公室", + etype = "EB", + ehowpublished = "OL", + date = "2004", + url = "http://www.bupt.edu.cn/", + language = "chs" +} + +@ELECTRONIC{latex-bupt, + author = "王旭", + title = "latex-bupt: \LaTeX style for {BUPT} thesis", + year = "2007", + etype = "EB", + ehowpublished = "OL", + refdate = "2009-01-14", + url = "http://code.google.com/p/latex-bupt/", + language = "chs" +} + +@ELECTRONIC{buptthesis, + author = "张煜", + title = "北京邮电大学研究生学位论文 \LaTeX{} 文档类", + year = "2009", + dhowpublished = "online", + urldate = "2013-7-6", + source = "http://code.google.com/p/buptthesis/", + language = "chs" +} + + + + diff --git a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-map.py b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-map.py new file mode 100644 index 00000000000..4ab2325fcd8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/biblatex-map.py @@ -0,0 +1,370 @@ +#!/usr/bin/env python + +""" +python script to modify bib data + +features: +1. souce map of biblatex +2. generalize date + +history: +v1.0 2019/02/09 + +biblatex source map opts: + +已实现的选项: +typesource=⟨entrytype⟩ +typetarget=⟨entrytype⟩ +fieldsource=⟨entryfield⟩ +fieldtarget=⟨entryfield⟩ +match=⟨regexp⟩ +matchi=⟨regexp⟩ +notmatch=⟨regexp⟩ +notmatchi=⟨regexp⟩ +replace=⟨regexp⟩ + +未实现的选项 +notfield=⟨entryfield⟩ +fieldset=⟨entryfield⟩ +fieldvalue=⟨string⟩ +entryclone=⟨clonekey⟩ +entrynew=⟨entrynewkey⟩ +entrynewtype=⟨string⟩ +entrytarget=⟨string⟩ +entrynocite=true, false default: false +entrynull=true, false default: false +append=true, false default: false +final=true, false default: false +null=true, false default: false +origfield=true, false default: false +origfieldval=true, false default: false +origentrytype=true, false default: false +""" + +__author__ = "Hu zhenzhen" +__version__ = "1.0" +__license__ = "MIT" +__email__ = "hzzmail@163.com" + +import string +import re +import sys +import datetime +import copy + + +# +# 为数据map设置参数 +#[]=maps +#[[],[]]=map in maps +#[[[]],[]]=step in map in mpas +#[[[{optionkey: }]],[]]=step in map in mpas +sourcemaps=[#maps + [#map1:将ELECTRONIC类型转换为online类型 + [{"typesource":"ELECTRONIC","typetarget":"online"}]#step1 + ], + [#map2:将source域转换为url域 + [{"fieldsource":"source","fieldtarget":"url"}]#step1 + ], + [#map3:将urldate域的信息“yyyy-m-d”转换为“yyyy-mm-dd”,注意正则表达式直接写不用在外面套"" + [{"fieldsource":"urldate","match":r'(\d\d\d\d)\-(\d)\-(\d)',"replace":r'\1-0\2-0\3'}]#step1 + ], + [#map4:将urldate域的信息“yyyy-m-d”转换为“yyyy-mm-dd”,注意正则表达式直接写不用在外面套"" + [{"fieldsource":"date","match":r'(\d\d\d\d)\-(\d)\-(\d)',"replace":r'\1-0\2-0\3'}]#step1 + ], + [#map5:将refdate域转换为urldate域 + [{"fieldsource":"refdate","fieldtarget":"urldate"}]#step1 + ], + +] + +# +# +#打开bib文件 +def readfilecontents(bibFile): + print("INFO: Reading references from '" + bibFile + "'") + try: + fIn = open(bibFile, 'r', encoding="utf8") + global bibfilecontents + bibfilecontents=fIn.readlines() + fIn.close() + except IOError: + print("ERROR: Input bib file '" + bibFile + + "' doesn't exist or is not readable") + sys.exit(-1) + +# +#打印bib文件内容 +def printfilecontents(): + for line in bibfilecontents: + print(line) + +# +#输出修改后的bib文件 +def writefilenewbib(bibFile): + biboutfile="new"+bibFile + print("INFO: writing references from '" + biboutfile + "'") + try: + fout = open(biboutfile, 'w', encoding="utf8") + fout.write("%% \n") + fout.write("%% bib file modified by bibmap.py\n") + print(datetime.datetime.now().isoformat(timespec='seconds')) + fout.write("%% "+datetime.datetime.now().isoformat(timespec='seconds')+"\n") + fout.write("%% \n\n\n") + for bibentry in bibentries: + fout.write('@'+bibentry["entrytype"]+'{'+bibentry["entrykey"]+',\n') + for k,v in bibentry.items(): + if k=="entrytype" or k=="entrykey" or v=='""': + pass + else: + fout.write('\t'+k+' = '+v+',\n') + fout.write('}\n\n') + + fout.close() + except IOError: + print("ERROR: Input bib file '" + bibFile + + "' doesn't exist or is not readable") + sys.exit(-1) + +# +#将条目解析放到bibentries列表中 +#每个条目是一个dict字典 +def bibentryparsing(): + global bibentries + bibentries=[] + bibentry={} + entrysn=0 + for line in bibfilecontents: + #print(line) + if line.startswith("@"):#条目开始行 + entrysn=entrysn+1 + entrynow=line.lstrip('@').split(sep='{', maxsplit=1) + #print(entrynow) + entrytype=entrynow[0] + bibentry['entrytype']=entrytype + entrykey=entrynow[1].split(sep=',', maxsplit=1)[0] + bibentry['entrykey']=entrykey + else: + if '=' in line:#条目域信息行 + entryline=line.lstrip() + entrynow=entryline.split(sep='=', maxsplit=1) + #print(entrynow) + entryfield=entrynow[0].strip().lstrip() + #print(entrynow[1]) + entryfieldline=entrynow[1].split(sep=',', maxsplit=1) + entryfieldvalue=entryfieldline[0].lstrip() + if entryfieldvalue=='': + pass + else: + bibentry[entryfield]=entryfieldvalue.strip() + elif '}' in line:#条目结束行 + print('entrysn=',entrysn) + global bibentryglobal + bibentryglobal=copy.deepcopy(bibentry) + bibentries.append(bibentryglobal) + bibentry={} + else: + pass + bibentrycounter=len(bibentries) + print('entrytotal=',bibentrycounter) + for bibentryi in bibentries: + print(bibentryi) + +def printbibentries(): + for bibentryi in bibentries: + print(bibentryi) + + + +# +# 执行数据映射操作 +# 还有很多选项没有实现,20190209 +# 实现的选项中也需要和未实现的选项进行数据传递 +def execsourcemap(): + for map in sourcemaps:#every map in maps,每个map逐步开始 + for bibentry in bibentries:#每个映射都需要遍历所有条目,对每个条目做map + + mapcontinue=1#大于0表示正常,继续当前条目的map + fieldsrcinfo={}#用于接收fieldsource相关处理的结果 + print("map info=",map) + for step in map:#every step in map + if mapcontinue>0: + for keyvals in step:#key-vals in step + for k,v in keyvals.items():#step 是有迹可循的,每个step总是存在一些东西,找到这些做其中的逻辑即可 + #print(k,v) + if k=="typesource":#条目类型设置 + mapcontinue=maptypesource(keyvals,bibentry)#coef is dict + elif k=="fieldsource":#域查找或设置 + mapcontinue=mapfieldsource(keyvals,bibentry,fieldsrcinfo)#coef is dict + pass + elif k=="fieldset":#域设置 + pass + elif k=="pertype":#类型限制 + pass + elif k=="pernottype":#类型限制 + pass + elif k=="notfield":#域限制 + pass + else: + pass + +# +#条目类型转换 +def maptypesource(keyvals,bibentry): + retrunval=1 + for k,v in keyvals.items(): + #print(k,v) + if k=='typesource': + typesource=v + elif k=='typetarget': + typetarget=v + elif k=='final': + retrunval=0 + else: + pass + + if bibentry['entrytype']==typesource: + bibentry['entrytype']=typetarget + return 1 + else: + return retrunval #存在final时,且不匹配则终止map + +# +#域名转换或判断域是否存在或match +def mapfieldsource(keyvals,bibentry,fieldsrcinfo): + mapfieldtype=0 #域名map的类型设置 + fieldmatch=''#匹配模式默认为空 + fieldmatchi=''#匹配模式默认为空 + + for k,v in keyvals.items(): + #print(k,v) + if k=='fieldsource': + fieldsource=v + elif k=='fieldtarget': + fieldtarget=v + mapfieldtype=1 #域map类型1,直接做域名转换 + elif k=='replace': + fieldreplace=v + mapfieldtype=2 #域map类型2,直接做域信息转换 + elif k=='final': + if v=='false': + fieldfinal=v + else: + fieldfinal='true' + mapfieldtype=3 #域map类型3,做final判断可以终止map + elif k=='match':#不区分大小写的match + fieldmatch=v + elif k=='matchi':#区分大小写的match + fieldmatchi=v + elif k=='notmatch':#区分大小写的match + fieldnotmatch=v + else: + pass + + + if mapfieldtype==0:#第0中情况即,不做信息转换,也不终止map,仅返回一些信息 + + if fieldsource in bibentry: + if fieldmatch=='': + m = re.match(fieldmatch, bibentry[fieldsource]) + if m: + fieldsrcinfo[fieldsource]=[bibentry[fieldsource],fieldmatch] + else: + fieldsrcinfo[fieldsource]=[None] #正则不匹配,则返回为None + + elif fieldmatchi=='': + m = re.match(fieldmatchi, bibentry[fieldsource]) + if m: + fieldsrcinfo[fieldsource]=[bibentry[fieldsource],fieldmatchi] + else: + fieldsrcinfo[fieldsource]=[None] #正则不匹配,则返回为None + + else: + fieldsrcinfo[fieldsource]=bibentry[fieldsource]#将域的值记录下来,用于下一step + + else: + fieldsrcinfo[fieldsource]=[None] #域不存在则返回为None + return 1 + + + elif mapfieldtype==1:#第1中情况即,做域名转换 + print('fieldsource=',fieldsource,'fieldtarget=',fieldtarget) + if fieldsource in bibentry: + bibentry[fieldtarget]=bibentry[fieldsource] + del bibentry[fieldsource] + fieldsrcinfo[fieldsource]=bibentry[fieldtarget] + else: + fieldsrcinfo[fieldsource]=[None] + return 1 + + elif mapfieldtype==2:#域map类型2,直接做域信息转换 + print('fieldsource=',fieldsource) + print('fieldmatch=',fieldmatch) + print('fieldreplace=',fieldreplace) + if fieldsource in bibentry: + if fieldmatch: + #strafrpl=re.sub(r'(\d\d\d\d)\-(\d)\-(\d)',r'\1-0\2-0\3','2015-1-3') + #strafrpl=re.sub(r'(\d\d\d\d)\-(\d)\-(\d)',r'\1-0\2-0\3',bibentry[fieldsource]) + strafrpl=re.sub(fieldmatch,fieldreplace,bibentry[fieldsource]) #执行替换 + print('strafterreplace=',strafrpl) + bibentry[fieldsource]=strafrpl + elif fieldmatchi: + strafrpl=re.sub(fieldmatchi, fieldreplace,bibentry[fieldsource]) + bibentry[fieldsource]=strafrpl + else: + fieldsrcinfo[fieldsource]=[None] + else: + fieldsrcinfo[fieldsource]=[None] + return 1 + + + elif mapfieldtype==3:#域map类型3,当没有匹配则终止map + if fieldsource in bibentry: + if fieldmatch: + m = re.match(fieldmatch, bibentry[fieldsource]) + if m: + fieldsrcinfo[fieldsource]=[bibentry[fieldsource],fieldmatch] + return 1 + else: + return 0 + + elif fieldmatchi: + if m: + fieldsrcinfo[fieldsource]=[bibentry[fieldsource],fieldmatchi] + return 1 + else: + return 0 + + else: + fieldsrcinfo[fieldsource]=bibentry[fieldsource]#将域的值记录下来,用于下一step + return 1 + + else: + return 0 + + + + + + + +#运行脚本测试 +if __name__=="__main__": + print('hello') + print(b'hello') + readfilecontents("biblatex-map-test.bib") + + printfilecontents() + + bibentryparsing() + + printbibentries() + + execsourcemap() + + printbibentries() + + writefilenewbib("biblatex-map-test.bib") + + +
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/example.bib b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/example.bib index 8ed8e7098dc..56ce4a57948 100644 --- a/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/example.bib +++ b/Master/texmf-dist/doc/latex/biblatex-gb7714-2015/example.bib @@ -579,6 +579,17 @@ author={乔纳斯} pages = {44} } +@inbook{姚中秋2008--, + author = {姚中秋}, + title = {一种制度变迁模式}, + bookauthor = {罗, 卫东 and 姚, 中秋}, + booktitle = {中国转型的理论分析}, + year = {2008}, + publisher = {浙江大学出版社}, + address = {杭州}, + pages = {44} +} + @ARTICLE{关立哲2014--, author = {关立哲 and 韩纪富 and 张晨延}, @@ -2615,6 +2626,16 @@ Workshop on Computer Algebra in Scientific Computing, Samarkand, October 5-9, 20 Month = {1} } +@Book{Miroslav2003--, + Title = {信号处理滤波器设计方法}, + Address = {北京}, + Author = {Miroslav, D. L. and Dejan, V. T.}, + Publisher = {电子工业出版社}, + Translator = {朱义胜 and 董辉}, + Year = {2003}, + Month = {1} +} + @Article{Giorgetti2005-1037-1042, Title = {The impact of OFDM interference on TH-PPM/BPAM transmission systems}, Author = {Giorgetti, A. and Dardari,D.}, @@ -3251,6 +3272,16 @@ Workshop on Computer Algebra in Scientific Computing, Samarkand, October 5-9, 20 Year = {2012} } +@Article{于潇2011-15-23, + Title = {互联网药品可信交易环境中主体资质审核备案模式}, + Author = {于, 潇 and 刘, 义 and 柴, 跃廷 and others}, + Journal = {清华大学学报}, + Number = {11}, + Pages = {15-23}, + Volume = {52}, + Year = {2011} +} + @Proceedings{中国社会科学院台湾史研究中心2012--, Title = {台湾光复六十五周年暨抗战史实学术研讨会论文集}, Address = {北京}, |