这是我的代码:
\documentclass[10pt]{beamer}
\usetheme{CambridgeUS}
\usepackage[backend=biber,style=ieee,citestyle=authoryear]{biblatex}
\bibliography{literature.bib}
\begin{document}
network design\parencite{sb2016}
\end{document}
请注意 ( 和作者姓名之间有一个空格。
我尝试过这个:Biblatex[-chicago, authordate] 首次引用的脚注。额外的空格放在括号中但它告诉我 cite:init 未定义。
我以前从未遇到过这个问题。我甚至更新了所需的软件包,看看它是否能纠正错误。没有,它不起作用。很奇怪。
更新:bibentry
@article{sb2016,
title={Strategic design of public bicycle sharing systems with service level constraints},
author={Lin, Jenn-Rong and Yang, Ta-Hui},
journal={Transportation research part E: logistics and transportation review},
volume={47},
number={2},
pages={284--294},
year={2011},
publisher={Elsevier}
}
我正在使用 biblatex 软件包版本 3.7。和 biber 2.7。
更新:包含文章及其日志文件
\documentclass{article}
\usepackage[UTF8]{ctexcap}
%-------------------------------------------------------
% INCLUDE PACKAGES
%-------------------------------------------------------
\usepackage{extramarks} % Required for headers and footers
\usepackage{graphicx} % Required to insert images
\usepackage{tikz} % Required for tikz picture
\usetikzlibrary{fit,arrows,calc,positioning}
\usepackage{xcolor} % Required for color setting
\newcommand{\highlight}[1]{%
\colorbox{red!20}{$\displaystyle#1$}}
\usepackage{amssymb} % Required for math fonts
\usepackage{amsmath} % Required for math notation
\usepackage{mathtools} % Required for math notation
\usepackage{float} % Stop float
\usepackage[timeinterval=1]{tdclock} % Required for clock
\usepackage{mdframed} % Required to change backgroud colour, but no floating support
\usepackage{pgfpages} % Required for split screen note
\usepackage[backend=biber,style=ieee,citestyle=authoryear,citetracker=true,ibidtracker=false]{biblatex} % Required for citation
\renewcommand\citesetup{\footnotesize}
\usepackage{hyperref}
%-------------------------------------------------------
% DRAWING FIGURES TIKZ
%-------------------------------------------------------
% tikz
\usepackage{tikz}
\usepackage{varwidth}
\usetikzlibrary{arrows,shapes,shapes.geometric,calc}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=1.2cm, minimum height=0.7cm,text centered, draw=black, fill=red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=1.2cm, minimum height=0.7cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=1.2cm, minimum height=0.7cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, aspect=1.5, minimum width=0.7cm, minimum height=0.7cm, text centered, text width=1.5cm, draw=black, fill=green!30, execute at begin node={\begin{varwidth}{30em}}, execute at end node={\end{varwidth}}]
\tikzstyle{arrow} = [thick,->,>=stealth]
%-------------------------------------------------------
% DEFFINING AND REDEFINING COMMANDS
%-------------------------------------------------------
\renewcommand{\eqref}[1]{$Eq\ \ref{#1}$}
% citation
\ExecuteBibliographyOptions{firstinits=true, isbn=false, url=false, doi=false, uniquename=init}
\AtEveryCitekey{%
\ifentrytype{article}{
\clearfield{pages}%
\clearfield{volume}%
}{}
}
% font
% \setbeamerfont{footnote}{size=\tiny}
% math underline with color
\newsavebox\MBox
\newcommand\Cunderline[2][red]{{\sbox\MBox{$#2$}%
\rlap{\usebox\MBox}\color{#1}\rule[-1.2\dp\MBox]{\wd\MBox}{0.5pt}}}
% citation
% \setbeamertemplate{bibliography item}{\insertbiblabel}
\DeclareCiteCommand{\sfcite}[\cbx@superscript]%
{\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}{}{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}{}{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
\ifciteseen
{\ifnumequal{\value{page}}{\csuse{cbx@page@\thefield{entrykey}}}
{}
{\ifnumequal{\value{framenumber}}{\csuse{cbx@frame@\thefield{entrykey}}}
{\usebibmacro{sfcite}}
{}}}
{\usebibmacro{sfcite}}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}}
% remove the space in front of the parencite
% reference font
\renewcommand*{\bibfont}{\footnotesize}
\bibliography{literature.bib}
\begin{document}
network design\parencite{lin2011strategic}
\end{document}
答案1
虚假空间是由
\AtEveryCitekey{%
\ifentrytype{article}{
\clearfield{pages}%
\clearfield{volume}%
}{}
}
您需要保护(某些)行尾,以免%
造成空格。请参阅行末百分号(%)有什么用?。
和
\AtEveryCitekey{%
\ifentrytype{article}{%
\clearfield{pages}%
\clearfield{volume}}
{}%
}
空格应该消失。