Coder Social home page Coder Social logo

Comments (3)

hushidong avatar hushidong commented on June 12, 2024 1

改的要稍多一些,卷通常是跟标题放一起的。

% !Mode:: "TeX:UTF-8"
% 用于测试gb7714-2015样式,对于作者姓名格式的控制和选项
% 测试gbnamefmt选项
% 测试bib文件中的nameformat域
\documentclass[twoside]{article}
\usepackage{ctex}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{geometry}

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

\DeclareStyleSourcemap{
    \maps[datatype=bibtex]{
        \map{\pertype{mvbook}
            \step[typesource=mvbook,typetarget=book]
            \step[fieldset=usera, fieldvalue={M}]%
            }
    }
}


\renewbibmacro*{title}{%
\ifboolexpr{%
    test{\iffieldundef{title}}%
    and
    test{\iffieldundef{subtitle}}}%
    {}%
    {\printtext[title]{\bibtitlefont%增加字体控制命令
       \printfield[titlecase]{title}%
       \ifboolexpr{test {\iffieldundef{subtitle}}}%增加了对子标题的判断
            {}{\setunit{\subtitlepunct}\printfield[titlecase]{subtitle}}%
       \iffieldundef{titleaddon}{}{\setunit{\subtitlepunct}\printfield{titleaddon}}%判断一下titleaddon
       \ifboolexpr{test{\ifentrytype{book}} and (not test{\iffieldundef{volume}}) and 
       test{\iffieldundef{volumes}}}%判断一下book类有没有volume
            {\setunit{\subtitlepunct}\printfield{volume}}{}%
       \iftoggle{bbx:gbtype}%
            {\iffieldundef{entrysubtype}{\printfield[gbtypeflag]{usera}}%在标题后直接给出文献标识字母,判断一下,是否是报纸和标准
            {\iffieldequalstr{entrysubtype}{standard}{\printfield[gbtypeflags]{usera}}%判断是否为标准
                  {\iffieldequalstr{entrysubtype}{news}{\printfield[gbtypeflagn]{usera}}% 判断是否为报纸
                  {\printfield[gbtypeflag]{usera}}}}}{}%%其它
       }%
    }%
}


\DeclareFieldFormat[book,inbook,incollection]{volumes}%
{\iffieldequalstr{userd}{chinese}{\iffieldint{volumes}%
        {共 #1\bibstring{volumecn}%
        }{#1}}%
    {\bibstring{volumes}~#1}%
}

\renewbibmacro*{series+number}{%
  \printfield{series}%
  \setunit*{\addcolon\addspace}%
  \printfield{number}%
  \newunit%
  }

\AtEveryBibitem{\clearlist{language}}


  \DeclareBibliographyDriver{book}{%源来自standard.bbx文件
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
\usebibmacro{maintitle+title}%
\iftoggle{bbx:gbstrict}{}{%
\newunit
\printlist{language}%
\newunit\newblock%
\usebibmacro{byauthor}%
\newunit\newblock}%
\usebibmacro{byeditor+others}%
\newunit
\printfield{edition}%
\newunit\newblock%%
\iftoggle{bbx:gbstrict}{}{%
\iffieldundef{maintitle}%
{\iffieldundef{volumes}{}{\printfield{volume}}%
\printfield{part}}%
{}%
\newunit%
\printfield{volumes}%
\newunit\newblock%
\usebibmacro{series+number}}%
\newunit\newblock%
%\printfield{note}%
%\newunit\newblock%
\usebibmacro{publisher+location+date}%
%\newunit\newblock %这里标点去掉
\usebibmacro{chapter+pages}%
  \iffieldundef{url}{}{%当没有网址时也不输出
  \usebibmacro{modifydate}}%带括号的修改或更新日期,
\usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。
  \newunit\newblock%
  \printfield{pagetotal}%
  \newunit\newblock%
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  %\usebibmacro{doi+eprint+url}%
  %\newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}\usebibmacro{annotation}}


\begin{filecontents}[force]{\jobname.bib}
@book{barnes-1975,
title = {An Algebraic Introduction to Mathematical Logic},
author = {Barnes, Donald W. and Mack, John M.},
year = {1975},
series = {Graduate {{Texts}} in {{Mathematics}}},
number = {22},
publisher = {{Springer Verlag}},
address = {{New York}},
}

@mvbook{FengQi-2019-JiHeLunDaoYinJiBenLiLun,
title = {集合论导引:基本理论},
author = {{冯琦}},
date = {2019},
series = {现代数学基础丛书},
volume = {1},
number = {178},
publisher = {{科学出版社}},
location = {{北京}},
volumes = {3}
}

@book{FengQi-2019,
title = {集合论导引:基本理论},
author = {{冯琦}},
date = {2019},
series = {现代数学基础丛书},
volume = {1},
number = {178},
publisher = {{科学出版社}},
location = {{北京}},
volumes = {3}
}

\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}

\nocite{*}

\printbibliography



 \end{document} 

结果为:

图片

from biblatex-gb7714-2015.

superfluous-man avatar superfluous-man commented on June 12, 2024 1

感谢!

按这个思路,照葫芦画瓢临时性魔改了一下,将卷数调整至title与subtitle之间,并略改标点样式,得到以下中文条目的格式效果:

DeepinScreenshot_select-area_20231009165137.png

示例中的第3卷是略去subtitle的测试格式。

from biblatex-gb7714-2015.

zepinglee avatar zepinglee commented on June 12, 2024

按照国标的示例,似乎应该按照这个格式:“题名: 卷次 分卷书名”。

Screenshot 2023-12-31 at 14 51 55

from biblatex-gb7714-2015.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.