hushidong / biblatex-gb7714-2015

A biblatex implementation of the GB/T7714-2015 bibliography style || GB/T 7714-2015 参考文献著录和标注的biblatex样式包
768 stars 84 forks source link

中文文献附加对应的英文译文 #111

Closed wrfwerrr closed 2 years ago

wrfwerrr commented 2 years ago

您好,一些中文论文要求中文文献附加对应的英文译文,为下面这样的中英文对照写法,目前是否有方法实现 图片

hushidong commented 2 years ago

这是可以的,很多期刊都是这么要求的,像实验流体力学等。这个功能是biblatex-gb7714-2015当年开发的动机之一。

hushidong commented 2 years ago

有两种方式: 一:注意bib信息中加入了nameformat={pinyin}这是针对单个文献的设置,如果全局设置,可以在biblatex加载时使用gbnamefmt=pinyin


% 测试双语对照文献-两种方法

\documentclass[twoside]{article}
\usepackage{ctex}
\usepackage{xcolor}
\usepackage{toolbox}
\usepackage[colorlinks]{hyperref}
\usepackage{lipsum}
\usepackage[top=10pt,bottom=10pt,left=1cm,right=1cm]{geometry}
\usepackage{xltxtra,mflogo,texnames}
\usepackage[backend=biber,style=gb7714-2015,gbannote=true]{biblatex}%sorting=nyt

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

@Book{易仕和2013--,
  Title                    = {超声速和高超声速喷管设计},
  Address                  = {北京},
  Author                   = {易仕和 and 赵玉新 and 何霖 and 张敏莉},
  Publisher                = {国防工业出版社},
  Year                     = {2013}
}

@Book{Yi2013--,
  Title                    = {Supersonic and hypersonic nozzle design},
  Address                  = {Beijing},
  Author                   = {Yi, Shi he and Zhao, Yu xin and He, Lin and Zhang, Min li},
  Publisher                = {National Defense Industry Press},
  Year                     = {2013},
  nameformat={pinyin},
  annote={in Chinese}
}

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

@Article{Zhang2007-500-503,
  Title                    = {The design and experimental investigations of supersonic length shorted nozzle},
  Author                   = {Zhang, Min li and Yi, Shi he and Zhao, Yu xin},
  Journal                  = {ACTA AERODYNAMICA SINICA},
  Number                   = {4},
  Pages                    = {500-503},
  Volume                   = {25},
  Year                     = {2007},
  nameformat={pinyin},
  annote={in Chinese}
}

\end{filecontents}

\addbibresource{\jobname.bib}

\defdoublelangentry{易仕和2013--}{Yi2013--}
\defdoublelangentry{张敏莉2007-500-503}{Zhang2007-500-503}

\def\gbpinyinlocalset{\renewrobustcmd*{\bibinitperiod}{}%
\renewcommand*{\revsdnamepunct}{}%
\renewrobustcmd*{\bibnamedelima}{}}
\renewbibmacro*{finentry}{}
\addbibresource[location=local]{example.bib}

\begin{document}

\cite{易仕和2013--,张敏莉2007-500-503}

\printbibliography

\end{document}

结果为:

图片

hushidong commented 2 years ago

二:


% 测试双语对照文献-两种方法

\documentclass[twoside]{article}
\usepackage{ctex}
\usepackage{xcolor}
\usepackage{toolbox}
\usepackage[colorlinks]{hyperref}
\usepackage{lipsum}
\usepackage[top=10pt,bottom=10pt,left=1cm,right=1cm]{geometry}
\usepackage{xltxtra,mflogo,texnames}
\usepackage[backend=biber,style=gb7714-2015,gbannote=true]{biblatex}%sorting=nyt

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

@Book{易仕和2013--,
  Title                    = {超声速和高超声速喷管设计},
  Address                  = {北京},
  Author                   = {易仕和 and 赵玉新 and 何霖 and 张敏莉},
  Publisher                = {国防工业出版社},
  Year                     = {2013}
}

@Book{Yi2013--,
  Title                    = {Supersonic and hypersonic nozzle design},
  Address                  = {Beijing},
  Author                   = {Yi, Shi he and Zhao, Yu xin and He, Lin and Zhang, Min li},
  Publisher                = {National Defense Industry Press},
  Year                     = {2013},
  nameformat={pinyin},
  annote={in Chinese}
}

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

@Article{Zhang2007-500-503,
  Title                    = {The design and experimental investigations of supersonic length shorted nozzle},
  Author                   = {Zhang, Min li and Yi, Shi he and Zhao, Yu xin},
  Journal                  = {ACTA AERODYNAMICA SINICA},
  Number                   = {4},
  Pages                    = {500-503},
  Volume                   = {25},
  Year                     = {2007},
  nameformat={pinyin},
  annote={in Chinese}
}

\end{filecontents}

\addbibresource{\jobname.bib}

\defbibentryset{易仕和2013}{易仕和2013--,Yi2013--}
\defbibentryset{张敏莉2007}{张敏莉2007-500-503,Zhang2007-500-503}

\def\gbpinyinlocalset{\renewrobustcmd*{\bibinitperiod}{}%
\renewcommand*{\revsdnamepunct}{}%
\renewrobustcmd*{\bibnamedelima}{}}
\renewbibmacro*{finentry}{}
\addbibresource[location=local]{example.bib}

\begin{document}

\cite{易仕和2013,张敏莉2007}

\printbibliography

\end{document}

结果为: 图片

hushidong commented 2 years ago

你想加点颜色也可以的,比如:


% 测试双语对照文献-两种方法

\documentclass[twoside]{article}
\usepackage{ctex}
\usepackage{xcolor}
\usepackage{toolbox}
\usepackage[colorlinks]{hyperref}
\usepackage{lipsum}
\usepackage[top=10pt,bottom=10pt,left=1cm,right=1cm]{geometry}
\usepackage{xltxtra,mflogo,texnames}
\usepackage[backend=biber,style=gb7714-2015,gbannote=true]{biblatex}%sorting=nyt

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

@Book{易仕和2013--,
  Title                    = {超声速和高超声速喷管设计},
  Address                  = {北京},
  Author                   = {易仕和 and 赵玉新 and 何霖 and 张敏莉},
  Publisher                = {国防工业出版社},
  Year                     = {2013}
}

@Book{Yi2013--,
  Title                    = {Supersonic and hypersonic nozzle design},
  Address                  = {Beijing},
  Author                   = {Yi, Shi he and Zhao, Yu xin and He, Lin and Zhang, Min li},
  Publisher                = {National Defense Industry Press},
  Year                     = {2013},
  nameformat={pinyin},
  annote={in Chinese}
}

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

@Article{Zhang2007-500-503,
  Title                    = {The design and experimental investigations of supersonic length shorted nozzle},
  Author                   = {Zhang, Min li and Yi, Shi he and Zhao, Yu xin},
  Journal                  = {ACTA AERODYNAMICA SINICA},
  Number                   = {4},
  Pages                    = {500-503},
  Volume                   = {25},
  Year                     = {2007},
  nameformat={pinyin},
  annote={in Chinese}
}

\end{filecontents}

\addbibresource{\jobname.bib}

\DeclareBibliographyCategory{ColoredBiblistA}
\addtocategory{ColoredBiblistA}{Yi2013--,Zhang2007-500-503}

\renewcommand{\bibauthorfont}{\ifentrycategory{\thefield{keywords}}{ColoredBiblistA}{\color{red}\bfseries}{}}%\color{#1}
\renewcommand{\bibtitlefont}{\ifentrycategory{\thefield{keywords}}{ColoredBiblistA}{\color{black}\normalfont}{}}%\color{black}
\renewcommand{\bibpubfont}{\ifentrycategory{\thefield{keywords}}{ColoredBiblistA}{\color{black}\normalfont}{}}%

\defdoublelangentry{易仕和2013--}{Yi2013--}
\defdoublelangentry{张敏莉2007-500-503}{Zhang2007-500-503}

\def\gbpinyinlocalset{\renewrobustcmd*{\bibinitperiod}{}%
\renewcommand*{\revsdnamepunct}{}%
\renewrobustcmd*{\bibnamedelima}{}}
\renewbibmacro*{finentry}{}
\addbibresource[location=local]{example.bib}

\begin{document}

\cite{易仕和2013--,张敏莉2007-500-503}

\printbibliography

\end{document}

结果为: 图片

wrfwerrr commented 2 years ago

感谢您的解答,这个在手册里有介绍我没仔细看,感谢您开发的这个项目。