![如果在引用时给出了页面,则将页面字段从 bib-entry 中移除,并使用 incollection](https://linux22.com/image/301259/%E5%A6%82%E6%9E%9C%E5%9C%A8%E5%BC%95%E7%94%A8%E6%97%B6%E7%BB%99%E5%87%BA%E4%BA%86%E9%A1%B5%E9%9D%A2%EF%BC%8C%E5%88%99%E5%B0%86%E9%A1%B5%E9%9D%A2%E5%AD%97%E6%AE%B5%E4%BB%8E%20bib-entry%20%E4%B8%AD%E7%A7%BB%E9%99%A4%EF%BC%8C%E5%B9%B6%E4%BD%BF%E7%94%A8%20incollection%20.png)
由于这里的两个用户已经对我的上一个问题提供了很大的帮助,所以这里出现了一个新问题。如果我第一次引用 incolletion 或 inbook(详细设置),它将打印 .bib 文件的页面。但是如果你引用某些内容,通常必须给出该引用的确切页码。因此,如果我给 \cite 我自己的页码,我想将 .bib 文件中的页面字段留空。我不能省略 .bib 文件的页面字段,因为页面必须显示在参考书目中。所以我得到了这个:
现在有两次页面引用,一次来自 .bib 条目,一次手动来自 \footcite 命令。所以我想把 2610-2613 去掉,只打印 15。我希望这在某种程度上是可行的,所以这里是我的 MWE:
\documentclass[11pt, a4paper]{scrreprt} %Inhaltsverzeichnis andere Schrift.. bei report normal
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@inbook{Kline:Commune,
author = {Kline, Michael and Nilsen, Micheline},
title = {Paris Commune, 1871},
editor = {Ness, Immanuel and Herz, Jonah},
booktitle = {The International Encyclopedia of Revolution and Protest},
booksubtitle = {1500 to the Present},
volume = {5},
pages = {2610--2613},
date = {2009},
location = {Chichester},
}
\end{filecontents}
%=============BIBLIOGRAPHIE, ZITIERWEISE=================== %
\usepackage[babel,german=guillemets]{csquotes}
\usepackage[%
style=alphabetic,
style=verbose-ibid,
labeldate,
dashed=false, %bei mehreren Werken desselben Autors kein Strich
backend=bibtex8,
idemtracker=false,
ibidtracker=constrict,
]{biblatex}
\usepackage{xpatch}
%Hg. bzw Hgg. in Klammern hinter Herausgeber, statt davor und vor Titel
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{\printnames[byeditor]{editor}%
\setunit{\addspace}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}%
\newunit}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}
\setunit{\addcolon\space}
\usebibmacro{booktitle}}
\xpatchbibmacro{byeditor+othersstrg}{\printtext}{\printtext[parens]}{}{}
\DefineBibliographyStrings{german}{%
andothers = {et\ al\adddot}, %et al. statt u.a.
editor = {\mkbibparens{Hg\adddot}}, %Hg. statt Hrsg.
editors = {\mkbibparens{Hgg\adddot}}, %Hgg. plural
byeditor = {\mkbibparens {Hg\adddot}},
}
\DeclareFieldFormat{postnote}{#1} %unterdrückt Präfix S.
\DeclareFieldFormat{multipostnote}{#1} %unterdrückt Präfix S.
\DeclareNameAlias{default}{last-first} %Autoren immer Nachname, Vorname sortieren
\renewbibmacro*{cite:short}{%
\printnames{labelname}%
\setunit*{\nameyeardelim}%
\iffieldundef{labelyear}
{}
{\printtext[\addcolon]{\printtext[bibhyperlink]{%
\printfield{labelyear}%
\printfield{extrayear}}}}}
%\DeclareNameFormat{default}{%
%\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}%
%\usebibmacro{name:andothers}}
\renewcommand{\multinamedelim}{\addsemicolon\space} %Semikolon zum trennen der Autoren
\renewcommand{\finalnamedelim}{\addsemicolon\space}
\renewcommand{\labelnamepunct}{\addcolon\space} %Zwischen Autor und Titel Doppelpunkt, kein Punkt
\renewcommand{\postnotedelim}{\addcolon\space} %Zwischen Jahrzahl und Seitenzahl Doppelpunkt, kein Komma
\renewcommand{\nametitledelim}{\addspace}
\renewbibmacro*{publisher+location+date}{% %Zwischen Ort und Jahr kein Komma
\printlist{location}%
{\setunit*{\addspace}}
\usebibmacro{date}%
\newunit}
\renewbibmacro*{maintitle+booktitle}{%
\iffieldundef{maintitle}
{}
{\usebibmacro{maintitle}%
\newunit\newblock
\iffieldundef{volume}
{}
{\printfield{volume}%
\printfield{part}%
\setunit{\addcolon\space}}}%
%\usebibmacro{booktitle}%
\newunit}
\xpatchbibdriver{inbook}{%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
}%
{%
\usebibmacro{byeditor+others}%
\setunit{\addcolon\space}\newblock
\usebibmacro{maintitle+booktitle}%
}%
{}{}%
\xpatchbibdriver{inbook}{%
\newunit\newblock
\usebibmacro{chapter+pages}%
}%
{%
\addcolon\space
\usebibmacro{chapter+pages}%
}%
{}{}
\xpatchbibdriver{inbook}{%
\newunit
\iffieldundef{maintitle}
}%
{%
\setunit{\addcomma\space}
\iffieldundef{maintitle}
}%
{}{}
\xpatchbibdriver{incollection}{%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
}%
{%
\usebibmacro{byeditor+others}%
\setunit{\addcolon\space}\newblock
\usebibmacro{maintitle+booktitle}%
}%
{}{}%
\xpatchbibdriver{incollection}{%
\newunit\newblock
\usebibmacro{chapter+pages}%
}%
{%
\addcolon\space
\usebibmacro{chapter+pages}%
}%
{}{}
\xpatchbibdriver{incollection}{%
\newunit
\iffieldundef{maintitle}
}%
{%
\setunit{\addcomma\space}
\iffieldundef{maintitle}
}%
{}{}
%Titel nicht in Anführungszeichen; S. vor Seitenangabe entfernen
\DeclareFieldFormat[inbook]{title}{#1}
\DeclareFieldFormat[inbook]{pages}{#1}
\DeclareFieldFormat[incollection]{title}{#1}
\DeclareFieldFormat[incollection]{pages}{#1}
\DeclareFieldFormat[article]{title}{#1}
\DeclareFieldFormat[article]{pages}{#1}
%\renewcommand{\nametitledelim}{\space}
\bibliography{test} %name des .bib-Files
% Titel nicht schräg
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat{citetitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{maintitle}{#1}
% Journal Titel nicht schräg
\DeclareFieldFormat{journaltitle}{#1}
%=============ENDE BIBLIOGRAPHIE, ZITIERWEISE=================== %
\begin{document}
Test\footcite[15]{Kline:Commune}
\printbibliography
\end{document}
答案1
正如@moewe 所说:citepages=omit 将在需要时打印引用的页面,如果遗漏则打印 .bib 文件中的页面条目。