如何用速记法进行交叉引用?

如何用速记法进行交叉引用?

Inproceedings当我用Proceedingsas引用条目时,有人可以帮我做速记crossref吗?

我使用这个代码:

\documentclass[a4paper]{article}

\usepackage[T1]{fontenc}

\usepackage[english,ngerman]{babel}

\usepackage[style=verbose-ibid,citepages=suppress,sorting=nty]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{conference.bib}

@Inproceedings{Science:Environment2000,
title = {Environmental Science and Management in Developing versus Developed Countries: education and research perspectives},
crossref = {Environment2000},
author = {John Doe},
pages = {23--45}
}


@Inproceedings{health:Environment2000,
title = {Public health: implications from a compromised environment },
crossref = {Environment2000},
author = {Ho Chi Minh},
pages = {330--335}
}

@Proceedings{Environment2000,
title = {International Conference on Environmental Pollution, Restoration,and Management},
booktitle = {International Conference on Environmental Pollution, Restoration,and Management},
shorthand = {ICEP},
date = {2000},
}

@Article{Episkepsis1970:1,
title = {Decide ne plus refuser},
crossref = {Episkepsis},
date = {1970},
number = {1},
pages = {6--7},
}


@Article{Episkepsis1972:62,
title = {La jeunesse et la préparation},
crossref = {Episkepsis},
date = {1972},
number = {62},
pages = {5--7},
}

@Article{Episkepsis2009:701,
title = {Réunion à Chambésy de la IV\textsuperscript{e} Conférence},
crossref = {Episkepsis},
date = {2009},
number = {701},
pages = {8--21}
}

@Collection{Episkepsis,
journaltitle = {Episkepsis},
publisher = {Ceneter OPO},
address = {Chambésy--Genève},
shorthand = {EP},
keywords = {primary},
}

\end{filecontents}

\addbibresource{conference.bib}


\begin{document}
test\footcite[331]{health:Environment2000} est\footcite[23--27]{Science:Environment2000} test \footcite[23--27]{Episkepsis1970:1}test\footcite[23--27]{Episkepsis1972:62} \footcite[23--27]{Episkepsis2009:701}

\printbibliography

\end{document}

我有这个

在此处输入图片描述

但我希望

  1. 胡志明。“公共卫生:环境受损的影响”。载于:环境污染、恢复和管理国际会议。2000 年(以下简称为 ICEP),第 331 页。
  2. John Doe。“发展中国家与发达国家的环境科学与管理:教育与研究视角”。载于:ICEP,第 23-27 页

Incollection对于和(对于我使用的@Article文章,可能不正确)条目也是如此。crossref@Collection

谢谢。

答案1

此解决方案使用交叉引用xref而不是,crossref以便与任一后端一致地工作。它基于biblatex手册(版本 1.4b)第 4.11.1 节中的示例。

\documentclass[a4paper]{article}
\usepackage[style=verbose-ibid,citepages=suppress,sorting=nty]{biblatex}
\usepackage{filecontents}

\newbibmacro*{cite:xref}{%
    \ifciteseen
        {\iffieldundef{shorthand}
            {\usebibmacro{cite:short}}
            {\usebibmacro{cite:shorthand}}}
        {\ifentrytype{periodical}
            {\usebibmacro{cite:short}\usebibmacro{shorthandintro}}
            {\usebibmacro{cite:full}}}}

\DeclareCiteCommand{\xrefcite}
    {}
    {\usebibmacro{cite:xref}}
    {}
    {}

\renewbibmacro*{journal}{%
    \iffieldundef{xref}
        {\iffieldundef{journaltitle}
            {}
            {\printtext[journaltitle]{%
                \printfield[titlecase]{journaltitle}%
                \setunit{\subtitlepunct}%
                \printfield[titlecase]{journalsubtitle}}}}
        {\entrydata{\thefield{xref}}{%
            \ifboolexpr{
                test {\iffieldundef{title}}
                and
                test {\iffieldundef{subtitle}}
            }
            {}
            {\printtext[title]{\printfield[titlecase]{title}%
                \setunit{\subtitlepunct}%
                \printfield[titlecase]{subtitle}}}}}}

\DeclareBibliographyDriver{article}{%
    \usebibmacro{bibindex}%
    \usebibmacro{begentry}%
    \usebibmacro{author/translator+others}%
    \setunit{\labelnamepunct}\newblock
    \usebibmacro{title}%
    \newunit
    \printlist{language}%
    \newunit\newblock
    \usebibmacro{byauthor}%
    \newunit\newblock
    \usebibmacro{bytranslator+others}%
    \newunit\newblock
    \printfield{version}%
    \newunit\newblock
    \usebibmacro{in:}%
    \ifthenelse{\ifbibliography\OR\iffieldundef{xref}}
        {\usebibmacro{journal+issuetitle}%
            \newunit
            \usebibmacro{byeditor+others}%
            \newunit
            \usebibmacro{note+pages}%
            \newunit\newblock
            \iftoggle{bbx:isbn}{\printfield{issn}}{}%
            \newunit\newblock
            \usebibmacro{doi+eprint+url}%
            \newunit\newblock
            \usebibmacro{addendum+pubstate}%
            \newunit\newblock
            \setunit{\bibpagerefpunct}\newblock
            \usebibmacro{pageref}%
            \usebibmacro{finentry}}%
        {\xrefcite{\thefield{xref}}%
            \ifciteseen{}{%
                \setunit{\addspace}%
                \usebibmacro{volume+number+eid}%
                \setunit{\addspace}%
                \usebibmacro{issue+date}}}}

\newbibmacro*{in:collection}{%
    \usebibmacro{byeditor+others}%
    \newunit\newblock
    \printfield{edition}%
    \newunit
    \iffieldundef{maintitle}{\printfield{volume}\printfield{part}}{}%
    \newunit
    \printfield{volumes}%
    \newunit\newblock
    \usebibmacro{series+number}%
    \newunit\newblock
    \usebibmacro{publisher+location+date}%
    \newunit\newblock
    \iftoggle{bbx:isbn}{\printfield{isbn}}{}}

\DeclareBibliographyDriver{incollection}{%
    \usebibmacro{bibindex}%
    \usebibmacro{begentry}%
    \usebibmacro{author/translator+others}%
    \setunit{\labelnamepunct}\newblock
    \usebibmacro{title}%
    \newunit
    \printlist{language}%
    \newunit\newblock
    \usebibmacro{byauthor}%
    \newunit\newblock
    \usebibmacro{in:}%
    \iffieldundef{xref}
        {\usebibmacro{maintitle+booktitle}%
            \newunit\newblock
            \usebibmacro{in:collection}}%
        {\ifcitation
            {\xrefcite{\thefield{xref}}}
            {\entrydata{\thefield{xref}}{%
                \usebibmacro{title}%
                \newunit\newblock
                \usebibmacro{in:collection}}}}%
    \newunit\newblock
    \usebibmacro{chapter+pages}%
    \newunit\newblock
    \printfield{note}%
    \newunit\newblock
    \usebibmacro{doi+eprint+url}%
    \newunit\newblock
    \usebibmacro{addendum+pubstate}%
    \setunit{\bibpagerefpunct}\newblock
    \usebibmacro{pageref}%
    \usebibmacro{finentry}}

\newbibmacro*{in:proceedings}{%
    \usebibmacro{event+venue+date}%
    \newunit\newblock
    \usebibmacro{byeditor+others}%
    \newunit\newblock
    \iffieldundef{maintitle}{\printfield{volume}\printfield{part}}{}%
    \newunit
    \printfield{volumes}%
    \newunit\newblock
    \usebibmacro{series+number}%
    \newunit\newblock
    \printlist{organization}%
    \newunit
    \usebibmacro{publisher+location+date}%
    \newunit\newblock
    \iftoggle{bbx:isbn}{\printfield{isbn}}{}}

\DeclareBibliographyDriver{inproceedings}{%
    \usebibmacro{bibindex}%
    \usebibmacro{begentry}%
    \usebibmacro{author/translator+others}%
    \setunit{\labelnamepunct}\newblock
    \usebibmacro{title}%
    \newunit
    \printlist{language}%
    \newunit\newblock
    \usebibmacro{byauthor}%
    \newunit\newblock
    \usebibmacro{in:}%
    \iffieldundef{xref}
        {\usebibmacro{maintitle+booktitle}%
            \newunit\newblock
            \usebibmacro{in:proceedings}}%
        {\ifcitation
            {\xrefcite{\thefield{xref}}}
            {\entrydata{\thefield{xref}}{%
                \usebibmacro{title}%
                \newunit\newblock
                \usebibmacro{in:proceedings}}}}%
    \newunit\newblock
    \usebibmacro{chapter+pages}%
    \newunit\newblock
    \printfield{note}%
    \newunit\newblock
    \usebibmacro{doi+eprint+url}%
    \newunit\newblock
    \usebibmacro{addendum+pubstate}%
    \setunit{\bibpagerefpunct}\newblock
    \usebibmacro{pageref}
    \usebibmacro{finentry}}

\begin{filecontents}{\jobname.bib}
@Inproceedings{Science:Environment2000,
title = {Environmental Science and Management in Developing versus Developed Countries: education and research perspectives},
xref = {Environment2000},
author = {John Doe},
pages = {23--45}}

@Inproceedings{health:Environment2000,
title = {Public health: implications from a compromised environment},
xref = {Environment2000},
author = {Ho Chi Minh},
pages = {330--335}}

@Proceedings{Environment2000,
title = {International Conference on Environmental Pollution, Restoration, and Management},
shorthand = {ICEP},
date = {2000}}

@InCollection{westfahl:space,
xref = {westfahl:frontier},
author = {Westfahl, Gary},
title = {The True Frontier},
subtitle = {Confronting and Avoiding the Realities of Space in American Science Fiction Films},
pages = {55--65}}

@Collection{westfahl:frontier,
editor = {Westfahl, Gary},
shorthand = {FTSF},
title = {Space and Beyond},
subtitle = {The Frontier Theme in Science Fiction},
publisher = {Greenwood},
location = {Westport, Conn. and London},
date = {2000}}

@Article{Episkepsis1970:1,
title = {Decide ne plus refuser},
xref = {Episkepsis},
date = {1970},
number = {1},
pages = {6--7}}

@Article{Episkepsis1972:62,
title = {La jeunesse et la preparation},
xref = {Episkepsis},
date = {1972},
number = {62},
pages = {5--7}}

@Article{Episkepsis2009:701,
title = {Reunion a Chambesy de la IV\textsuperscript{e} Conference},
xref = {Episkepsis},
date = {2009},
number = {701},
pages = {8--21}}

@periodical{Episkepsis,
options = {skipbib=true},
title = {Episkepsis},
shorthand = {EP},
date = {1970/},
publisher = {Ceneter OPO},
address = {Chambesy--Geneve},
keywords = {primary}}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\footcite[cf.][332]{health:Environment2000}
\footcite{Science:Environment2000}
\footcite[331]{health:Environment2000}
\footcite{westfahl:space}
\footcite{westfahl:frontier}
\footcite[cf.][6]{Episkepsis1972:62}
\footcite{Episkepsis2009:701}
\footcite[7]{Episkepsis1972:62}
\printbibliography
\end{document}

在此处输入图片描述

一些说明:

  • 此处的交叉引用实际上调用了父条目的显式引用。这样做是为了确保父条目可供子引用。[要了解我的意思,请尝试创建\xrefcite一个(隐式)内部命令(通过将其重命名为bbx@xref),然后添加biblatex包选项mincrossrefs=99。另请参阅xref手册中的条目描述。]

  • 上述项目的结果是,除非您添加其条目,否则每个父级都将出现在参考书目中options = {skipbib=true}。(有关示例,请参阅上面的 @periodical 条目。)

  • 在此设置中,@article仅从 继承和journaltitle。子条目类型和从 继承更多字段-几乎所有我认为特定于父级的内容。可以通过编辑上述参考书目驱动程序和宏来更改其中任何一项。journalsubtitle@periodical@inproceedings@incollection@proceedings@collection

  • 使用xref进行交叉引用的一个缺点是没有为您定义继承。但crossref行为取决于后端。它似乎也给出了一些意想不到的结果。例如,使用biber,子代@article将获得与其父代相同的日期格式@periodical。使用bibtex,任何子代都会被引用其父代的简写形式。

*可能是由于biblatex我对界面的误用......

相关内容