sjtug / SJTUThesis

上海交通大学 LaTeX 论文模板 | Shanghai Jiao Tong University LaTeX Thesis Template
Apache License 2.0
3.37k stars 792 forks source link

Improper alphabetic constant #374

Closed InnerPeace-Wu closed 6 years ago

InnerPeace-Wu commented 6 years ago

问题描述: 编译过程中出现以下错误:

e:/Temp/SJTUThesis/thesis.tex:84: Improper alphabetic constant.
<to be read again> 
                   \csuse 
l.84 \printbibliography[heading=bibintoc]

Output written on thesis.xdv (54 pages, 411972 bytes).
SyncTeX written on thesis.synctex.gz.

Transcript written on thesis.log.
Latexmk: Log file says output to 'thesis.xdv'
Latexmk: Found biber source file(s) [bib/thesis.bib thesis.bcf]
Collected error summary (may duplicate other messages):
  xelatex: Command for 'xelatex' gave return code 1
      Refer to 'thesis.log' for details
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
=== TeX engine is 'XeTeX'
Latexmk: Errors, so I did not complete making targets
D:\programs\texlive\2017\bin\win32\runscript.tlu:708: command failed with exit code 12:
perl.exe d:\programs\texlive\2017\texmf-dist\scripts\latexmk\latexmk.pl -synctex=1 -interaction=nonstopmode -file-line-error -halt-on-error -xelatex e:/Temp/SJTUThesis/thesis

系统信息:

日志信息:

hushidong commented 6 years ago

信息有点不足呀,能不能把无关的注释掉,给出个出错的mwe看看。

InnerPeace-Wu commented 6 years ago

问题主要出现在这句:

e:/Temp/SJTUThesis/thesis.tex:84: Improper alphabetic constant.
<to be read again> 
                   \csuse 
l.84 \printbibliography[heading=bibintoc]

以下是vscode的截图。

_20181026220028

sublime截图: image

bubifengyun commented 6 years ago

这类错误,我也遇到不少,一般都是先必应吧,国内不好爬墙。也可以在statckoverflow问。剩下的就是自己剪切有问题的段落。排除某些段落后,是否可以继续运行。这个时候发现之前学习的二分法还是不错的。慢慢压缩范围,一般都是自己写的问题。与其等别人回答,都已经可以测试出来哪里有问题了。

hushidong commented 6 years ago

猜不到,先把heading=一个选项去掉试试

InnerPeace-Wu commented 6 years ago

这类错误,我也遇到不少,一般都是先必应吧,国内不好爬墙。也可以在statckoverflow问。剩下的就是自己剪切有问题的段落。排除某些段落后,是否可以继续运行。这个时候发现之前学习的二分法还是不错的。慢慢压缩范围,一般都是自己写的问题。与其等别人回答,都已经可以测试出来哪里有问题了。

说得有道理,奇怪的是我什么都没改,用的是master源码,在几个机子上都出现这样的错误,就有些好奇。大致google了下,没有找到相关的问题。贴出来看看大家是否有遇到类似的。

InnerPeace-Wu commented 6 years ago

猜不到,先把heading=一个选项去掉试试

把这句注释掉就可以编译,把heading这个option完全去掉也不行。在mac下也会出现同样的问题。

zepinglee commented 6 years ago

最新的 texlive 2018 上编译没有问题;

可能是 texlive 2017 某个更新的 biblatex 版本有问题,建议装一个 texlive 2018 试试

hushidong commented 6 years ago

biblatex更新了?是什么版本?gb7714-2015是什么版本?

我的意思是把其他的去掉留下参考文献相关的内容贴出来,无法复现无法测试,找不到问题所在的。

hushidong commented 6 years ago

把有问题的打个包发给我,hzzmail@163.com,等我下高铁回家后看一下,晚上回复你。

gaocegege commented 6 years ago

我试了试,master 分支确实可以复现这个问题

Version 3.14159265-2.6-0.99996 (TeX Live 2016)

biblatex 42680(3.7)

我更新一下试试哈

TeX Live 2018 更新所有 package 后是可以 work 的,没有问题,可能 2016/2017 有点问题

@InnerPeace-Wu 建议更新到 2018 吧

更新指南: https://tug.org/texlive/upgrade.html

InnerPeace-Wu commented 6 years ago

首先谢谢各位的热情参与。我会更新到2018版再测试! 我从log里获取的版本信息: This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/W32TeX) (preloaded format=xelatex 2017.9.22) 27 OCT 2018 17:06 Package: biblatex 2016/12/05 v3.7 programmable bibliographies (PK/JW/AB)

hushidong commented 6 years ago

2018的确没有问题 你能看你下,biblatex和gb7714-2015的版本么?

比如:

biblatex.STY

\def\abx@date{2018/03/04} \def\abx@version{3.11}

gb7714-2015.BBX

\def\versionofgbtstyle{2018/08/14 v1.0m} \def\versionofbiblatex{\abx@version}

你可以先更新一下biblatex-gb7714-2015,然后试一下。

hushidong commented 6 years ago

我这个本上面没有2017了,这两天装个虚拟机再试一下texlive2017.

InnerPeace-Wu commented 6 years ago

gb7714-2015

相关信息如下: Package biblatex Info: Trying to load bibliography style 'gb7714-2015'... Package biblatex Info: ... file 'gb7714-2015.bbx' found. (d:/programs/texlive/2017/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx File: gb7714-2015.bbx 2017/02/26 v1.0g biblatex bibliography style

(d:/programs/texlive/2017/texmf-dist/tex/latex/biblatex/biblatex.sty Package: biblatex 2016/12/05 v3.7 programmable bibliographies (PK/JW/AB)

InnerPeace-Wu commented 6 years ago

我刚到gb7714-2015的repo里下载了最新的,可以编译成功了。看来是这个包的问题,因为我刚在另一个机子上装tex live 2018后也不work。

hushidong commented 6 years ago

你这边的问题是 texlive2017+biblatex3.7+gb7714-2015v1.0g 和texlive2018+biblatex3.11+gb7714-2015v1.0i 有问题,是吧?我会再测试一下,我是希望gb7714-2015能适应texlive2014以来的所有版本。最新的1.0m/n版前两天刚测试过一遍 texlive2015-2018,但从你的反应看,老的版本可能有点问题,我找找原因所在。

InnerPeace-Wu commented 6 years ago

是的,都是texlive默认的包,我查了下是你说的版本搭配。 原来是gb包作者本人,谢谢!

才发现,几个月我应该也遇到了同样的问题,当时我就自己下载最新的gb7714-2015到主目录下解决了。

hushidong commented 6 years ago

我测试了一下,一般情况下 texlive2018+biblatex3.11+gb7714-2015v1.0i 不会出现问题,比如我测试了如下两个例子:

例1:

\documentclass[twoside]{article}
    \usepackage{ctex}
    \usepackage{xcolor}
    \usepackage{toolbox}
    \usepackage{hyperref}
    \usepackage{lipsum}
    \usepackage[top=10pt,bottom=10pt,left=1cm,right=1cm,showframe,showcrop]{geometry}
\usepackage[backend=biber,style=gb7714-2015]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}

@patent{IEEEexample:jppat,
  author        = "U. Hideki",
  title         = "Quadrature Modulation Circuit",
  type          = "patentjp",
  number        = "152932/92",
  year          = "1992-05-20"
}

@patent{IEEEexample:frenchpatreq,
  author        = "F. Kowalik and M. Isard",
  title         = "Estimateur d'un D{\'e}faut de Fonctionnement
                   d'un Modulateur en Quadrature et {\'E}tage de Modulation
                   l'Utilisant",
  language      = "french",
  type          = "French Patent Request",
  number        = "9500261",
  year          = "1995-01-11"
}

@patent{IEEEexample:uspat,
  author        = "Ronald E. Sorace and Victor S. Reinhardt and
                   Steven A. Vaughn",
  holder        = "Hughes Aircraft Company",
  location      = "Los Angeles, CA",
  title         = "High-Speed Digital-to-{RF} Converter",
  type          = "patentus",
  number        = "5668842",
  yearfiled     = "1995-02-28",
  year          = "1997-09-16",
}

@inbook{IEEEexample:repeatedauthorone,
  author    = "W. Dai and H. V. Pham and O. Milenkovic",
  title     = "Distortion-rate functions for quantized compressive sensing",
  booktitle =
    "IEEE Information Theory Workshop on Networking and Information Theory",
  year      = "2009"
}

@inbook{IEEEexample:repeatedauthortwo,
  author    = "W. Dai and H. V. Pham and O. Milenkovic",
  title     = "comparative study of quantized compressive sensing schemes",
  booktitle =
    "IEEE Information Theory Workshop on Networking and Information Theory",
  year      = "2009"
}

@thesis{IEEEexample:masterstype,
  author        = "A. Karnik",
  title         = "Performance of {TCP} Congestion Control with Rate
                   Feedback: {TCP/ABR} and Rate Adaptive {TCP/IP}",
  institution   = "Indian Institute of Science",
  type          = "M. Eng. thesis",
  location      = "Bangalore, India",
  year          = "1999-01"
}

@unpublished{IEEEexample:unpublished,
  author        = "T. J. Ott and N. Aggarwal",
  title         = "{TCP} over {ATM}: {ABR} or {UBR}",
  howpublished  = "Unpublished"
}

@database{databaseeg,
  AUTHOR = {Zhang, San},
  DATE = {2007},
  TITLE = {A data base},
  medium={CD}
}

@dataset{dataseteg,
  AUTHOR = {Zhang, Yi},
  DATE = {2008},
  TITLE = {A data set},
  medium={DK}
}

@archive{archiveeg,
  AUTHOR = {Zhang, Er},
  DATE = {2009},
  TITLE = {An archive for friend B},
  medium={MT}
}

@software{softwareeg,
  AUTHOR = {Zhang, Liu},
  DATE = {2009},
  TITLE = {A software for science computation},
  medium={CD}
}

@map{mapeg,
  AUTHOR = {Zhang, Si},
  DATE = {2010},
  TITLE = {An map},
}

@Misc{Misceg,
  AUTHOR = {Zhang, Wu},
  DATE = {2010},
  TITLE = {An unknow type reference},
}

@ARTICLE{aritileeg,
  AUTHOR = {Zhang, Qi},
  DATE = {2007},
  JOURNALTITLE = {An periodical},
  PAGES = {82--92},
  TITLE = {An article for test},
  VOLUME = {12},
  NUMBER ={2},
  mark={J},
  medium={OL},
}

@ARTICLE{方军雄2007所有制,
  AUTHOR = {方军雄},
  DATE = {2007},
  JOURNALTITLE = {经济研究},
  PAGES = {82--92},
  TITLE = {所有制, 制度环境与信贷资金配置},
  VOLUME = {12},
}

@ARTICLE{李晓西1994转轨过程中的结构性通货膨胀,
  AUTHOR = {李晓西},
  DATE = {1994},
  JOURNALTITLE = {经济研究},
  KEYWORDS = {李晓西1994转轨过程中的结构性通货膨胀},
  NUMBER = {10},
  PAGES = {28--32},
  TITLE = {转轨过程中的结构性通货膨胀},
}

@ARTICLE{刘凤良2017,
  AUTHOR = {刘凤良 and 章潇萌 and 于泽},
  DATE = {2017},
  JOURNALTITLE = {金融研究},
  KEYWORDS = {刘凤良2017},
  NUMBER = {2},
  PAGES = {54--69},
  TITLE = {高投资、结构失衡与价格指数二元分化},
}

@ARTICLE{楼继伟2016改革,
  AUTHOR = {楼继伟},
  DATE = {2016},
  JOURNALTITLE = {求是},
  KEYWORDS = {楼继伟2016改革},
  NUMBER = {1},
  PAGES = {24--26},
  TITLE = {中国经济最大潜力在于改革},
}

@ARTICLE{吕捷2015cpi,
  AUTHOR = {吕捷 and 王高望},
  DATE = {2015},
  JOURNALTITLE = {经济研究},
  KEYWORDS = {吕捷2015cpi},
  PAGES = {011},
  TITLE = {CPI 与 PPI “背离” 的结构性解释},
  VOLUME = {4},
}

@ARTICLE{罗德明2012要素市场扭曲,
  AUTHOR = {罗德明 and 李晔 and 史晋川},
  DATE = {2012},
  JOURNALTITLE = {经济研究},
  KEYWORDS = {罗德明2012要素市场扭曲},
  NUMBER = {3},
  PAGES = {4--14},
  TITLE = {要素市场扭曲、资源错置与生产率},
}

@ARTICLE{王国静2014金融冲击,
  AUTHOR = {王国静 and 田国强},
  DATE = {2014},
  JOURNALTITLE = {经济研究},
  KEYWORDS = {王国静2014金融冲击},
  NUMBER = {3},
  PAGES = {20--34},
  TITLE = {金融冲击和中国经济波动},
  VOLUME = {49},
}

@ARTICLE{王文甫2010价格粘性,
  AUTHOR = {王文甫},
  DATE = {2010},
  JOURNALTITLE = {管理世界},
  KEYWORDS = {王文甫2010价格粘性},
  NUMBER = {9},
  PAGES = {11--25},
  TITLE = {价格粘性, 流动性约束与中国财政政策的宏观效应——动态新凯恩斯主义视角},
}

@ARTICLE{徐伟康2010对,
  AUTHOR = {徐伟康},
  DATE = {2010},
  JOURNALTITLE = {经济研究},
  KEYWORDS = {徐伟康2010对},
  NUMBER = {5},
  PAGES = {139--148},
  TITLE = {对《 消费者价格指数与生产者价格指数: 谁带动谁?》 一文的质疑},
}

@ARTICLE{杨光2015经济波动,
  AUTHOR = {杨光 and 孙浦阳 and 龚刚},
  DATE = {2015},
  JOURNALTITLE = {经济研究},
  KEYWORDS = {杨光2015经济波动},
  NUMBER = {2},
  PAGES = {47--60},
  TITLE = {经济波动, 成本约束与资源配置},
  VOLUME = {50},
}

@ARTICLE{杨汝岱2015中国制造,
  AUTHOR = {杨汝岱},
  DATE = {2015},
  JOURNALTITLE = {经济研究},
  KEYWORDS = {杨汝岱2015中国制造},
  PAGES = {61--74},
  TITLE = {中国制造业企业全要素生产率研究},
  VOLUME = {2},
}

@ARTICLE{张成思2010长期均衡,
  AUTHOR = {张成思},
  DATE = {2010},
  JOURNALTITLE = {经济研究},
  KEYWORDS = {张成思2010长期均衡},
  PAGES = {42--52},
  TITLE = {长期均衡, 价格倒逼与货币驱动},
  VOLUME = {6},
}

@INCOLLECTION{adam2011house,
  AUTHOR = {Adam, Klaus and Kuang, Pei and Marcet, Albert},
  PUBLISHER = {University of Chicago Press},
  BOOKTITLE = {NBER Macroeconomics Annual 2011, Volume 26},
  DATE = {2011},
  KEYWORDS = {adam2011house},
  PAGES = {77--122},
  TITLE = {House price booms and the current account},
}

@ARTICLE{bernanke1989agency,
  AUTHOR = {Bernanke, Ben and Gertler, Mark},
  PUBLISHER = {JSTOR},
  DATE = {1989},
  JOURNALTITLE = {The American Economic Review},
  KEYWORDS = {bernanke1989agency},
  PAGES = {14--31},
  TITLE = {Agency costs, net worth, and business fluctuations},
}

@REPORT{calvo2006phoenix,
  AUTHOR = {Calvo, Guillermo A and Izquierdo, Alejandro and Talvi, Ernesto},
  INSTITUTION = {National Bureau of Economic Research},
  DATE = {2006},
  KEYWORDS = {calvo2006phoenix},
  TITLE = {Phoenix miracles in emerging markets: recovering without credit from systemic financial crises},
}

@ARTICLE{davis2005housing,
  AUTHOR = {Davis, Morris A and Heathcote, Jonathan},
  PUBLISHER = {Wiley Online Library},
  DATE = {2005},
  JOURNALTITLE = {International Economic Review},
  KEYWORDS = {davis2005housing},
  NUMBER = {3},
  PAGES = {751--784},
  TITLE = {Housing and the business cycle},
  VOLUME = {46},
}

@ARTICLE{enders2009international,
  AUTHOR = {Enders, Zeno and M{ü}ller, Gernot J},
  PUBLISHER = {Elsevier},
  DATE = {2009},
  JOURNALTITLE = {Journal of International Economics},
  KEYWORDS = {enders2009international},
  NUMBER = {1},
  PAGES = {45--59},
  TITLE = {On the international transmission of technology shocks},
  VOLUME = {78},
}

@ARTICLE{fazzari1993working,
  AUTHOR = {Fazzari, Steven M and Petersen, Bruce C},
  PUBLISHER = {JSTOR},
  DATE = {1993},
  JOURNALTITLE = {The RAND Journal of Economics},
  KEYWORDS = {fazzari1993working},
  PAGES = {328--342},
  TITLE = {Working capital and fixed investment: new evidence on financing constraints},
}

@ARTICLE{greenwood1988investment,
  AUTHOR = {Greenwood, Jeremy and Hercowitz, Zvi and Huffman, Gregory W},
  PUBLISHER = {JSTOR},
  DATE = {1988},
  JOURNALTITLE = {The American Economic Review},
  KEYWORDS = {greenwood1988investment},
  PAGES = {402--417},
  TITLE = {Investment, capacity utilization, and the real business cycle},
}

@ARTICLE{hayashi1985tests,
  AUTHOR = {Hayashi, Fumio},
  DATE = {1985},
  JOURNALTITLE = {NBER Working Paper},
  KEYWORDS = {hayashi1985tests},
  NUMBER = {w1720},
  TITLE = {Tests for Liquidity Constraints: a Critical Survey},
}

@ARTICLE{iacoviello2005house,
  AUTHOR = {Iacoviello, Matteo},
  PUBLISHER = {American Economic Association},
  DATE = {2005},
  JOURNALTITLE = {The American economic review},
  KEYWORDS = {iacoviello2005house},
  NUMBER = {3},
  PAGES = {739--764},
  TITLE = {House prices, borrowing constraints, and monetary policy in the business cycle},
  VOLUME = {95},
}

@ARTICLE{jermann2012macroeconomic,
  AUTHOR = {Jermann, Urban and Quadrini, Vincenzo},
  PUBLISHER = {American Economic Association},
  DATE = {2012},
  JOURNALTITLE = {The American Economic Review},
  KEYWORDS = {jermann2012macroeconomic},
  NUMBER = {1},
  PAGES = {238--271},
  TITLE = {Macroeconomic effects of financial shocks},
  VOLUME = {102},
}

@ARTICLE{khan2013credit,
  AUTHOR = {Khan, Aubhik and Thomas, Julia K},
  PUBLISHER = {University of Chicago Press},
  DATE = {2013},
  JOURNALTITLE = {Journal of Political Economy},
  KEYWORDS = {khan2013credit},
  NUMBER = {6},
  PAGES = {1055--1107},
  TITLE = {Credit shocks and aggregate fluctuations in an economy with production heterogeneity},
  VOLUME = {121},
}

@ARTICLE{kiyotaki1997credit,
  AUTHOR = {Kiyotaki, Nobuhiro and Moore, John},
  PUBLISHER = {University of Chicago Press},
  DATE = {1997},
  JOURNALTITLE = {Journal of Political Economy},
  KEYWORDS = {kiyotaki1997credit},
  NUMBER = {2},
  PAGES = {211--248},
  TITLE = {Credit cycles},
  VOLUME = {105},
}

@ARTICLE{kocherlakota2000creating,
  AUTHOR = {Kocherlakota, Narayana and others},
  DATE = {2000},
  JOURNALTITLE = {Federal Reserve Bank of Minneapolis Quarterly Review},
  KEYWORDS = {kocherlakota2000creating},
  NUMBER = {3},
  PAGES = {2--10},
  TITLE = {Creating business cycles through credit constraints},
  VOLUME = {24},
}

@INPROCEEDINGS{lucas1976econometric,
  AUTHOR = {Lucas, Robert E},
  ORGANIZATION = {North-Holland},
  BOOKTITLE = {Carnegie-Rochester conference series on public policy},
  DATE = {1976},
  KEYWORDS = {lucas1976econometric},
  PAGES = {19--46},
  TITLE = {Econometric policy evaluation: A critique},
  VOLUME = {1},
}

@ARTICLE{lucas1987money,
  AUTHOR = {Lucas, Robert and Stokey, Nancy},
  PUBLISHER = {Econometric Society},
  DATE = {1987},
  JOURNALTITLE = {Econometrica},
  KEYWORDS = {lucas1987money},
  NUMBER = {3},
  PAGES = {491--513},
  TITLE = {Money and Interest in a Cash-in-Advance Economy},
  VOLUME = {55},
}

@ARTICLE{quadrini2011financial,
  AUTHOR = {Quadrini, Vincenzo},
  DATE = {2011},
  JOURNALTITLE = {Economic Quarterly},
  KEYWORDS = {quadrini2011financial},
  NUMBER = {3},
  PAGES = {209--254},
  TITLE = {Financial Frictions in Macroeconomic Fluctuations},
  VOLUME = {79},
}

@ARTICLE{saiz2010geographic,
  AUTHOR = {Saiz, Albert},
  PUBLISHER = {JSTOR},
  DATE = {2010},
  JOURNALTITLE = {quarterly Journal of Economics},
  KEYWORDS = {saiz2010geographic},
  NUMBER = {3},
  TITLE = {The geographic determinants of housing supply},
  VOLUME = {125},
}

@ARTICLE{wang2006another,
  AUTHOR = {Wang, Peng-fei and Wen, Yi},
  PUBLISHER = {Elsevier},
  DATE = {2006},
  JOURNALTITLE = {Journal of Economic Dynamics and Control},
  KEYWORDS = {wang2006another},
  NUMBER = {12},
  PAGES = {2533--2552},
  TITLE = {Another look at sticky prices and output persistence},
  VOLUME = {30},
}

@REPORT{xu2012role,
  AUTHOR = {Xu, TengTeng},
  INSTITUTION = {Faculty of Economics, University of Cambridge},
  DATE = {2012},
  KEYWORDS = {xu2012role},
  TITLE = {The role of credit in international business cycles},
}

@ARTICLE{zhang2009china,
  AUTHOR = {Zhang, Wenlang},
  PUBLISHER = {Elsevier},
  DATE = {2009},
  JOURNALTITLE = {Journal of Macroeconomics},
  KEYWORDS = {zhang2009china},
  NUMBER = {3},
  PAGES = {473--484},
  TITLE = {China’s monetary policy: Quantity versus price rules},
  VOLUME = {31},
}

    @Book{Yi2014--,
      Title                    = {Test},
      Address                  = {Address},
      Author                   = {Yi and B and C},
      Publisher                = {Publisher},
      Year                     = {2014}
    }
    @Book{Yi2013--,
      Title                    = {Supersonic and hypersonic nozzle design},
      Address                  = {BeiJing},
      Author                   = {Yi, S H and Zhao, Y X and He, L and Zhang, M L},
      Publisher                = {National Defense Industry Press},
      Year                     = {2013}
    }

    @Periodical{AAAS1883--,
  Title                    = {Science},
  Date                     = {1883},
  Editor                   = {{American Association for the Advancement of Science}},
  Number                   = {1},
  Volume                   = {1},
  Location                 = {Washington, D.C.},
  Publisher                = {American Association for the Advancement of Science}
}

@Proceedings{ROSENTHALL1963--,
  Title                    = {Proceedings of the Fifth Canadian Mathematical Congress, University of Montreal, 1961},
  Date                     = {1963},
  Publisher                = {University of Toronto Press},
  Editor                   = {E M ROSENTHALL},
  Location                 = {Toronto}
}

@Thesis{CALMS1965--,
  Title                    = {Infrared spectroscopic studies on solid oxygen},
  Author                   = {R B CALMS},
  Date                     = {1965},
  Institution              = {Univ. of California},
  Location                 = {Berkeley}
}

@Report{WHO1970--,
  Title                    = {Factors regulating the immune response},
  Author                   = {{World Health Organization}},
  Date                     = {1970},
  Institution              = {WHO},
  Location                 = {Geneva},
  Titleaddon               = {report of WHO Scientific Group}
}

@Inproceedings{FOURNEY1971-17-38,
  Title                    = {Advances in holographic photoelasticity},
  Author                   = {M E FOURNEY},
  Booktitle                = {Symposium on Applications of Holography in Mechanics, August 23-25, 1971, University of Southern California, Los Angeles, California},
  Date                     = {1971},
  Pages                    = {17-38},
  Publisher                = {ASME},
  Location                 = {New York}
}

    @Article{abx2007-500-503,
      Title                    = {超声速短化喷管的设计和试验研究},
      Author                   = {张敏莉 and 易仕和 and 赵玉新 and 李明},
      Journal                  = {空气动力学报},
      Year                     = {2007},
      Number                   = {4},
      Pages                    = {500-503},
      Volume                   = {25},
      language                 = {chinese}
    }

    @BOOK{张伯伟2002--,
  AUTHOR = {张伯伟},
  LOCATION = {南京},
  PUBLISHER = {江苏古籍出版社},
  DATE = {2002},
  KEYWORDS = {张伯伟2002--},
  PAGES = {288},
  TITLE = {全唐五代诗格会考},
  language = {chinese}
}

@PROCEEDINGS{雷光春2012--,
  AUTHOR = {雷光春},
  LOCATION = {北京},
  PUBLISHER = {海洋出版社},
  DATE = {2012},
  KEYWORDS = {雷光春2012--},
  TITLE = {综合湿地管理:综合湿地管理国际研讨会论文集},
  language = {chinese}
}

@REPORT{汤万金2013-09-30--,
  AUTHOR = {汤万金 and 杨跃翔 and 刘文 and others},
  URL = {http://www.nstrs.org.cn},
  DATE = {2013-09-30},
  KEYWORDS = {汤万金2013-09-30--},
  TITLE = {人体安全重要技术标准研制最终报告:7178999X},
  URLDATE = {2014-06-24},
  language = {chinese}
}

@INPROCEEDINGS{贾东琴2011-45-52,
  AUTHOR = {贾东琴 and 柯平},
  BOOKAUTHOR = {中国图书馆学会},
  LOCATION = {北京},
  PUBLISHER = {国家图书馆出版社},
  BOOKTITLE = {中国图书馆学会年会论文集:2011年卷},
  DATE = {2011},
  KEYWORDS = {贾东琴2011-45-52},
  PAGES = {45--52},
  TITLE = {面向数字素养的高校图书馆数字服务体系研究},
  language = {chinese}
}

@INCOLLECTION{韩吉人1985-90-99,
  AUTHOR = {韩吉人},
  BOOKAUTHOR = {中国职工教育研究会},
  LOCATION = {北京},
  PUBLISHER = {人民教育出版社},
  BOOKTITLE = {职工教育研究论文集},
  DATE = {1985},
  KEYWORDS = {韩吉人1985-90-99},
  PAGES = {90--99},
  TITLE = {论职工教育的特点},
  language = {chinese}
}

@THESIS{马欢2011-27-27,
  AUTHOR = {马欢},
  INSTITUTION = {清华大学},
  LOCATION = {北京},
  URL = {http://www.cnki.net},
  DATE = {2011},
  KEYWORDS = {马欢2011-27-27},
  PAGES = {27},
  TITLE = {人类活动影响下海河流域典型区水循环变化分析},
  URLDATE = {2013-10-14},
  language = {chinese}
}

@PATENT{张凯军2012-04-05--,
  AUTHOR = {张凯军},
  DATE = {2012-04-05},
  KEYWORDS = {张凯军2012-04-05--},
  NUMBER = {201220158825.2},
  TITLE = {轨道火车及高速轨道火车紧急安全制动辅助装置},
  language = {chinese}
}

@BOOK{国家环境保护局科技标准司1996-2-3,
  AUTHOR = {国家环境保护局科技标准司},
  LOCATION = {北京},
  PUBLISHER = {中国标准出版社},
  URL = {http://wenku.baidu.com},
  DATE = {1996},
  KEYWORDS = {国家环境保护局科技标准司1996-2-3,standard},
  NOTE = {standard},
  PAGES = {2--3},
  TITLE = {土壤环境质量标准:GB 15616-1995},
  URLDATE = {2013-10-14},
  language = {chinese}
}

@INBOOK{白书农1998-146-163,
  AUTHOR = {白书农},
  BOOKAUTHOR = {李承森},
  LOCATION = {北京},
  PUBLISHER = {高等教育出版社},
  BOOKTITLE = {植物科学进展},
  DATE = {1998},
  KEYWORDS = {白书农1998-146-163},
  PAGES = {146--163},
  TITLE = {植物开花研究},
  language = {chinese}
}

@ARTICLE{杨洪升2013-56-75,
  AUTHOR = {杨洪升},
  DATE = {2013},
  JOURNALTITLE = {文献},
  KEYWORDS = {杨洪升2013-56-75},
  NUMBER = {1},
  PAGES = {56--75},
  TITLE = {四库馆私家抄校书考略},
  language = {chinese}
}

@COLLECTION{中国职工教育研究会1985--,
  AUTHOR = {中国职工教育研究会},
  LOCATION = {北京},
  PUBLISHER = {人民教育出版社},
  DATE = {1985},
  KEYWORDS = {中国职工教育研究会1985--},
  TITLE = {职工教育研究论文集},
  language = {chinese}
}

@ARTICLE{丁文祥2000--,
  AUTHOR = {丁文祥},
  DATE = {2000-11-20},
  JOURNALTITLE = {中国青年报},
  KEYWORDS = {丁文祥2000--,news},
  NOTE = {news},
  NUMBER = {15},
  TITLE = {数字革命与竞争国际化},
  language = {chinese}
}

@ONLINE{李强2012-05-03--,
  AUTHOR = {李强},
  URL = {http://wenku.baidu.com},
  DATE = {2012-05-03},
  KEYWORDS = {李强2012-05-03--},
  TITLE = {化解医患矛盾需釜底抽薪},
  URLDATE = {2013-03-25},
  language = {chinese}
}

@PERIODICAL{中华医学会湖北分会1984--,
  EDITOR = {中华医学会湖北分会},
  INSTITUTION = {中华医学会湖北分会},
  LOCATION = {武汉},
  DATE = {1984},
  KEYWORDS = {中华医学会湖北分会1984--},
  NUMBER = {1},
  TITLE = {临床内科杂志},
  VOLUME = {1},
  language = {chinese}
}
\end{filecontents}
    \addbibresource{\jobname.bib}

    \begin{document}
    \section{set title}

    文献\cite{zhang2009china,abx2007-500-503,丁文祥2000--,Yi2013--,张伯伟2002--,国家环境保护局科技标准司1996-2-3,中国职工教育研究会1985--,白书农1998-146-163,adam2011house,韩吉人1985-90-99,FOURNEY1971-17-38,贾东琴2011-45-52,李强2012-05-03--,张凯军2012-04-05--,AAAS1883--,中华医学会湖北分会1984--,ROSENTHALL1963--,雷光春2012--,WHO1970--,汤万金2013-09-30--,CALMS1965--,马欢2011-27-27}

    \cite{IEEEexample:jppat,IEEEexample:frenchpatreq,IEEEexample:uspat,
IEEEexample:repeatedauthorone,IEEEexample:repeatedauthortwo,
IEEEexample:masterstype,IEEEexample:unpublished}

    \printbibliography[heading=bibintoc]

    \end{document} 

例2,是从sjtuthesis中抽取文献部分内容做的测试:

\documentclass[twoside]{article}
    \usepackage{ctex}
    \usepackage{xcolor}
    \usepackage{toolbox}
    \usepackage{hyperref}
    \usepackage{lipsum}
    \usepackage[top=10pt,bottom=10pt,left=1cm,right=1cm,showframe,showcrop]{geometry}
\usepackage[inline]{enumitem}
\usepackage{listings}
\usepackage[backend=biber,style=gb7714-2015]{biblatex}
%
\addbibresource{bib/thesis.bib}

    \begin{document}

\include{tex/example}

    \printbibliography[heading=bibintoc]

    \end{document} 

example:

%# -*- coding: utf-8-unix -*-
% !TEX program = xelatex
% !TEX root = ../thesis.tex
% !TEX encoding = UTF-8 Unicode
%%==================================================
%% chapter02.tex for SJTU Master Thesis
%% based on CASthesis
%% modified by wei.jianwen@gmail.com
%% Encoding: UTF-8
%%==================================================

%\chapter{{\LaTeX} 排版例子}
%\label{chap:example}

%\section{列表环境}
%\label{sec:list}
%
%\subsection{无序列表}
%\label{sec:unorderlist}
%
%以下是一个无序列表的例子,列表的每个条目单独分段。
%
%\begin{itemize}
%  \item 这是一个无序列表。
%  \item 这是一个无序列表。
%  \item 这是一个无序列表。
%\end{itemize}
%
%使用\verb+itemize*+环境可以创建行内无序列表。
%\begin{itemize*}
%  \item 这是一个无序列表。
%  \item 这是一个无序列表。
%  \item 这是一个无序列表。
%\end{itemize*}
%行内无序列表条目不单独分段,所有内容直接插入在原文的段落中。
%
%\subsection{有序列表}
%\label{sec:orderlist}
%
%使用环境\verb+enumerate+和\verb+enumerate*+创建有序列表,
%使用方法无序列表类似。
%
%\begin{enumerate}
%  \item 这是一个有序列表。
%  \item 这是一个有序列表。
%  \item 这是一个有序列表。
%\end{enumerate}
%
%使用\verb+enumerate*+环境可以创建行内有序列表。
%\begin{enumerate*}
%  \item 这是一个默认有序列表。
%  \item 这是一个默认有序列表。
%  \item 这是一个默认有序列表。
%\end{enumerate*}
%行内有序列表条目不单独分段,所有内容直接插入在原文的段落中。
%
%\subsection{描述型列表}
%
%使用环境\verb+description+可创建带有主题词的列表,条目语法是\verb+\item[主题] 内容+。
%\begin{description}
%    \item[主题一] 详细内容
%    \item[主题二] 详细内容
%    \item[主题三] 详细内容 \ldots
%\end{description}
%
%\subsection{自定义列表样式}
%
%可以使用\verb+label+参数控制列表的样式,
%详细可以参考WikiBooks\footnote{\url{https://en.wikibooks.org/wiki/LaTeX/List_Structures\#Customizing_lists}}。
%比如一个自定义样式的行内有序列表
%\begin{enumerate*}[label=\itshape\alph*)\upshape]
%  \item 这是一个自定义样式有序列表。
%  \item 这是一个自定义样式有序列表。
%  \item 这是一个自定义样式有序列表。
%\end{enumerate*}
%
%\section{数学排版}
%\label{sec:matheq}
%
%\subsection{公式排版}
%\label{sec:eqformat}
%
%这里有举一个长公式排版的例子,来自\href{http://www.tex.ac.uk/tex-archive/info/math/voss/mathmode/Mathmode.pdf}{《Math mode》}:
%
%\begin {multline}
%  \frac {1}{2}\Delta (f_{ij}f^{ij})=
%  2\left (\sum _{i<j}\chi _{ij}(\sigma _{i}-
%    \sigma _{j}) ^{2}+ f^{ij}\nabla _{j}\nabla _{i}(\Delta f)+\right .\\
%  \left .+\nabla _{k}f_{ij}\nabla ^{k}f^{ij}+
%    f^{ij}f^{k}\left [2\nabla _{i}R_{jk}-
%      \nabla _{k}R_{ij}\right ]\vphantom {\sum _{i<j}}\right )
%\end{multline}
%
%\subsection{SI单位}
%
%使用\verb+siunitx+宏包可以方便地输入SI单位制单位,例如\verb+\SI{5}{\um}+可以得到\SI{5}{\um}。
%
%\subsubsection{一个四级标题}
%\label{sec:depth4}
%
%这是全文唯一的一个四级标题。在这部分中将演示了mathtools宏包中可伸长符号(箭头、等号的例子)的例子。
%
%\begin{displaymath}
%    A \xleftarrow[n=0]{} B \xrightarrow[LongLongLongLong]{n>0} C
%\end{displaymath}
%
%\begin{eqnarray}
%  f(x) & \xleftrightarrow[]{A=B}  & B \\
%  & \xleftharpoondown[below]{above} & B \nonumber \\
%  & \xLeftrightarrow[below]{above} & B
%\end{eqnarray}
%
%又如:
%
%\begin{align}
%  \label{eq:none}
%  & I(X_3;X_4)-I(X_3;X_4\mid{}X_1)-I(X_3;X_4\mid{}X_2) \nonumber \\
%  = & [I(X_3;X_4)-I(X_3;X_4\mid{}X_1)]-I(X_3;X_4\mid{}\tilde{X}_2) \\
%  = & I(X_1;X_3;X_4)-I(X_3;X_4\mid{}\tilde{X}_2)
%\end{align}
%
%\subsection{定理环境}
%
%模板中定义了丰富的定理环境
%algo(算法),thm(定理),lem(引理),prop(命题),cor(推论),defn(定义),conj(猜想),exmp(例),rem(注),case(情形),
%bthm(断言定理),blem(断言引理),bprop(断言命题),bcor(断言推论)。
%amsmath还提供了一个proof(证明)的环境。
%这里举一个“定理”和“证明”的例子。
%\begin{thm}[留数定理]
%\label{thm:res}
%  假设$U$是复平面上的一个单连通开子集,$a_1,\ldots,a_n$是复平面上有限个点,$f$是定义在$U\backslash \{a_1,\ldots,a_n\}$上的全纯函数,
%  如果$\gamma$是一条把$a_1,\ldots,a_n$包围起来的可求长曲线,但不经过任何一个$a_k$,并且其起点与终点重合,那么:
%
%  \begin{equation}
%    \label{eq:res}
%    \ointop_{\gamma}f(z)\,\mathrm{d}z = 2\uppi\mathbf{i}\sum^n_{k=1}\mathrm{I}(\gamma,a_k)\mathrm{Res}(f,a_k)
%  \end{equation}
%
%  如果$\gamma$是若尔当曲线,那么$\mathrm{I}(\gamma, a_k)=1$,因此:
%
%  \begin{equation}
%    \label{eq:resthm}
%    \ointop_{\gamma}f(z)\,\mathrm{d}z = 2\uppi\mathbf{i}\sum^n_{k=1}\mathrm{Res}(f,a_k)
%  \end{equation}
%
%      % \oint_\gamma f(z)\, dz = 2\pi i \sum_{k=1}^n \mathrm{Res}(f, a_k ).
%
%  在这里,$\mathrm{Res}(f, a_k)$表示$f$在点$a_k$的留数,$\mathrm{I}(\gamma,a_k)$表示$\gamma$关于点$a_k$的卷绕数。
%  卷绕数是一个整数,它描述了曲线$\gamma$绕过点$a_k$的次数。如果$\gamma$依逆时针方向绕着$a_k$移动,卷绕数就是一个正数,
%  如果$\gamma$根本不绕过$a_k$,卷绕数就是零。
%
%  定理\ref{thm:res}的证明。
%
%  \begin{proof}
%    首先,由……
%
%    其次,……
%
%    所以……
%  \end{proof}
%\end{thm}
%
%上面的公式例子中,有一些细节希望大家注意。微分号d应该使用“直立体”也就是用mathrm包围起来。
%并且,微分号和被积函数之间应该有一段小间隔,可以插入\verb+\,+得到。
%斜体的$d$通常只作为一般变量。
%i,j作为虚数单位时,也应该使用“直立体”为了明显,还加上了粗体,例如\verb+\mathbf{i}+。斜体$i,j$通常用作表示“序号”。
%其他字母在表示常量时,也推荐使用“直立体”譬如,圆周率$\uppi$(需要upgreek宏包),自然对数的底$\mathrm{e}$。
%不过,我个人觉得斜体的$e$和$\pi$很潇洒,在不至于引起混淆的情况下,我也用这两个字母的斜体表示对应的常量。
%
%
%\section{向文档中插入图像}
%\label{sec:insertimage}
%
%\subsection{支持的图片格式}
%\label{sec:imageformat}
%
%\XeTeX 可以很方便地插入PDF、PNG、JPG格式的图片。
%
%插入PNG/JPG的例子如\ref{fig:SRR}所示。
%这两个水平并列放置的图共享一个“图标题”(table caption),没有各自的小标题。
%
%\begin{figure}[!htp]
%  \centering
%  \includegraphics[width=4cm]{example/sjtulogo.png}
%  \hspace{1cm}
%  \includegraphics[width=4cm]{example/sjtulogo.jpg}
%  \bicaption[这里将出现在插图索引中]
%    {中文题图}
%    {English caption}
%  \label{fig:SRR}
%\end{figure}
%
%这里还有插入EPS图像和PDF图像的例子,如图\ref{fig:epspdf:a}和图\ref{fig:epspdf:b}。这里将EPS和PDF图片作为子图插入,每个子图有自己的小标题。子图标题使用subcaption宏包添加。
%
%\begin{figure}[!htp]
%  \centering
%  \subcaptionbox{EPS 图像\label{fig:epspdf:a}}[3cm] %标题的长度,超过则会换行,如下一个小图。
%    {\includegraphics[height=2.5cm]{example/sjtulogo.eps}}
%  \hspace{4em}
%  \subcaptionbox{PDF 图像,注意这个图略矮些。如果标题很长的话,它会自动换行\label{fig:epspdf:b}}
%    {\includegraphics[height=2cm]{sjtulogo.pdf}}
%  \bicaption{插入eps和pdf的例子(使用 subcaptionbox 方式)}{An EPS and PDF demo with subcaptionbox}
%  \label{fig:pdfeps-subcaptionbox}
%\end{figure}
%
%\begin{figure}[!htp]
%  \centering
%  \begin{subfigure}{2.5cm}
%    \centering
%    \includegraphics[height=2.5cm]{example/sjtulogo.eps}
%    \caption{EPS 图像}
%  \end{subfigure}
%  \hspace{4em}
%  \begin{subfigure}{0.4\textwidth}
%    \centering
%    \includegraphics[height=2cm]{sjtulogo.pdf}
%    \caption{PDF 图像,注意这个图略矮些。subfigure中同一行的子图在顶端对齐。}
%  \end{subfigure}
%  \bicaption{插入eps和pdf的例子(使用 subfigure 方式)}{An EPS and PDF demo with subfigure}
%  \label{fig:pdfeps-subfigure}
%\end{figure}
%
%更多关于 \LaTeX 插图的例子可以参考\href{http://www.cs.duke.edu/junhu/Graphics3.pdf}{《\LaTeX 插图指南》}。
%
%\subsection{长标题的换行}
%\label{sec:longcaption}
%
%图\ref{fig:longcaptionbad}和图\ref{fig:longcaptiongood}都有比较长图标题,通过对比发现,图\ref{fig:longcaptiongood}的换行效果更好一些。
%其中使用了minipage环境来限制整个浮动体的宽度。
%
%\begin{figure}[!htp]
%  \centering
%  \includegraphics[width=4cm]{sjtubadge.pdf}
%  \bicaption[这里将出现在插图索引]
%    {上海交通大学是我国历史最悠久的高等学府之一,是教育部直属、教育部与上海市共建的全国重点大学.}
%    {Where there is a will, there is a way.}
% \label{fig:longcaptionbad}
%\end{figure}
%
%\begin{figure}[!htbp]
%  \centering
%  \begin{minipage}[b]{0.6\textwidth}
%    \centering
%    \includegraphics[width=4cm]{sjtubadge.pdf}
%    \bicaption[出现在插图索引中]
%      {上海交通大学是我国历史最悠久的高等学府之一,是教育部直属、教育部与上海市共建的全国重点大学.}
%      {Where there is a will, there is a way.}
%    \label{fig:longcaptiongood}
%  \end{minipage}
%\end{figure}
%
%\subsection{添加图注}
%
%当插图中组成部件由数字或字母等编号表示时,可在插图下方添加图注进行说明,如图\ref{fig:cn_100t}所示。
%
%\begin{figure}[!htp]
%  \centering
%  \includegraphics[width=0.3\textwidth]{example/cn_100t.png}\
%  \begin{center}
%    \small\kaishu 1.立柱 2.提升释放机构 3.标准冲击加速度计 \\ 4.导轨 5.重锤 6.被校力传感器 7.底座
%  \end{center}
%  \vspace{-1em}
%  \bicaption[出现在插图索引中]
%    {示例图片来源于\parencite{he1999}}
%    {Stay hungry, stay foolish.}
% \label{fig:cn_100t}
%\end{figure}
%
%\subsection{绘制流程图}
%
%图\ref{fig:flow_chart}是一张流程图示意。使用tikz环境,搭配四种预定义节点(\verb+startstop+、\verb+process+、\verb+decision+和\verb+io+),可以容易地绘制出流程图。
%\begin{figure}[!htp]
%    \centering
%    \resizebox{6cm}{!}{\input{figure/example/flow_chart.tex}}
%    \bicaption{绘制流程图效果}{Flow chart}
%    \label{fig:flow_chart}
%\end{figure}
%
%\clearpage

%\section{表格}
%\label{sec:tab}
%
%这一节给出的是一些表格的例子,如表\ref{tab:firstone}所示。
%
%\begin{table}[!hpb]
%  \centering
%  \bicaption[指向一个表格的表目录索引]
%    {一个颇为标准的三线表格\footnotemark[1]}
%    {A Table}
%  \label{tab:firstone}
%  \begin{tabular}{@{}llr@{}} \toprule
%    \multicolumn{2}{c}{Item} \\ \cmidrule(r){1-2}
%    Animal & Description & Price (\$)\\ \midrule
%    Gnat & per gram & 13.65 \\
%    & each & 0.01 \\
%    Gnu & stuffed & 92.50 \\
%    Emu & stuffed & 33.33 \\
%    Armadillo & frozen & 8.99 \\ \bottomrule
%  \end{tabular}
%\end{table}
%\footnotetext[1]{这个例子来自\href{http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf}{《Publication quality tables in LATEX》}(booktabs宏包的文档)。这也是一个在表格中使用脚注的例子,请留意与threeparttable实现的效果有何不同。}
%
%下面一个是一个更复杂的表格,用threeparttable实现带有脚注的表格,如表\ref{tab:footnote}。
%
%\begin{table}[!htpb]
%  \bicaption[出现在表目录的标题]
%    {一个带有脚注的表格的例子}
%    {A Table with footnotes}
%  \label{tab:footnote}
%  \centering
%  \begin{threeparttable}[b]
%     \begin{tabular}{ccd{4}cccc}
%      \toprule
%      \multirow{2}{6mm}{total}&\multicolumn{2}{c}{20\tnote{1}} & \multicolumn{2}{c}{40} &  \multicolumn{2}{c}{60}\\
%      \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}
%      &www & \multicolumn{1}{c}{k} & www & k & www & k \\ % 使用说明符 d 的列会自动进入数学模式,使用 \multicolumn 对文字表头做特殊处理
%      \midrule
%      &$\underset{(2.12)}{4.22}$ & 120.0140\tnote{2} & 333.15 & 0.0411 & 444.99 & 0.1387 \\
%      &168.6123 & 10.86 & 255.37 & 0.0353 & 376.14 & 0.1058 \\
%      &6.761    & 0.007 & 235.37 & 0.0267 & 348.66 & 0.1010 \\
%      \bottomrule
%    \end{tabular}
%    \begin{tablenotes}
%    \item [1] the first note.% or \item [a]
%    \item [2] the second note.% or \item [b]
%    \end{tablenotes}
%  \end{threeparttable}
%\end{table}

\section{参考文献管理}

 \LaTeX 具有将参考文献内容和表现形式分开管理的能力,涉及三个要素:参考文献数据库、参考文献引用格式、在正文中引用参考文献。
这样的流程需要多次编译:

\begin{enumerate}%[noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]
    \item 用户将论文中需要引用的参考文献条目,录入纯文本数据库文件(bib文件)。
    \item 调用xelatex对论文模板做第一次编译,扫描文中引用的参考文献,生成参考文献入口文件(aux)文件。
    \item 调用bibtex,以参考文献格式和入口文件为输入,生成格式化以后的参考文献条目文件(bib)。
    \item 再次调用xelatex编译模板,将格式化以后的参考文献条目插入正文。
\end{enumerate}

参考文献数据库(thesis.bib)的条目,可以从Google Scholar搜索引擎\footnote{\url{https://scholar.google.com}}、CiteSeerX搜索引擎\footnote{\url{http://citeseerx.ist.psu.edu}}中查找,文献管理软件Papers\footnote{\url{http://papersapp.com}}、Mendeley\footnote{\url{http://www.mendeley.com}}、JabRef\footnote{\url{http://jabref.sourceforge.net}}也能够输出条目信息。

下面是在Google Scholar上搜索到的一条文献信息,格式是纯文本:

\begin{lstlisting}[caption={从Google Scholar找到的参考文献条目}, label=googlescholar, escapeinside="", numbers=none]
    @phdthesis{"白2008信用风险传染模型和信用衍生品的定价",
      title={"信用风险传染模型和信用衍生品的定价"},
      author={"白云芬"},
      year={2008},
      school={"上海交通大学"}
    }
\end{lstlisting}

推荐修改后在bib文件中的内容为:

\begin{lstlisting}[caption={修改后的参考文献条目}, label=itemok, escapeinside="", numbers=none]
  @phdthesis{bai2008,
    title={"信用风险传染模型和信用衍生品的定价"},
    author={"白云芬"},
    date={2008},
    address={"上海"},
    school={"上海交通大学"}
  }
\end{lstlisting}

按照教务处的要求,参考文献外观应符合国标GBT7714的要求\footnote{\url{http://www.cces.net.cn/guild/sites/tmxb/Files/19798_2.pdf}}。
在模板中,表现形式的控制逻辑通过biblatex-gb7714-2015包实现\footnote{\url{https://www.ctan.org/pkg/biblatex-gb7714-2015}},基于{Bib\LaTeX}管理文献。在目前的多数TeX发行版中,可能都没有默认包含biblatex-gb7714-2015,需要手动安装。

正文中引用参考文献时,用\verb+\cite{key1,key2,key3...}+可以产生“上标引用的参考文献”,
如\cite{Meta_CN,chen2007act,DPMG}。
使用\verb+\parencite{key1,key2,key3...}+则可以产生水平引用的参考文献,例如\parencite{JohnD,zhubajie,IEEE-1363}。
请看下面的例子,将会穿插使用水平的和上标的参考文献:关于书的\parencite{Meta_CN,JohnD,IEEE-1363},关于期刊的\cite{chen2007act,chen2007ewi},
会议论文\parencite{DPMG,kocher99,cnproceed},
硕士学位论文\parencite{zhubajie,metamori2004},博士学位论文\cite{shaheshang,FistSystem01,bai2008},标准文件\parencite{IEEE-1363},技术报告\cite{NPB2},电子文献\parencite{xiaoyu2001, CHRISTINE1998},用户手册\parencite{RManual}。

总结一些注意事项:
\begin{itemize}
\item 参考文献只有在正文中被引用了,才会在最后的参考文献列表中出现;
\item 参考文献“数据库文件”bib是纯文本文件,请使用UTF-8编码,不要使用GBK编码;
\item 参考文献条目中默认通过date域输入时间。兼容使用year域时会产生编译warning,可忽略。
\end{itemize}

%\section{用listings插入源代码}
%
%原先ctexbook文档类和listings宏包配合使用时,代码在换页时会出现莫名其妙的错误,后来经高人指点,顺利解决了。
%感兴趣的话,可以看看\href{http://bbs.ctex.org/viewthread.php?tid=53451}{这里}。
%这里给使用listings宏包插入源代码的例子,这里是一段C代码。
%另外,listings宏包真可谓博大精深,可以实现各种复杂、漂亮的效果,想要进一步学习的同学,可以参考
%\href{http://mirror.ctan.org/macros/latex/contrib/listings/listings.pdf}{listings宏包手册}。
%
%\begin{lstlisting}[language={C}, caption={一段C源代码}]
%#include <stdio.h>
%#include <unistd.h>
%#include <sys/types.h>
%#include <sys/wait.h>
%
%int main() {
%  pid_t pid;
%
%  switch ((pid = fork())) {
%  case -1:
%    printf("fork failed\n");
%    break;
%  case 0:
%    /* child calls exec */
%    execl("/bin/ls", "ls", "-l", (char*)0);
%    printf("execl failed\n");
%    break;
%  default:
%    /* parent uses wait to suspend execution until child finishes */
%    wait((int*)0);
%    printf("is completed\n");
%    break;
%  }
%
%  return 0;
%}
%\end{lstlisting}
%
%\section{用algorithm和algorithmicx宏包插入算法描述}
%
%algorithmicx 比 algorithmic 增加了一些命令。
%示例如算法\ref{algo:sum_100}和算法\ref{algo:merge_sort},
%后者的代码来自\href{http://hustsxh.is-programmer.com/posts/38801.html}{xhSong的博客}。
%algorithmicx的详细使用方法见\href{http://mirror.hust.edu.cn/CTAN/macros/latex/contrib/algorithmicx/algorithmicx.pdf}{官方README}。
%使用算法宏包时,算法出现的位置很多时候不按照tex文件里的书写顺序,
%需要强制定位时可以使用\verb+\begin{algorithm}[H]+
%\footnote{http://tex.stackexchange.com/questions/165021/fixing-the-location-of-the-appearance-in-algorithmicx-environment}
%
%这是写在算法\ref{algo:sum_100}前面的一段话,在生成的文件里它会出现在算法\ref{algo:sum_100}前面。
%
%\begin{algorithm}
%% \begin{algorithm}[H] % 强制定位
%\caption{求100以内的整数和}
%\label{algo:sum_100}
%\begin{algorithmic}[1] %每行显示行号
%\Ensure 100以内的整数和 % 输出
%\State $sum \gets 0$
%\For{$i = 0 \to 100$}
%    \State $sum \gets sum + i$
%  \EndFor
%\end{algorithmic}
%\end{algorithm}
%
%这是写在两个算法中间的一段话,当算法\ref{algo:sum_100}不使用\verb+\begin{algorithm}[H]+时它也会出现在算法\ref{algo:sum_100}前面。
%
%对于很长的算法,单一的算法块\verb+\begin{algorithm}...\end{algorithm}+是不能自动跨页的
%\footnote{http://tex.stackexchange.com/questions/70733/latex-algorithm-not-display-under-correct-section},
%会出现的情况有:
%
%\begin{itemize}
%  \item 该页放不下当前的算法,留下大片空白,算法在下一页显示
%  \item 单一页面放不下当前的算法,显示时超过页码的位置直到超出整个页面范围
%\end{itemize}
%
%解决方法有:
%
%\begin{itemize}
%  \item (推荐)使用\verb+algstore{algname}+和\verb+algrestore{algname}+来讲算法分为两个部分\footnote{http://tex.stackexchange.com/questions/29816/algorithm-over-2-pages},如算法\ref{algo:merge_sort}。
%  \item 人工拆分算法为多个小的部分。
%\end{itemize}
%
%\begin{algorithm}
%% \begin{algorithm}[H] % 强制定位
%\caption{用归并排序求逆序数}
%\label{algo:merge_sort}
%\begin{algorithmic}[1] %每行显示行号
%\Require $Array$数组,$n$数组大小 % 输入
%\Ensure 逆序数 % 输出
%\Function {MergerSort}{$Array, left, right$}
%  \State $result \gets 0$
%  \If {$left < right$}
%    \State $middle \gets (left + right) / 2$
%    \State $result \gets result +$ \Call{MergerSort}{$Array, left, middle$}
%    \State $result \gets result +$ \Call{MergerSort}{$Array, middle, right$}
%    \State $result \gets result +$ \Call{Merger}{$Array,left,middle,right$}
%  \EndIf
%  \State \Return{$result$}
%\EndFunction
%\State %空一行
%\Function{Merger}{$Array, left, middle, right$}
%  \State $i\gets left$
%  \State $j\gets middle$
%  \State $k\gets 0$
%  \State $result \gets 0$
%  \While{$i<middle$ \textbf{and} $j<right$}
%    \If{$Array[i]<Array[j]$}
%      \State $B[k++]\gets Array[i++]$
%    \Else
%      \State $B[k++] \gets Array[j++]$
%      \State $result \gets result + (middle - i)$
%    \EndIf
%  \EndWhile
%  \algstore{MergeSort}
%\end{algorithmic}
%\end{algorithm}
%
%\begin{algorithm}
%\begin{algorithmic}[1]
%  \algrestore{MergeSort}
%  \While{$i<middle$}
%    \State $B[k++] \gets Array[i++]$
%  \EndWhile
%  \While{$j<right$}
%    \State $B[k++] \gets Array[j++]$
%  \EndWhile
%  \For{$i = 0 \to k-1$}
%    \State $Array[left + i] \gets B[i]$
%  \EndFor
%  \State \Return{$result$}
%\EndFunction
%\end{algorithmic}
%\end{algorithm}
%
%这是写在算法\ref{algo:merge_sort}后面的一段话,
%但是当算法\ref{algo:merge_sort}不使用\verb+\begin{algorithm}[H]+时它会出现在算法\ref{algo:merge_sort}
%甚至算法\ref{algo:sum_100}前面。
%
%对于算法的索引要注意\verb+\caption+和\verb+\label+的位置,
%必须是先\verb+\caption+再\verb+\label+\footnote{http://tex.stackexchange.com/questions/65993/algorithm-numbering},
%否则会出现\verb+\ref{algo:sum_100}+生成的编号跟对应算法上显示不一致的问题。
%
%根据Werner的回答\footnote{http://tex.stackexchange.com/questions/53357/switch-cases-in-algorithmic}
%增加了\verb+Switch+和\verb+Case+的支持,见算法\ref{algo:switch_example}。
%
%\begin{algorithm}
%\caption{Switch示例}
%\label{algo:switch_example}
%\begin{algorithmic}[1]
%  \Switch{$s$}
%    \Case{$a$}
%      \Assert{0}
%    \EndCase
%    \Case{$b$}
%      \Assert{1}
%    \EndCase
%    \Default
%      \Assert{2}
%    \EndDefault
%  \EndSwitch
%\end{algorithmic}
%\end{algorithm}

这说明,问题可能是在宏包方面存在一些冲突,而最新版的gb7714-2015,做的一些修改避开了这些潜在的冲突。

我下面再找找到底是哪里产生了冲突。

hushidong commented 6 years ago

问题找着了,冲突在于:

% “绘制”中文标题页
\expandarg%只展开"\null\null"不展开其他变量,参考 http://tug.ctan.org/macros/generic/xstring/xstring_doc_en.pdf
\newcommand\longtextsplitchar{\null\null}

这里利用了xstring的\expandarg来辅助展开。

而老版本的gb7714-2015中也使用xstring帮助抽取字符,进而进行中英文判断,这里的\expandarg是全局的,所以导致展开存在一些冲突,虽然强制编译也是可以得到最后正确的结果。

而新版本的gb7714-2015使用了新的中英文判断机制,不再使用xstring进行字符抽取。所以不产生冲突。

所以,我这里的建议是能不能把\expandarg这个命令局部化,避免影响其他地方使用xstring的情况,@各位模板作者。尽管使用新版本的gb7714-2015也没有问题。

bubifengyun commented 6 years ago

哦哦,这个是我的问题,我加的这段代码。我回去改改看。要不先换最新版texlive吧。

bubifengyun commented 6 years ago

哦哦,这个是我的问题,我加的这段代码。我回去改改看。要不先换最新版texlive吧。

hushidong commented 6 years ago

好,你看看代码,把那个expandarg包在组里面局部化估计就没影响了。

gaocegege commented 6 years ago

Awesome! I will file an issue to keep track of the conflict.

Ref https://github.com/sjtug/SJTUThesis/issues/375

bubifengyun commented 6 years ago

我电脑上也没有texlive2017。我再仔细阅读那个xstring说明文档吧。看看如何处理。

hushidong commented 6 years ago

texlive 2018+biblatex 3.11+gb7714-2015v1.0i也可以测试。你可以去biblatex-gb7714-2015那下个1.0i版的进行测试

bubifengyun commented 6 years ago

@InnerPeace-Wu 已经提交更新,但是我这边找不到测试环境,如果不介意可以试试我刚提交的内容。其中 sjtuthesis.cls 文件也可用在 https://github.com/bubifengyun/SJTUThesis-Rmd 这里下载,我也刚更新了一下。

hushidong commented 6 years ago

测试通过,局部化后编译正常了。

InnerPeace-Wu commented 6 years ago

@bubifengyun 刚测试,texlive2017+biblatex3.7+gb7714-2015v1.0g这个配置下编译正常。texlive2018已经升级所有package,无法测试。 感谢各位!