我想禁用 .bib 文件中希腊文标题的斜体,但不禁用整个文档的斜体。我应该怎么做?
我认为最好的方法是\emph{}
在需要时使用希腊字符而不使用\textgreek{}
[我只需要几次希腊语斜体],并禁用斜体选项\textgreek{}
,但我不知道如何在主文档的序言中执行最后一个操作。
% !TeX encoding = UTF-8
% !TeX TS-program = xelatex
% !TeX spellcheck = it_IT
% !TeX root = Italics.tex
% !BIB TS-program = biber
\documentclass[a4paper,12pt]{article}
\usepackage[no-math]{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Linux Libertine O}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{latin,greek,english,german,russian,serbian}
\setkeys{greek}{variant=polytonic}
\usepackage[style=phys, sorting=none, defernumbers=true]{biblatex}
\addbibresource{bibliography.bib}
\begin{document}
\emph{ἄνθρωπος}
\printbibliography[keyword=regular,title={Bibliography}]
\nocite{*}
\end{document}
@book{Sathas.1872,
editor = {Sathas, Konstantinos N.},
year = {1872-1894},
title = {\textgreek{Μεσαιωνικὴ Βιβλιοθήκη. Συλλογὴ ἀνεκδότων μνημείων τῆς Ἑλλενικῆς ἱστορίας}},
volumes = {I-VII},
address = {\textgreek{Παρίσι}},
publisher = {\textgreek{Ἑταιρεία Μακεδονικῶν Σπουδῶν}}
}
答案1
如果您只想更改某种语言的标题格式,则需要languageid
在条目中设置,并在格式化命令中使用来检查\iffieldequalstr
。
在SathasA
字段中languageid
设置为greek
,而在SathasB
字段中则完全省略:
\documentclass[a4paper,12pt]{article}
\begin{filecontents*}{\jobname.bib}
@book{SathasA,
editor = {Sathas, Konstantinos N.},
date = {1872},
title = {Μεσαιωνικὴ Βιβλιοθήκη. Συλλογὴ ἀνεκδότων μνημείων τῆς Ἑλλενικῆς ἱστορίας},
volumes = {I-VII},
address = {Παρίσι},
publisher = {Ἑταιρεία Μακεδονικῶν Σπουδῶν},
langid = {greek}
}
@book{SathasB,
editor = {Sathas, Konstantinos N.},
date = {1872},
title = {Μεσαιωνικὴ Βιβλιοθήκη. Συλλογὴ ἀνεκδότων μνημείων τῆς Ἑλλενικῆς ἱστορίας},
volumes = {I-VII},
address = {Παρίσι},
publisher = {Ἑταιρεία Μακεδονικῶν Σπουδῶν},
}
\end{filecontents*}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Linux Libertine O}
\usepackage{csquotes}
\usepackage{polyglossia}
\setmainlanguage{italian}
\setotherlanguages{greek,english}
\setkeys{greek}{variant=polytonic}
\usepackage[style=phys, sorting=none]{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{title}{% <-- change the format of the title field
\iffieldequalstr{langid}{greek}{\normalfont{#1}}{\mkbibitalic{#1}}}
% if langid = greek, then use \normalfont else use \mkbibitalic
\begin{document}
\emph{ἄνθρωπος} \autocite{SathasA}
\emph{ἄνθρωπος} \autocite{SathasB}
\printbibliography[title={Bibliography}]
\end{document}
如果您想要希腊语的完整引文(翻译的字符串等),那么请添加 biblatex 选项autolang=other
: