我目前正在尝试使用 biblatex 制作参考书目来设置文档。我使用了本网站的模板/示例 希列维奇。
一切似乎都进展顺利,但在他的模板中,你可以引用1、[2] 等,或者使用上标数字,然后将参考文献作为脚注。我希望有一个内联引用,例如:(编号、作者、年份)或类似的内容。但不只是数字,也不作为脚注。
我的示例代码目前是这样的:
%%%%%%%%%%%%%%%
% \cite (citation number of normal size in square brackets, no cite info in footnote);
% \superfullcite (superscript citation number, full cite info in footnote);
% \sjcitep (superscript citation number, short cite info in footnote).
%%%%%%%%%%%%%%%
\documentclass[a4paper,12pt]{article}
\usepackage[danish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[margin=1.4in]{geometry}
\usepackage{amsmath, amsthm, amssymb, amsbsy}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[hyperref=true,
url=false,
isbn=false,
backref=true,
style=custom-numeric-comp,
maxcitenames=3,
maxbibnames=100,
backend=bibtex, % while checking on one of my (newest) systems, this option was needed to generate bibliography
block=none]{biblatex}
\usepackage{hyperref}
% back reference text preceding the page number ("see p.")
\DefineBibliographyStrings{english}{%
backrefpage = {se s.}, % for single page number
backrefpages = {se ss.} % for multiple page numbers
}
% the followings activate 'custom-english-ordinal-sscript.lbx'
% in order to print ordinal 'edition' suffixes as superscripts,
% and adjusts (reduces) spacing between suffix and following "ed."
\DeclareLanguageMapping{english}{custom-english-ordinal-sscript}
\DeclareFieldFormat{edition}%
{\ifinteger{#1}%
{\mkbibordedition{#1}\addthinspace{}ed.}%
{#1\isdot}}
% removes period at the very end of bibliographic record
\renewcommand{\finentrypunct}{}
% removes period after DOI and suppresses capitalization
% of the word following DOI ("See p. xx" -> "see p. xx")
\renewcommand{\newunitpunct}{\addspace\midsentence}
\DeclareFieldFormat{journaltitle}{\mkbibemph{#1},} % italic journal title with comma
\DeclareFieldFormat[inbook,thesis]{title}{\mkbibemph{#1}\addperiod} % italic title with period
\DeclareFieldFormat[article]{title}{#1} % title of journal article is printed as normal text
\DeclareFieldFormat[article]{volume}{\textbf{#1}\addcolon\space} % makes volume of journal bold and adds colon
%%%%%%%%%
% the command \sjcitep defined below prints footnote citation above punctuation
\newlength{\spc} % declare a variable to save spacing value
\newcommand{\sjcitep}[2][]{% new command with two arguments: optional (#1) and mandatory (#2)
\settowidth{\spc}{#1}% set value of \spc variable to the width of #1 argument
\addtolength{\spc}{-1.8\spc}% subtract from \spc about two (1.8) of its values making its magnitude negative
#1% print the optional argument
\hspace*{\spc}% print an additional negative spacing stored in \spc after #1
\supershortnotecite{#2}}% print (cite) the mandatory argument
%%%%%%%%%
\bibliography{example_ref_list} % includes file "example_ref_list.bib" with data on the cited references
\title{Title}
\author{Name}
\begin{document}
\maketitle
\section*{Aronova}
Text text
% prints author names as small caps
\renewcommand{\mkbibnamefirst}[1]{\textsc{#1}}
\renewcommand{\mkbibnamelast}[1]{\textsc{#1}}
\renewcommand{\mkbibnameprefix}[1]{\textsc{#1}}
\renewcommand{\mkbibnameaffix}[1]{\textsc{#1}}
\printbibliography
\end{document}
很抱歉这么多评论,但我仍在尝试弄清楚如何使用它:)所以有谁知道我必须做什么才能获得内联引用,而不仅仅是数字或脚注引用。
提前致谢。
答案1
即使是数字格式,有时用(#、作者、年份)而不是 [#] 来引用来源也会很有帮助。下面定义了一个新的 cite 命令来提供这些附加信息。此命令目前既不能压缩(作者、数字),也不能执行 ibidem 函数。
您可以将以下代码添加到您的序言中。
\DeclareCiteCommand{\morecite}[\mkbibparens]%
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\printtext[bibhyperref]{%
\printfield{prefixnumber}%
\printfield{labelnumber}%
\ifbool{bbx:subentry}
{\printfield{entrysetcount}}
{}}%
\ifnameundef{labelname}%
{}
{\setunit{\addcomma\space}%
\printnames{labelname}}%
\setunit{\addcomma\space}%
\printfield{labelyear}}
{\multicitedelim}%
{\usebibmacro{postnote}}%
这将声明一个新的 cite 命令\morecite
,显示标签编号、作者和年份。没有花哨的年份歧义消除等(如果您想要这些authoryear
或 friends 适合您),因为标签编号是识别来源的最终方式。
\documentclass[a4paper,american]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[style=custom-numeric-comp,backend=biber]{biblatex}
\usepackage{hyperref}
\ExecuteBibliographyOptions{labelyear}
\DeclareCiteCommand{\morecite}[\mkbibparens]%
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\printtext[bibhyperref]{%
\printfield{prefixnumber}%
\printfield{labelnumber}%
\ifbool{bbx:subentry}
{\printfield{entrysetcount}}
{}}%
\ifnameundef{labelname}%
{}
{\setunit{\addcomma\space}%
\printnames{labelname}}%
\setunit{\addcomma\space}%
\printfield{labelyear}}
{\multicitedelim}%
{\usebibmacro{postnote}}%
\addbibresource{biblatex-examples.bib} % includes file "example_ref_list.bib" with data on the cited references
\begin{document}
\morecite{westfahl:space} and \morecite{westfahl:frontier}
\printbibliography
\end{document}
产量