我正在使用scrreprt
KOMA 级biblatex
。
我已按要求设置了引文和参考书目:
但是,缺少一个细节:我希望参考书目中的作者既使用小写字母,又使用粗体字母(目前,他们只使用小写字母)。
有办法实现这个吗?
我花了一些时间反复试验并扫描 biblatex 文档,但没有找到我需要的内容。
在此先感谢您的帮助。
\documentclass[12pt, twoside, openright, chapterprefix, numbers=noenddot]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm,headheight=15pt,includeheadfoot]{geometry}
\usepackage[automark,headsepline=off]{scrlayer-scrpage} % use document with \pagestyle{scrheadings}
%%% Deutsche Zeichen und Schrift
\usepackage[ngerman]{babel} % deutsche Trennregeln
\usepackage{lmodern} % fixes bug with \usepackage[T1]{fontenc}; ändert Schriftart zudem in Latin Modern
\usepackage[T1]{fontenc} % für europäische Autoren ratsam; % wichtig für Trennung von Wörtern mit Umlauten
\usepackage[utf8]{inputenc}
%\usepackage[ansinew]{inputenc}
\usepackage{textcomp}
\usepackage[T1,hyphens]{url}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linktocpage=true, linktoc=all,
%linkcolor=beierblau,
citecolor=beierblau, filecolor=beierblau, urlcolor=beierblau, breaklinks=false,
bookmarksopen=true, colorlinks, linkcolor = black}
\usepackage[all]{hypcap} % needed to help hyperlinks direct correctly;
\usepackage[numbered]{bookmark}
\usepackage{xcolor}
\definecolor{beierblau}{RGB}{0,0,255}
%%% bibliography
\usepackage[style=authoryear, backend=biber,
%alphabetic --> see https://de.sharelatex.com/learn/biblatex_bibliography_styles; https://de.sharelatex.com/learn/Biblatex_citation_styles
refsegment=chapter, % benutze automatisch Kapitel als Biobliographie-Abschnitte... (refsegment makes sure that identical references have the same label throughout the whole document; as opposed to refsection)
% scauthors = true
]{biblatex}
\ExecuteBibliographyOptions{firstinits=true,maxcitenames=1,maxbibnames=999,isbn=false,doi=false,url=false,labeldate=true,uniquelist=minyear}
%% set borders
\setlength{\bibitemsep}{12pt}
\setlength{\bibhang}{0cm}
%\setlength{\bibhang}{0.2cm} rückt mehrere Zeilen ein
%% fix sorting
\DeclareNameAlias{sortname}{last-first}
%% no "quotes" around titles of chapters/article titles; text-style of title in bibliography
\DeclareFieldFormat[article, book, inbook, incollection, inproceedings, misc, thesis, unpublished]{title}{\textit{#1}} % \textit for italic style titles; \textnormal for regular text
%% titles of articels and incollections not italic
\DeclareFieldFormat[article]{journaltitle}{\textnormal{#1}}
\DeclareFieldFormat[incollection]{booktitle}{\textnormal{#1}}
%% separation style between authors
\AtBeginBibliography{%
\renewcommand*{\multinamedelim}{\addsemicolon\space}%
\renewcommand*{\finalnamedelim}{\addsemicolon\space}%
}
\DefineBibliographyStrings{ngerman}{%
andothers = {et\addspace al\adddotspace},%
andmore = {et\addspace al\adddotspace},%
}
%% Authors in small caps in citation and bibliography
\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}
\renewcommand*{\mkbibnameprefix}[1]{\textsc{#1}}
%% Format of punctuation after author+year
\renewcommand*{\labelnamepunct}{
% \mkbibbold
{\adddotspace}} % \addcolon\space
%%Add bib resource
\addbibresource{Literatur/citavi.bib}
%%% Example bibliography
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Giancoli,
Author = {Douglas C. Giancoli},
Publisher = {Pearson},
Title = {Physics for Scientists \& Engineers},
Year = {2014},
Date-Added = {2015-10-05 12:23:12 +0000},
Date-Modified = {2015-10-05 12:23:50 +0000},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\chapter{Test-Kapitel}
Some \cite{Giancoli} text \autocite{Giancoli}
\printbibliography[segment=\therefsegment, heading=subbibintoc, title={Literatur}]
\end{document}
答案1
要更改参考书目中条目的家族名称所用的字体,只需在之前使用以下命令\printbibliogrphy
:
\renewcommand*{\mkbibnamefamily}[1]{\textsc{\textbf{#1}}}
\renewcommand*{\mkbibnameprefix}[1]{\textsc{\textbf{#1}}}
请注意,正确的宏名不是\mkbibnamefamily
。\mkbibnamelast
后者仅用于旧版支持,在 之后无效\begin{document}
。但 lmodern
不支持粗体小型大写字母。
biblatex
名称格式化的命令是:
\mkbibnamefamily
\mkbibnamegiven
\mkbibnameprefix
\mkbibnamesuffix
笔记:为了获得看起来像粗体小型大写字母的东西,contour
如果您的字体不支持它们,您可以使用该包,但请注意,这可能会导致输出看起来很丑陋:
\usepackage{contour}
\contourlength{0.01em}% adjust how bold it'll get
\renewcommand*{\mkbibnamefamily}[1]{\contour{black}{\textsc{#1}}}
\renewcommand*{\mkbibnameprefix}[1]{\contour{black}{\textsc{#1}}}
答案2
技术答案是添加\textbf{...}
以下内容的定义:
%% Authors in small caps in citation and bibliography
\renewcommand*{\mkbibnamelast}[1]{\textbf{\textsc{#1}}}
\renewcommand*{\mkbibnameprefix}[1]{\textbf{\textsc{#1}}}
但问题是你使用的字体系列 Latin Modern。它确实不是支持粗体字体和小帽子。
为了显示该内容,您需要使用支持粗体和小型大写字母的字体...抱歉,我不知道支持此功能的字体...
您的代码有一些错误(使用了弃用的选项)。请参阅以下更正后的 MWE(请参阅 了解<======
重要的代码更改,并请注意我更改了调用包的顺序!):
%%% Example bibliography
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Giancoli,
Author = {Douglas C. Giancoli},
Publisher = {Pearson},
Title = {Physics for Scientists \& Engineers},
Year = {2014},
Date-Added = {2015-10-05 12:23:12 +0000},
Date-Modified = {2015-10-05 12:23:50 +0000},
}
\end{filecontents}
\documentclass[%
12pt, twoside, openright, chapterprefix, numbers=noenddot
]{scrreprt}
\usepackage[%
left=2cm,right=2cm,top=2cm,bottom=2cm,headheight=15pt,
includeheadfoot
]{geometry}
\usepackage[automark,headsepline=off]{scrlayer-scrpage} % use document with \pagestyle{scrheadings}
%%% Deutsche Zeichen und Schrift
\usepackage[ngerman]{babel} % deutsche Trennregeln
\usepackage{lmodern} % fixes bug with \usepackage[T1]{fontenc}; ändert Schriftart zudem in Latin Modern
\usepackage[T1]{fontenc} % für europäische Autoren ratsam; % wichtig für Trennung von Wörtern mit Umlauten
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{xcolor}
\definecolor{beierblau}{RGB}{0,0,255}
\usepackage[T1,hyphens]{url}
\usepackage{csquotes}
\usepackage[%
style=authoryear,
backend=biber,
refsegment=chapter, % benutze automatisch Kapitel als Biobliographie-Abschnitte... (refsegment makes sure that identical references have the same label throughout the whole document; as opposed to refsection)
% scauthors = true
]{biblatex}
\ExecuteBibliographyOptions{%
giveninits=true, % <==================================================
maxcitenames=1,maxbibnames=999,
isbn=false,doi=false,url=false,
labeldateparts=true, % <==============================================
uniquelist=minyear
}
\addbibresource{\jobname.bib}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linktocpage=true, linktoc=all,
%linkcolor=beierblau,
citecolor=beierblau, filecolor=beierblau, urlcolor=beierblau, breaklinks=false,
bookmarksopen=true, colorlinks, linkcolor = black}
\usepackage[all]{hypcap} % needed to help hyperlinks direct correctly;
\usepackage[numbered]{bookmark}
%% set borders
\setlength{\bibitemsep}{12pt}
\setlength{\bibhang}{0cm}
%\setlength{\bibhang}{0.2cm} rückt mehrere Zeilen ein
%% fix sorting
\DeclareNameAlias{sortname}{family-given} % <===========================
%% no "quotes" around titles of chapters/article titles; text-style of title in bibliography
\DeclareFieldFormat[article, book, inbook, incollection, inproceedings, misc, thesis, unpublished]{title}{\textit{#1}} % \textit for italic style titles; \textnormal for regular text
%% titles of articels and incollections not italic
\DeclareFieldFormat[article]{journaltitle}{\textnormal{#1}}
\DeclareFieldFormat[incollection]{booktitle}{\textnormal{#1}}
%% separation style between authors
\AtBeginBibliography{%
\renewcommand*{\multinamedelim}{\addsemicolon\space}%
\renewcommand*{\finalnamedelim}{\addsemicolon\space}%
}
\DefineBibliographyStrings{ngerman}{%
andothers = {et\addspace al\adddotspace},%
andmore = {et\addspace al\adddotspace},%
}
%% Authors in small caps in citation and bibliography
\renewcommand*{\mkbibnamefamily}[1]{\textbf{\textsc{#1}}} % <===========
\renewcommand*{\mkbibnameprefix}[1]{\textbf{\textsc{#1}}} % <===========
%\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}
%\renewcommand*{\mkbibnameprefix}[1]{\textsc{#1}}
%% Format of punctuation after author+year
\renewcommand*{\labelnamepunct}{
% \mkbibbold
{\adddotspace}} % \addcolon\space
\begin{document}
\chapter{Test-Kapitel}
Some \cite{Giancoli} text \autocite{Giancoli}
\printbibliography[%
segment=\therefsegment,
heading=subbibintoc,
title={Literatur}
]
\end{document}