如何使“@article”下的论文标题变为斜体,而其余部分则变为直立?

如何使“@article”下的论文标题变为斜体,而其余部分则变为直立?

以下是 sample.tex 的代码

@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",
  keywords =     "physics"
}

@book{dirac,
  title={The Principles of Quantum Mechanics},
  author={Paul Adrien Maurice Dirac},
  isbn={9780198520115},
  series={International series of monographs on physics},
  year={1981},
  publisher={Clarendon Press},
  keywords = {physics}
}

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

这是我的 main.tex 代码

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[
backend=biber,
style=alphabetic,
]{biblatex}
\renewbibmacro{in:}{}
\addbibresource{sample.bib}

\DeclareFieldFormat[article]{citetitle}{#1}
\DeclareFieldFormat[article]{title}{#1}
\begin{document}
\section{First section}

Items that are cited: \textit{The \LaTeX\ Companion} book \cite{latexcompanion}, The Einstein's journal paper \cite{einstein} and the Dirac's book \cite{dirac} are physics related items. Next, a citation about \textit{The \LaTeX\ Companion} book \cite{latexcompanion}.

\medskip

\printbibliography
\end{document}

默认情况下我的输出是

在此处输入图片描述

我的问题是,如何使@article(本主题中的 Eistein 的论文)中的标题变为斜体,而其余部分则变为直立?

就我而言,由于我已经使用了 \usepackage{biblatex},所以我不能使用

\bibliographystyle{amsalpha}

如同https://tex.stackexchange.com/a/122770/106851

那么,在 \usepackage{biblatex} 环境中,amsalpha 的对应项是什么,以便我可以将“@article”下的论文标题设为斜体,而其余部分则设为直立?也欢迎使用其他方法来解决这个问题!

答案1

不要使用此代码来删除文章标题中的所有格式:

\DeclareFieldFormat[article]{citetitle}{#1}
\DeclareFieldFormat[article]{title}{#1}

你应该使用:

\DeclareFieldFormat[article]{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat[article]{title}{\mkbibemph{#1}}

我应该指出,这是一种非标准风格,因为文章标题通常是直立的(带或不带引号),而期刊标题则用斜体表示。

为了使期刊标题直立,请添加:

 \DeclareFieldFormat[article]{journaltitle}{#1}

相关内容