Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用法:中英文参考文献分开显示,且手动设置文献序号 #143

Open
TideDlrow opened this issue Jun 12, 2022 · 3 comments
Open

Comments

@TideDlrow
Copy link

有些要求是中英文分开显示。比如有的参考文献是中文的,但要统一写成英文的,然后再最后附上中文的的参考文献。

就像下面这样

文献引用[5]


参考文献

[5] English references

附中文参考文献

[5] 中文的参考文献

@hushidong
Copy link
Owner

\documentclass{ctexart}

\usepackage[backend=biber,style=gb7714-2015]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Ma2006Analyse, title={Analyse and Research of Makefile Base on Linux 2.6}, author={Ma, X}, journal={CONTROL AND AUTOMATION}, volume={166}, pages={232}, year={2006}, publisher={Weijisuanji Xinxi Zazhishe} }

@article{Ma2006Analyse2, title={Analyse and Research of Makefile Base on Linux 2.6}, author={Ma, X}, volume={166}, pages={232}, year={2006}, publisher={Weijisuanji Xinxi Zazhishe} }


@ARTICLE{常森2013--,
  author       = {常森},
  title        = {《五行》学说与《荀子》},
  Journaltitle = {北京大学学报(哲学社会科学版)},
  DATE         = {2013},
  VOLUME       = {50},
  number       = {1},
  pages        = {75},
}

@ARTICLE{常森2013a--,
  author       = {常森},
  title        = {《五行》学说与《荀子》},
  DATE         = {2013},
  VOLUME       = {50},
  number       = {1},
  pages        = {75},
}
\end{filecontents}

\addbibresource[location=local]{\jobname.bib}

\defbibcheck{cnreference}{\iffieldequalstr{userd}{english}{}}
\defbibcheck{enreference}{\iffieldequalstr{userd}{chinese}{}}

\begin{document}%正文区开始:

\nocite{*}
%打印参考文献表
\printbibliography[heading=bibliography,check=cnreference,title=参考文献]

\printbibliography[heading=bibliography,check=enreference,title=Reference]

\end{document} 

@TideDlrow
Copy link
Author

非常感谢!!

还有个问题是中英文文献是同一篇,分开打印的时候编号要相同话又该怎么解决呢?

假设"常森2013a--" 和 "Ma2006Analyse"是同一篇论文,只是语言不同

显示后应该是

参考文献

[1] xxxx
...
[5] Ma2006Analyse
[6] xxxx
...

(英文是正常按顺序编号的)

附中文参考文献

[5] 常森2013a--

(这里只需显示对应的中文参考文献就行)

@hushidong
Copy link
Owner

可以这样手动处理:

(1)将下面这句加入:系统中gb7714-2015.bbx文件中

\DeclareDatamodelFields[type=field,datatype=integer]{refnumber}

(2) 在需要指定序号的文献中加入一个refnumber域
比如:

@ARTICLE{常森2013--,
  author       = {常森},
  title        = {《五行》学说与《荀子》},
  Journaltitle = {北京大学学报(哲学社会科学版)},
  DATE         = {2013},
  VOLUME       = {50},
  number       = {1},
  pages        = {75},
  refnumber={5}
}

(3) 在te文件按如下例子处理:

\documentclass{ctexart}

\usepackage[backend=biber,style=gb7714-2015]{biblatex}

%\DeclareDatamodelFields[type=field,datatype=integer]{refnumber}

\defbibenvironment{bibnumber}
  {\list
     {\printtext[labelnumberwidth]{%
        \printfield{refnumber}}}
     {\addtolength{\labelnumberwidth}{\biblabelextend}%
      \setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \setlength{\bibhang}{\biblabelsep}%
      \addtolength{\bibhang}{\labelnumberwidth}%
      \setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{\bibitemindent}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}


\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Ma2006Analyse, title={Analyse and Research of Makefile Base on Linux 2.6}, author={Ma, X}, journal={CONTROL AND AUTOMATION}, volume={166}, pages={232}, year={2006}, publisher={Weijisuanji Xinxi Zazhishe} }

@article{Ma2006Analyse2, title={Analyse and Research of Makefile Base on Linux 2.6}, author={Ma, X}, volume={166}, pages={232}, year={2006}, publisher={Weijisuanji Xinxi Zazhishe} }


@ARTICLE{常森2013--,
  author       = {常森},
  title        = {《五行》学说与《荀子》},
  Journaltitle = {北京大学学报(哲学社会科学版)},
  DATE         = {2013},
  VOLUME       = {50},
  number       = {1},
  pages        = {75},
  refnumber={5}
}

@ARTICLE{常森2013a--,
  author       = {常森},
  title        = {《五行》学说与《荀子》},
  DATE         = {2013},
  VOLUME       = {50},
  number       = {1},
  pages        = {75},
  refnumber={7}
}
\end{filecontents}

\addbibresource[location=local]{\jobname.bib}

\defbibcheck{cnreference}{\iffieldequalstr{userd}{english}{}}
\defbibcheck{enreference}{\iffieldequalstr{userd}{chinese}{}}

\begin{document}%正文区开始:

\nocite{*}
%打印参考文献表
\printbibliography[env=bibnumber,heading=bibliography,check=cnreference,title=参考文献]

\printbibliography[heading=bibliography,check=enreference,title=Reference]

\end{document} 

@hushidong hushidong changed the title 中英文参考文献分开显示 该怎么操作? 用法:中英文参考文献分开显示,且手动设置文献序号 May 27, 2023
@hushidong hushidong reopened this May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants