使用 biblatex 格式化参考文献

使用 biblatex 格式化参考文献

comma我使用以下示例中的样式来排列参考文献。我想对样式进行一些更改。我需要在科学期刊名称后面添加状态条件,并vol.在卷中写作

    \RequirePackage{filecontents}
    \begin{filecontents}{\jobname.bib}
    @article{einstein,
        author =       "Albert Einstein",
        title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
            [{On} the electrodynamics of moving bodies]",
        journal =      "Annalen der Physik",
        volume =       "322",
        number =       "10",
        pages =        "891--921",
        year =         "1905",
        DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
    }

    @book{latexcompanion,
        author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
        title     = "The \LaTeX\ Companion",
        year      = "1993",
        publisher = "Addison-Wesley",
        address   = "Reading, Massachusetts"
    }

    @misc{knuthwebsite,
        author    = "Donald Knuth",
        title     = "Knuth: Computers and Typesetting",
        url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
    }
    \end{filecontents}


        \documentclass[a4paper,10pt]{article}
        \usepackage[english]{babel}
        \usepackage[utf8]{inputenc}

        \usepackage{csquotes}
        \usepackage[%
          style=numeric, 
          sortcites,
          backend=biber,
          giveninits=true % <===================================================
        ]{biblatex}
        \addbibresource{\jobname.bib}

        \DeclareNameAlias{default}{family-given} % <============================
\renewbibmacro{in:}{}
        \renewcommand*\newunitpunct{\addcomma\space} % <========================
     \renewcommand*\newunitpunct{\addcomma\space} % <========================
        \renewcommand*{\finalnamedelim}{%
          \addspace\bibstring{and}\space}%
        % <===== ^^^^^^^^^^^^^^^^^ =============================================



        \begin{document}

        \section{First Section}
        This document is an example of BibTeX using in bibliography management. 
        Three items are cited: \textit{The \LaTeX\ Companion} book 
        \cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and 
        the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related 
        items are \cite{latexcompanion,knuthwebsite}. 

        \medskip

        \printbibliography

        \end{document}

输出

爱因斯坦,A.,《论运动物体的电动力学》(德语),《物理学年鉴》322.10(1905 年),第 891—921 页,DOI:http://dx.doi.org/10.1002/andp.19053221004

我需要这样的输出

爱因斯坦,A.,《Zur Elektrodynamik bewegter Körper。(德语)[论运动物体的电动力学]》,《物理学年鉴》,第卷。 322.10 (1905),第 891—921 页,DOI:http://dx.doi.org/10.1002/andp.19053221004

comma我需要在科学期刊名称后面添加状态条件,并vol.在卷中写作。即 Annalen der Physik 322.10Annalen der Physik, vol. 322.10

答案1

journal+issuetitle您只需要对bibmacro 和字段格式进行少量更改volume

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/~uno/abcde.html"
}
\end{filecontents}


\documentclass[a4paper,10pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage{csquotes}
\usepackage[%
  style=numeric, 
  sortcites,
  backend=biber,
  giveninits=true,
]{biblatex}
\addbibresource{\jobname.bib}

\DeclareNameAlias{default}{family-given}
\renewbibmacro{in:}{}
\renewcommand*\newunitpunct{\addcomma\space} 

\DefineBibliographyExtras{english}{%
  \let\finalandcomma=\empty
  \let\finalandsemicolon=\empty}

\DeclareFieldFormat[article,periodical]{volume}{\bibstring{jourvol}~#1}
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addcomma\space}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addcomma\space}}%
  \usebibmacro{volume+number+eid}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

\begin{document}
\section{First Section}
This document is an example of BibTeX using in bibliography management. 
Three items are cited: \textit{The \LaTeX\ Companion} book 
\cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and 
the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related 
items are \cite{latexcompanion,knuthwebsite}. 

\printbibliography
\end{document}

示例文档的参考部分

相关内容