打印到参考书目时更改页面位置

打印到参考书目时更改页面位置

我目前正在研究我的参考书目模板。我对目前的结果非常满意 - 只有一件事让我感到不安:

打印详细信息的顺序。

我的最小例子:

\documentclass[a4paper,12pt,headsepline]{scrartcl}
\usepackage{csquotes}
\usepackage[style=authoryear-comp,      % How should the citation look like in the text?
            backend=biber,
            natbib=true,                % Supports numeric and author-year citation schemes, incorporating
                                        % sorting and compression code found in the cite package.
            maxcitenames=2,             % How many names before et al.
            doi=true,                   % Show DOI
            isbn=false,                 % Show ISBN
            url=false                   % Show URL  
            ]{biblatex}
\renewcommand*{\nameyeardelim}{\addspace}   %removes the comma before the year in citations

\DefineBibliographyStrings{english}{andothers = {{et\,al\adddot}}} % et al. with only a half space

% Print authors bold in bibliography
\DeclareNameFormat{family-given-bold}{\mkbibbold{%  family name - given (first) name - bold(new)
        \ifgiveninits  %long first name if \namepartgiven and short first name when \namepartgiveni below
        {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiveni}{\namepartprefix}{\namepartsuffix}}
        {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiven}{\namepartprefix}{\namepartsuffix}} 
        \usebibmacro{name:andothers}}}      
    \DeclareNameAlias{sortname}{family-given-bold}

% Print 'Vol. ' in front of volume number
\renewbibmacro*{journal+issuetitle}{\usebibmacro{journal}\addcomma\space Vol. \usebibmacro{volume+number+eid}}

% Do not print locations and years, but publisher in a new line
\renewbibmacro*{publisher+location+date}{\newline Pub.:\printlist{publisher}}

% Do not print months
\AtEveryBibitem{\clearfield{month}}                                      % 
\AtEveryCitekey{\clearfield{month}\renewcommand*\finalnamedelim{\,\&\,}} % also changes 'and' to '&' in citations

% New line after authors in bibliography
%\renewcommand*{\labelnamepunct}{\newline\bibsentence}

% Remove the dot after the (year) in bibliography
\renewcommand{\labelnamepunct}{\addspace}

% Prevent journal & book title to be italic font
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{booktitle}{#1} 

% New line after title
\usepackage{xpatch}
\makeatletter
\def\do#1{
    \ifcsdef{blx@bbx@#1}
    {\xpatchbibdriver{#1}
        {\printlist{language}%
            \newunit\newblock}
        {\printlist{language}%
            \printunit{\newline\bibsentence}}
        {}{}}
    {}} 
\abx@doentrytypes
\makeatother

% DOI in a seperate line    
\DeclareFieldFormat{doi}{%
    \newline
    \mkbibacro{DOI}\addcolon\space
    \ifhyperref
    {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}   % makes the DOI clickable with a hyper ref
    {\nolinkurl{#1}}}

% More space between entrys in bibliography
\setlength\bibitemsep{1.5\itemsep}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}

% No page break within a bibliography entry
\patchcmd{\bibsetup}{\interlinepenalty=5000}{\interlinepenalty=10000}{}{}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
    @incollection{inColl,
        author    = {Author11 and Author12 and Author13},
        editor    = {Editor1},
        title     = {Title1},
        booktitle = {Booktitle1},
        volume = {493},number = {11},
        year      = {2017},
        pages     = {50--67},
        doi       = {10.1001/00000000001},
        publisher = {Publisher1}}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}

hi world! \cite{inColl}
\printbibliography
\end{document}

现在,结果如下:

Author11, Author12, Author13 (2017) "Title"
In : Booktitle, Ed. by Editor, Vol. 493. 11
Pub.: Publisher, pp. 123-456
DOI: 10.1001/00000000001

是否可以切换编辑器、发布者和页面?它应该看起来像这样:

Author11, Author12, Author13 (2017) "Title"
In : Booktitle, Vol. 493. 11, pp. 123-456
Pub.: Publisher, Ed. by Editor,
DOI: 10.1001/00000000001

多谢 :)

答案1

参考书目中元素顺序的重大变化通常需要更改参考书目驱动程序。较小的更改有时可以通过重新定义 bibmacros 或修补驱动程序来实现,但您所追求的更改太大,以至于复制整个驱动程序并重新排列宏调用是有意义的。您可以在standard.bbx(例如,请参阅)中找到宏的原始定义这里) 并可以比较变化(仅移动了几个宏调用)。

在 MWE 中,我只展示了@incollection驱动程序。可能必须做类似的事情才能@inbook保持一致。

\documentclass[a4paper,12pt,headsepline]{scrartcl}
\usepackage{csquotes}
\usepackage[style=authoryear-comp,      % How should the citation look like in the text?
            backend=biber,
            natbib=true,                % Supports numeric and author-year citation schemes, incorporating
                                        % sorting and compression code found in the cite package.
            maxcitenames=2,             % How many names before et al.
            doi=true,                   % Show DOI
            isbn=false,                 % Show ISBN
            url=false,                   % Show URL  
            ]{biblatex}

\DeclareDelimFormat{nameyeardelim}{\addspace}   %removes the comma before the year in citations

\DefineBibliographyStrings{english}{andothers = {{et\,al\adddot}}} % et al. with only a half space

% Print authors bold in bibliography
\DeclareNameFormat{family-given-bold}{\mkbibbold{%  family name - given (first) name - bold(new)
        \ifgiveninits  %long first name if \namepartgiven and short first name when \namepartgiveni below
        {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiveni}{\namepartprefix}{\namepartsuffix}}
        {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiven}{\namepartprefix}{\namepartsuffix}} 
        \usebibmacro{name:andothers}}}      
    \DeclareNameAlias{sortname}{family-given-bold}

% Print 'Vol. ' in front of volume number       
\DeclareFieldFormat[article]{volume}{\bibstring{jourvol}~#1}
\renewbibmacro*{journal+issuetitle}{%
    \usebibmacro{journal}%
    \setunit*{\addcomma\space}% was: \setunit*{\addspace}
    \iffieldundef{series}
    {}
    {\newunit
        \printfield{series}%
        \setunit{\addcomma\space}}% was: \setunit{\addspace}
    \usebibmacro{volume+number+eid}%
    \setunit{\addspace}%
    \usebibmacro{issue+date}%
    \setunit{\addcolon\space}%
    \usebibmacro{issue}%
    \newunit}

% Do not print locations and years, but publisher in a new line
\renewbibmacro*{publisher+location+date}{\newline Pub.:\printlist{publisher}}

\DeclareDelimFormat[cite,parencite]{finalnamedelim}{\,\&\,}

% Do not print months
\AtEveryBibitem{\clearfield{month}}
\AtEveryCitekey{\clearfield{month}}

\DeclareDelimFormat{nametitledelim}{\addspace}

% Prevent journal & book title to be italic font
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{booktitle}{#1} 

\DeclareBibliographyDriver{incollection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \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}}

% New line after title
\usepackage{xpatch}
\makeatletter
\def\do#1{
    \ifcsdef{blx@bbx@#1}
    {\xpatchbibdriver{#1}
        {\printlist{language}%
            \newunit\newblock}
        {\printlist{language}%
            \printunit{\newline\bibsentence}}
        {}{}}
    {}} 
\abx@doentrytypes
\makeatother

% DOI in a seperate line    
\DeclareFieldFormat{doi}{%
    \newline
    \mkbibacro{DOI}\addcolon\space
    \ifhyperref
    {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}   % makes the DOI clickable with a hyper ref
    {\nolinkurl{#1}}}


% More space between entrys in bibliography
\setlength\bibitemsep{1.5\itemsep}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}

% No page break within a bibliography entry
\patchcmd{\bibsetup}{\interlinepenalty=5000}{\interlinepenalty=10000}{}{}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
    @incollection{inColl,
        author    = {Author11 and Author12 and Author13},
        editor    = {Editor1},
        title     = {Title1},
        booktitle = {Booktitle1},
        volume = {493},number = {11},
        year      = {2017},
        pages     = {50--67},
        doi       = {10.1001/00000000001},
        publisher = {Publisher1}}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}

hi world! \cite{inColl}
\printbibliography
\end{document}

Author11、Author12 和 Author13 (2017)。“Title1”//在:Booktitle1。第 493 卷。11,第 50-67 页//出版:Publisher1。编辑:Editor1。//doi:10.1001/00000000001。

相关内容