在 \fullcite 中将 journaltitle 改为斜体

在 \fullcite 中将 journaltitle 改为斜体

在一篇文档中,我想在章节开始之前引用一份出版物,其中所有作者和所有文本都以斜体显示。斜体是必要的,因为它可以在视觉上将其与其余文本区分开来。我将以下几行放入我的序言中,它们发挥了应有的作用。\itshape但我无法写出期刊的名称。如果可能的话,我还想删除每次都印在期刊标题前面的“In:”一词。

\preto\fullcite{\AtNextCite{\defcounter{maxnames}{99}}}
\preto\fullcite{\AtNextCitekey{\clearfield{url} \clearfield{doi} 
\clearfield{eprint} \clearfield{pages} \clearfield{note}}}
\preto\fullcite{\AtNextCitekey{\normalfont\itshape}} %\sl for slanted
# This next line doesnt work
#\preto\fullcite{\AtNextCitekey{\DeclareFieldFormat{journaltitle}{\normalfont\itshape{#1}}} %\sl for slanted

先感谢您

答案1

您已经在注释中找到了缺失的右括号,因此这里有一个替代方法,即定义一个新命令\itfullcite,其输出完全为斜体。为了确保不会发生切换,我们只需重新定义biblatex命令\mkbibemph\mkbibitalic

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\makeatletter
\newrobustcmd*{\mkbibforceitalic}[1]{%
  \begingroup
  \mkbibitalic{%
    \renewrobustcmd*{\mkbibemph}{\@firstofone}%
    \renewrobustcmd*{\mkbibitalic}{\@firstofone}%
    #1%
  }%
  \endgroup
}
\makeatother

\DeclareCiteCommand{\itfullcite}[\mkbibforceitalic]
  {\usebibmacro{prenote}}
  {\usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\itfullcite{sigfridsson}

\printbibliography
\end{document}

斜体全文引用和参考书目条目(非斜体)

相关内容